Changeset 206104 in webkit
- Timestamp:
- Sep 19, 2016 11:46:07 AM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r206099 r206104 1 2016-09-19 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [JSC] Use is_cell_with_type for @isRegExpObject, @isMap, and @isSet 4 https://bugs.webkit.org/show_bug.cgi?id=162142 5 6 Reviewed by Michael Saboff. 7 8 Use is_cell_with_type for @isRegExpObject, @isMap and @isSet. 9 Previously, they were implemented as functions and only @isRegExpObject was handled in the DFG and FTL. 10 The recently added op_is_cell_with_type bytecode and DFG IsCellWithType node allows us to simplify the above checks in all JIT tiers. 11 Changed these checks to bytecode intrinsics using op_is_cell_with_type. 12 13 * builtins/BuiltinNames.h: 14 * bytecode/BytecodeIntrinsicRegistry.h: 15 * bytecode/SpeculatedType.cpp: 16 (JSC::speculationFromJSType): 17 * bytecompiler/BytecodeGenerator.h: 18 (JSC::BytecodeGenerator::emitIsRegExpObject): 19 (JSC::BytecodeGenerator::emitIsMap): 20 (JSC::BytecodeGenerator::emitIsSet): 21 (JSC::BytecodeGenerator::emitIsProxyObject): Deleted. 22 * bytecompiler/NodesCodegen.cpp: 23 (JSC::BytecodeIntrinsicNode::emit_intrinsic_isRegExpObject): 24 (JSC::BytecodeIntrinsicNode::emit_intrinsic_isMap): 25 (JSC::BytecodeIntrinsicNode::emit_intrinsic_isSet): 26 * dfg/DFGByteCodeParser.cpp: 27 (JSC::DFG::ByteCodeParser::handleIntrinsicCall): 28 * runtime/ECMAScriptSpecInternalFunctions.cpp: 29 (JSC::esSpecIsRegExpObject): Deleted. 30 * runtime/ECMAScriptSpecInternalFunctions.h: 31 * runtime/Intrinsic.h: 32 * runtime/JSGlobalObject.cpp: 33 (JSC::JSGlobalObject::init): 34 * runtime/MapPrototype.cpp: 35 (JSC::privateFuncIsMap): Deleted. 36 * runtime/MapPrototype.h: 37 * runtime/SetPrototype.cpp: 38 (JSC::privateFuncIsSet): Deleted. 39 * runtime/SetPrototype.h: 40 1 41 2016-09-19 Brian Burg <bburg@apple.com> 2 42 -
trunk/Source/JavaScriptCore/builtins/BuiltinNames.h
r206065 r206104 131 131 macro(isConstructor) \ 132 132 macro(isDerivedConstructor) \ 133 macro(isRegExpObject) \134 133 macro(concatMemcpy) \ 135 134 macro(appendMemcpy) \ 136 135 macro(predictFinalLengthFromArgumunts) \ 137 136 macro(print) \ 138 macro(isSet) \139 macro(isMap) \140 137 macro(regExpCreate) \ 141 138 macro(SetIterator) \ -
trunk/Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h
r206065 r206104 46 46 macro(isProxyObject) \ 47 47 macro(isDerivedArray) \ 48 macro(isRegExpObject) \ 49 macro(isMap) \ 50 macro(isSet) \ 48 51 macro(tailCallForwardArguments) \ 49 52 macro(tryGetById) \ -
trunk/Source/JavaScriptCore/bytecode/SpeculatedType.cpp
r206098 r206104 485 485 case ProxyObjectType: 486 486 return SpecProxyObject; 487 case JSMapType: 488 return SpecMapObject; 489 case JSSetType: 490 return SpecSetObject; 487 491 default: 488 492 ASSERT_NOT_REACHED(); -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r206098 r206104 634 634 RegisterID* emitIsJSArray(RegisterID* dst, RegisterID* src) { return emitIsCellWithType(dst, src, ArrayType); } 635 635 RegisterID* emitIsProxyObject(RegisterID* dst, RegisterID* src) { return emitIsCellWithType(dst, src, ProxyObjectType); } 636 RegisterID* emitIsRegExpObject(RegisterID* dst, RegisterID* src) { return emitIsCellWithType(dst, src, RegExpObjectType); } 637 RegisterID* emitIsMap(RegisterID* dst, RegisterID* src) { return emitIsCellWithType(dst, src, JSMapType); } 638 RegisterID* emitIsSet(RegisterID* dst, RegisterID* src) { return emitIsCellWithType(dst, src, JSSetType); } 636 639 RegisterID* emitIsObject(RegisterID* dst, RegisterID* src); 637 640 RegisterID* emitIsUndefined(RegisterID* dst, RegisterID* src); -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r206082 r206104 954 954 } 955 955 956 RegisterID* BytecodeIntrinsicNode::emit_intrinsic_is Object(BytecodeGenerator& generator,RegisterID* dst)956 RegisterID* BytecodeIntrinsicNode::emit_intrinsic_isRegExpObject(JSC::BytecodeGenerator& generator, JSC::RegisterID* dst) 957 957 { 958 958 ArgumentListNode* node = m_args->m_listNode; … … 960 960 ASSERT(!node->m_next); 961 961 962 return generator.moveToDestinationIfNeeded(dst, generator.emitIs Object(generator.tempDestination(dst), src.get()));963 } 964 965 RegisterID* BytecodeIntrinsicNode::emit_intrinsic_is DerivedArray(JSC::BytecodeGenerator& generator, JSC::RegisterID* dst)962 return generator.moveToDestinationIfNeeded(dst, generator.emitIsRegExpObject(generator.tempDestination(dst), src.get())); 963 } 964 965 RegisterID* BytecodeIntrinsicNode::emit_intrinsic_isObject(BytecodeGenerator& generator, RegisterID* dst) 966 966 { 967 967 ArgumentListNode* node = m_args->m_listNode; … … 969 969 ASSERT(!node->m_next); 970 970 971 return generator.moveToDestinationIfNeeded(dst, generator.emitIsObject(generator.tempDestination(dst), src.get())); 972 } 973 974 RegisterID* BytecodeIntrinsicNode::emit_intrinsic_isDerivedArray(JSC::BytecodeGenerator& generator, JSC::RegisterID* dst) 975 { 976 ArgumentListNode* node = m_args->m_listNode; 977 RefPtr<RegisterID> src = generator.emitNode(node); 978 ASSERT(!node->m_next); 979 971 980 return generator.moveToDestinationIfNeeded(dst, generator.emitIsDerivedArray(generator.tempDestination(dst), src.get())); 981 } 982 983 RegisterID* BytecodeIntrinsicNode::emit_intrinsic_isMap(JSC::BytecodeGenerator& generator, JSC::RegisterID* dst) 984 { 985 ArgumentListNode* node = m_args->m_listNode; 986 RefPtr<RegisterID> src = generator.emitNode(node); 987 ASSERT(!node->m_next); 988 989 return generator.moveToDestinationIfNeeded(dst, generator.emitIsMap(generator.tempDestination(dst), src.get())); 990 } 991 992 RegisterID* BytecodeIntrinsicNode::emit_intrinsic_isSet(JSC::BytecodeGenerator& generator, JSC::RegisterID* dst) 993 { 994 ArgumentListNode* node = m_args->m_listNode; 995 RefPtr<RegisterID> src = generator.emitNode(node); 996 ASSERT(!node->m_next); 997 998 return generator.moveToDestinationIfNeeded(dst, generator.emitIsSet(generator.tempDestination(dst), src.get())); 972 999 } 973 1000 -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r206098 r206104 2360 2360 set(VirtualRegister(resultOperand), regExpExec); 2361 2361 2362 return true;2363 }2364 2365 case IsRegExpObjectIntrinsic: {2366 ASSERT(argumentCountIncludingThis == 2);2367 2368 insertChecks();2369 Node* isRegExpObject = addToGraph(IsCellWithType, OpInfo(RegExpObjectType), get(virtualRegisterForArgument(1, registerOffset)));2370 set(VirtualRegister(resultOperand), isRegExpObject);2371 2362 return true; 2372 2363 } -
trunk/Source/JavaScriptCore/runtime/ECMAScriptSpecInternalFunctions.cpp
r205462 r206104 40 40 } 41 41 42 EncodedJSValue JSC_HOST_CALL esSpecIsRegExpObject(ExecState* exec)43 {44 JSValue value = exec->uncheckedArgument(0);45 if (value.isObject())46 return JSValue::encode(jsBoolean(value.getObject()->type() == RegExpObjectType));47 return JSValue::encode(jsBoolean(false));48 }49 50 42 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/ECMAScriptSpecInternalFunctions.h
r199748 r206104 32 32 33 33 EncodedJSValue JSC_HOST_CALL esSpecIsConstructor(ExecState*); 34 EncodedJSValue JSC_HOST_CALL esSpecIsRegExpObject(ExecState*);35 34 36 35 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/Intrinsic.h
r205828 r206104 61 61 FRoundIntrinsic, 62 62 TruncIntrinsic, 63 IsRegExpObjectIntrinsic,64 63 IsTypedArrayViewIntrinsic, 65 64 BoundThisNoArgsFunctionCallIntrinsic, -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r206065 r206104 747 747 748 748 GlobalPropertyInfo(vm.propertyNames->builtinNames().repeatCharacterPrivateName(), JSFunction::create(vm, this, 2, String(), stringProtoFuncRepeatCharacter), DontEnum | DontDelete | ReadOnly), 749 GlobalPropertyInfo(vm.propertyNames->builtinNames().isSetPrivateName(), JSFunction::create(vm, this, 1, String(), privateFuncIsSet), DontEnum | DontDelete | ReadOnly),750 749 GlobalPropertyInfo(vm.propertyNames->builtinNames().SetIteratorPrivateName(), JSFunction::create(vm, this, 1, String(), privateFuncSetIterator), DontEnum | DontDelete | ReadOnly), 751 750 GlobalPropertyInfo(vm.propertyNames->builtinNames().setIteratorNextPrivateName(), JSFunction::create(vm, this, 0, String(), privateFuncSetIteratorNext), DontEnum | DontDelete | ReadOnly), 752 GlobalPropertyInfo(vm.propertyNames->builtinNames().isMapPrivateName(), JSFunction::create(vm, this, 1, String(), privateFuncIsMap), DontEnum | DontDelete | ReadOnly),753 751 GlobalPropertyInfo(vm.propertyNames->builtinNames().isArrayPrivateName(), arrayConstructor->getDirect(vm, vm.propertyNames->isArray), DontEnum | DontDelete | ReadOnly), 754 752 GlobalPropertyInfo(vm.propertyNames->builtinNames().isArraySlowPrivateName(), privateFuncIsArraySlow, DontEnum | DontDelete | ReadOnly), … … 771 769 772 770 GlobalPropertyInfo(vm.propertyNames->builtinNames().isConstructorPrivateName(), JSFunction::create(vm, this, 1, String(), esSpecIsConstructor, NoIntrinsic), DontEnum | DontDelete | ReadOnly), 773 GlobalPropertyInfo(vm.propertyNames->builtinNames().isRegExpObjectPrivateName(), JSFunction::create(vm, this, 1, String(), esSpecIsRegExpObject, IsRegExpObjectIntrinsic), DontEnum | DontDelete | ReadOnly),774 771 775 772 GlobalPropertyInfo(vm.propertyNames->builtinNames().regExpProtoFlagsGetterPrivateName(), regExpProtoFlagsGetterObject, DontEnum | DontDelete | ReadOnly), -
trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp
r205654 r206104 101 101 } 102 102 103 EncodedJSValue JSC_HOST_CALL privateFuncIsMap(ExecState* exec)104 {105 JSValue value = exec->uncheckedArgument(0);106 return JSValue::encode(jsBoolean(value.isCell() && value.asCell()->type() == JSMapType));107 }108 109 103 EncodedJSValue JSC_HOST_CALL mapProtoFuncClear(CallFrame* callFrame) 110 104 { -
trunk/Source/JavaScriptCore/runtime/MapPrototype.h
r201448 r206104 59 59 }; 60 60 61 EncodedJSValue JSC_HOST_CALL privateFuncIsMap(ExecState*);62 61 EncodedJSValue JSC_HOST_CALL privateFuncMapIterator(ExecState*); 63 62 EncodedJSValue JSC_HOST_CALL privateFuncMapIteratorNext(ExecState*); -
trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp
r205654 r206104 160 160 } 161 161 162 EncodedJSValue JSC_HOST_CALL privateFuncIsSet(ExecState* exec)163 {164 return JSValue::encode(jsBoolean(jsDynamicCast<JSSet*>(exec->uncheckedArgument(0))));165 }166 167 162 EncodedJSValue JSC_HOST_CALL privateFuncSetIterator(ExecState* exec) 168 163 { -
trunk/Source/JavaScriptCore/runtime/SetPrototype.h
r201448 r206104 59 59 }; 60 60 61 EncodedJSValue JSC_HOST_CALL privateFuncIsSet(ExecState*);62 61 EncodedJSValue JSC_HOST_CALL privateFuncSetIterator(ExecState*); 63 62 EncodedJSValue JSC_HOST_CALL privateFuncSetIteratorNext(ExecState*);
Note: See TracChangeset
for help on using the changeset viewer.