Changeset 287058 in webkit
- Timestamp:
- Dec 14, 2021, 5:23:39 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 9 edited
-
ChangeLog (modified) (1 diff)
-
jit/JIT.cpp (modified) (3 diffs)
-
jit/JIT.h (modified) (2 diffs)
-
jit/JITOpcodes.cpp (modified) (1 diff)
-
llint/LLIntSlowPaths.cpp (modified) (1 diff)
-
llint/LLIntSlowPaths.h (modified) (1 diff)
-
llint/LowLevelInterpreter.asm (modified) (2 diffs)
-
runtime/CommonSlowPaths.cpp (modified) (1 diff)
-
runtime/CommonSlowPaths.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r287021 r287058 1 2021-12-14 Ross Kirsling <ross.kirsling@sony.com> 2 3 [JSC] OpInstanceofCustom should be in CommonSlowPaths 4 https://bugs.webkit.org/show_bug.cgi?id=234316 5 6 Reviewed by Alexey Shvayka. 7 8 No tier has a fast path for OpInstanceofCustom and this is unlikely to change anytime soon. 9 As such, we should not be having LLInt and Baseline implement *separate* slow paths for this operation; 10 this patch straightforwardly makes use of CommonSlowPaths instead. 11 12 * jit/JIT.cpp: 13 (JSC::JIT::privateCompileMainPass): 14 (JSC::JIT::privateCompileSlowCases): 15 * jit/JIT.h: 16 * jit/JITOpcodes.cpp: 17 (JSC::JIT::emit_op_instanceof_custom): Deleted. 18 (JSC::JIT::emitSlow_op_instanceof_custom): Deleted. 19 * llint/LLIntSlowPaths.cpp: 20 * llint/LLIntSlowPaths.h: 21 * llint/LowLevelInterpreter.asm: 22 * runtime/CommonSlowPaths.cpp: 23 (JSC::JSC_DEFINE_COMMON_SLOW_PATH): 24 * runtime/CommonSlowPaths.h: 25 1 26 2021-12-14 Jean-Yves Avenard <jya@apple.com> 2 27 -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r286424 r287058 314 314 DEFINE_SLOW_OP(greater) 315 315 DEFINE_SLOW_OP(greatereq) 316 DEFINE_SLOW_OP(instanceof_custom) 316 317 DEFINE_SLOW_OP(is_callable) 317 318 DEFINE_SLOW_OP(is_constructor) … … 397 398 DEFINE_OP(op_overrides_has_instance) 398 399 DEFINE_OP(op_instanceof) 399 DEFINE_OP(op_instanceof_custom)400 400 DEFINE_OP(op_is_empty) 401 401 DEFINE_OP(op_typeof_is_undefined) … … 602 602 DEFINE_SLOWCASE_OP(op_check_private_brand) 603 603 DEFINE_SLOWCASE_OP(op_instanceof) 604 DEFINE_SLOWCASE_OP(op_instanceof_custom)605 604 DEFINE_SLOWCASE_OP(op_jless) 606 605 DEFINE_SLOWCASE_OP(op_jlesseq) -
trunk/Source/JavaScriptCore/jit/JIT.h
r286424 r287058 444 444 void emit_op_overrides_has_instance(const Instruction*); 445 445 void emit_op_instanceof(const Instruction*); 446 void emit_op_instanceof_custom(const Instruction*);447 446 void emit_op_is_empty(const Instruction*); 448 447 void emit_op_typeof_is_undefined(const Instruction*); … … 583 582 void emitSlow_op_has_private_brand(const Instruction*, Vector<SlowCaseEntry>::iterator&); 584 583 void emitSlow_op_instanceof(const Instruction*, Vector<SlowCaseEntry>::iterator&); 585 void emitSlow_op_instanceof_custom(const Instruction*, Vector<SlowCaseEntry>::iterator&);586 584 void emitSlow_op_jless(const Instruction*, Vector<SlowCaseEntry>::iterator&); 587 585 void emitSlow_op_jlesseq(const Instruction*, Vector<SlowCaseEntry>::iterator&); -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r286994 r287058 1487 1487 #endif // USE(JSVALUE64) 1488 1488 1489 void JIT::emit_op_instanceof_custom(const Instruction*)1490 {1491 // This always goes to slow path since we expect it to be rare.1492 addSlowCase(jump());1493 }1494 1495 void JIT::emitSlow_op_instanceof_custom(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)1496 {1497 linkAllSlowCases(iter);1498 1499 auto bytecode = currentInstruction->as<OpInstanceofCustom>();1500 VirtualRegister dst = bytecode.m_dst;1501 VirtualRegister value = bytecode.m_value;1502 VirtualRegister constructor = bytecode.m_constructor;1503 VirtualRegister hasInstanceValue = bytecode.m_hasInstanceValue;1504 1505 using SlowOperation = decltype(operationInstanceOfCustom);1506 constexpr GPRReg globalObjectGPR = preferredArgumentGPR<SlowOperation, 0>();1507 constexpr JSValueRegs valueJSR = preferredArgumentJSR<SlowOperation, 1>();1508 constexpr GPRReg constructorGPR = preferredArgumentGPR<SlowOperation, 2>();1509 constexpr JSValueRegs hasInstanceValueJSR = preferredArgumentJSR<SlowOperation, 3>();1510 1511 emitGetVirtualRegister(value, valueJSR);1512 emitGetVirtualRegisterPayload(constructor, constructorGPR);1513 emitGetVirtualRegister(hasInstanceValue, hasInstanceValueJSR);1514 loadGlobalObject(globalObjectGPR);1515 callOperation(1516 operationInstanceOfCustom,1517 globalObjectGPR, valueJSR, constructorGPR, hasInstanceValueJSR);1518 boxBoolean(returnValueGPR, returnValueJSR);1519 emitPutVirtualRegister(dst, returnValueJSR);1520 }1521 1522 1489 void JIT::emit_op_debug(const Instruction* currentInstruction) 1523 1490 { -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r286994 r287058 638 638 } 639 639 640 LLINT_SLOW_PATH_DECL(slow_path_instanceof_custom)641 {642 LLINT_BEGIN();643 644 auto bytecode = pc->as<OpInstanceofCustom>();645 JSValue value = getOperand(callFrame, bytecode.m_value);646 JSValue constructor = getOperand(callFrame, bytecode.m_constructor);647 JSValue hasInstanceValue = getOperand(callFrame, bytecode.m_hasInstanceValue);648 649 ASSERT(constructor.isObject());650 ASSERT(hasInstanceValue != globalObject->functionProtoHasInstanceSymbolFunction() || !constructor.getObject()->structure(vm)->typeInfo().implementsDefaultHasInstance());651 652 JSValue result = jsBoolean(constructor.getObject()->hasInstance(globalObject, value, hasInstanceValue));653 LLINT_RETURN(result);654 }655 656 640 LLINT_SLOW_PATH_DECL(slow_path_try_get_by_id) 657 641 { -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h
r286253 r287058 68 68 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_regexp); 69 69 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_instanceof); 70 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_instanceof_custom);71 70 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_try_get_by_id); 72 71 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_by_id_direct); -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r286994 r287058 2131 2131 end 2132 2132 2133 slowPathOp(instanceof_custom) 2133 2134 slowPathOp(is_callable) 2134 2135 slowPathOp(is_constructor) … … 2164 2165 llintSlowPathOp(del_by_val) 2165 2166 llintSlowPathOp(instanceof) 2166 llintSlowPathOp(instanceof_custom)2167 2167 llintSlowPathOp(new_array) 2168 2168 llintSlowPathOp(new_array_with_size) -
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
r286994 r287058 817 817 } 818 818 819 JSC_DEFINE_COMMON_SLOW_PATH(slow_path_instanceof_custom) 820 { 821 BEGIN(); 822 823 auto bytecode = pc->as<OpInstanceofCustom>(); 824 auto value = GET_C(bytecode.m_value).jsValue(); 825 auto constructor = GET_C(bytecode.m_constructor).jsValue(); 826 auto hasInstanceValue = GET_C(bytecode.m_hasInstanceValue).jsValue(); 827 828 ASSERT(constructor.isObject()); 829 ASSERT(hasInstanceValue != globalObject->functionProtoHasInstanceSymbolFunction() || !constructor.getObject()->structure(vm)->typeInfo().implementsDefaultHasInstance()); 830 831 RETURN(jsBoolean(constructor.getObject()->hasInstance(globalObject, value, hasInstanceValue))); 832 } 833 819 834 JSC_DEFINE_COMMON_SLOW_PATH(slow_path_is_callable) 820 835 { -
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h
r286251 r287058 301 301 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_typeof_is_object); 302 302 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_typeof_is_function); 303 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_instanceof_custom); 303 304 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_is_callable); 304 305 JSC_DECLARE_COMMON_SLOW_PATH(slow_path_is_constructor);
Note:
See TracChangeset
for help on using the changeset viewer.