Changeset 251178 in webkit
- Timestamp:
- Oct 15, 2019, 9:01:18 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r251088 r251178 1 2019-10-15 Mark Lam <mark.lam@apple.com> 2 3 operationSwitchCharWithUnknownKeyType failed to handle OOME when resolving rope string. 4 https://bugs.webkit.org/show_bug.cgi?id=202312 5 <rdar://problem/55782280> 6 7 Reviewed by Yusuke Suzuki. 8 9 * stress/operationSwitchCharWithUnknownKeyType-should-avoid-resolving-rope-strings.js: Added. 10 * stress/operationSwitchCharWithUnknownKeyType-should-avoid-resolving-rope-strings2.js: Added. 11 * stress/switch-on-char-llint-rope.js: 12 - Changed this test to make a new rope string for each iterations. Otherwise, 13 the rope will get resolved, and subsequent tiers will not be testing with a rope. 14 1 15 2019-10-14 Yusuke Suzuki <ysuzuki@apple.com> 2 16 -
trunk/JSTests/stress/switch-on-char-llint-rope.js
r242519 r251178 15 15 noInline(foo); 16 16 17 let str = 'a' + constStr();18 17 for (let i = 0; i < 10000; ++i) { 18 let str = 'a' + constStr(); 19 19 let result = foo(str); 20 20 if (result !== 2) -
trunk/Source/JavaScriptCore/ChangeLog
r251160 r251178 1 2019-10-15 Mark Lam <mark.lam@apple.com> 2 3 operationSwitchCharWithUnknownKeyType failed to handle OOME when resolving rope string. 4 https://bugs.webkit.org/show_bug.cgi?id=202312 5 <rdar://problem/55782280> 6 7 Reviewed by Yusuke Suzuki. 8 9 operationSwitchCharWithUnknownKeyType() can only dispatch to a case handler 10 if the key string is of length 1. All other cases should dispatch to the default 11 handler. This patch also adds the missing OOME check. 12 13 Also fixed a bug in SpeculativeJIT::emitSwitchCharStringJump() where the slow 14 path rope resolution was returning after the length check. It needs to return to 15 the point before the length check. 16 17 * dfg/DFGSpeculativeJIT.cpp: 18 (JSC::DFG::SpeculativeJIT::emitSwitchCharStringJump): 19 * jit/JITOperations.cpp: 20 1 21 2019-10-15 Peng Liu <peng.liu6@apple.com> 2 22 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r251106 r251178 10720 10720 m_jit.loadPtr(MacroAssembler::Address(value, JSString::offsetOfValue()), scratch); 10721 10721 auto isRope = m_jit.branchIfRopeStringImpl(scratch); 10722 10722 addSlowPathGenerator(slowPathCall(isRope, this, operationResolveRope, scratch, value)); 10723 10723 10724 addBranch( 10724 10725 m_jit.branch32( … … 10727 10728 TrustedImm32(1)), 10728 10729 data->fallThrough.block); 10729 10730 addSlowPathGenerator(slowPathCall(isRope, this, operationResolveRope, scratch, value)); 10731 10730 10732 10731 m_jit.loadPtr(MacroAssembler::Address(scratch, StringImpl::dataOffset()), value); 10733 10732 -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r251106 r251178 2304 2304 VM& vm = exec->vm(); 2305 2305 NativeCallFrameTracer tracer(vm, exec); 2306 auto throwScope = DECLARE_THROW_SCOPE(vm); 2306 2307 JSValue key = JSValue::decode(encodedKey); 2307 2308 CodeBlock* codeBlock = exec->codeBlock(); … … 2311 2312 2312 2313 if (key.isString()) { 2313 StringImpl* value = asString(key)->value(exec).impl(); 2314 if (value->length() == 1) 2315 result = jumpTable.ctiForValue((*value)[0]).executableAddress(); 2314 JSString* string = asString(key); 2315 if (string->length() == 1) { 2316 String value = string->value(exec); 2317 RETURN_IF_EXCEPTION(throwScope, nullptr); 2318 result = jumpTable.ctiForValue(value[0]).executableAddress(); 2319 } 2316 2320 } 2317 2321
Note:
See TracChangeset
for help on using the changeset viewer.