Changeset 206098 in webkit
- Timestamp:
- Sep 19, 2016 10:00:25 AM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r206083 r206098 1 2016-09-19 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [JSC][LLInt] Introduce is_cell_with_type 4 https://bugs.webkit.org/show_bug.cgi?id=162132 5 6 Reviewed by Sam Weinig. 7 8 In this patch, we introduce is_cell_with_type bytecode. This bytecode can unify the following predicates, 9 op_is_string, op_is_jsarray, op_is_proxy_object, and op_is_derived_array! 10 And we now drop DFG node IsString since we can use IsCellWithType instead. 11 This automatically offers optimization to previous IsString node: dropping cell check by using CellUse edge filter. 12 13 Later, we are planning to use this is_cell_with_type to optimize @isRegExpObject, @isSet, and @isMap[1]. 14 15 The performance results are neutral. 16 17 [1]: https://bugs.webkit.org/show_bug.cgi?id=162142 18 19 * bytecode/BytecodeList.json: 20 * bytecode/BytecodeUseDef.h: 21 (JSC::computeUsesForBytecodeOffset): 22 (JSC::computeDefsForBytecodeOffset): 23 * bytecode/CodeBlock.cpp: 24 (JSC::CodeBlock::dumpBytecode): 25 * bytecode/SpeculatedType.cpp: 26 (JSC::speculationFromJSType): 27 * bytecode/SpeculatedType.h: 28 * bytecompiler/BytecodeGenerator.cpp: 29 (JSC::BytecodeGenerator::emitEqualityOp): 30 (JSC::BytecodeGenerator::emitIsCellWithType): 31 * bytecompiler/BytecodeGenerator.h: 32 (JSC::BytecodeGenerator::emitIsJSArray): 33 (JSC::BytecodeGenerator::emitIsProxyObject): 34 (JSC::BytecodeGenerator::emitIsDerivedArray): 35 * dfg/DFGAbstractInterpreterInlines.h: 36 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): 37 * dfg/DFGByteCodeParser.cpp: 38 (JSC::DFG::ByteCodeParser::handleIntrinsicCall): 39 (JSC::DFG::ByteCodeParser::parseBlock): 40 * dfg/DFGCapabilities.cpp: 41 (JSC::DFG::capabilityLevel): 42 * dfg/DFGClobberize.h: 43 (JSC::DFG::clobberize): 44 * dfg/DFGDoesGC.cpp: 45 (JSC::DFG::doesGC): 46 * dfg/DFGFixupPhase.cpp: 47 (JSC::DFG::FixupPhase::fixupNode): 48 (JSC::DFG::FixupPhase::fixupIsCellWithType): 49 * dfg/DFGNode.h: 50 (JSC::DFG::Node::speculatedTypeForQuery): 51 * dfg/DFGNodeType.h: 52 * dfg/DFGPredictionPropagationPhase.cpp: 53 * dfg/DFGSafeToExecute.h: 54 (JSC::DFG::safeToExecute): 55 * dfg/DFGSpeculativeJIT32_64.cpp: 56 (JSC::DFG::SpeculativeJIT::compile): 57 * dfg/DFGSpeculativeJIT64.cpp: 58 (JSC::DFG::SpeculativeJIT::compile): 59 * ftl/FTLCapabilities.cpp: 60 (JSC::FTL::canCompile): 61 * ftl/FTLLowerDFGToB3.cpp: 62 (JSC::FTL::DFG::LowerDFGToB3::compileNode): 63 (JSC::FTL::DFG::LowerDFGToB3::compileIsString): Deleted. 64 * jit/JIT.cpp: 65 (JSC::JIT::privateCompileMainPass): 66 * jit/JIT.h: 67 * jit/JITOpcodes.cpp: 68 (JSC::JIT::emit_op_is_cell_with_type): 69 (JSC::JIT::emitIsCellWithType): Deleted. 70 (JSC::JIT::emit_op_is_string): Deleted. 71 (JSC::JIT::emit_op_is_jsarray): Deleted. 72 (JSC::JIT::emit_op_is_proxy_object): Deleted. 73 (JSC::JIT::emit_op_is_derived_array): Deleted. 74 * jit/JITOpcodes32_64.cpp: 75 (JSC::JIT::emit_op_is_cell_with_type): 76 (JSC::JIT::emitIsCellWithType): Deleted. 77 (JSC::JIT::emit_op_is_string): Deleted. 78 (JSC::JIT::emit_op_is_jsarray): Deleted. 79 (JSC::JIT::emit_op_is_proxy_object): Deleted. 80 (JSC::JIT::emit_op_is_derived_array): Deleted. 81 * llint/LLIntData.cpp: 82 (JSC::LLInt::Data::performAssertions): 83 * llint/LowLevelInterpreter32_64.asm: 84 * llint/LowLevelInterpreter64.asm: 85 1 86 2016-09-18 Yusuke Suzuki <utatane.tea@gmail.com> 2 87 -
trunk/Source/JavaScriptCore/bytecode/BytecodeList.json
r206065 r206098 56 56 { "name" : "op_is_boolean", "length" : 3 }, 57 57 { "name" : "op_is_number", "length" : 3 }, 58 { "name" : "op_is_string", "length" : 3 },59 { "name" : "op_is_jsarray", "length" : 3 },60 { "name" : "op_is_proxy_object", "length" : 3 },61 58 { "name" : "op_is_object", "length" : 3 }, 62 59 { "name" : "op_is_object_or_null", "length" : 3 }, 63 60 { "name" : "op_is_function", "length" : 3 }, 64 { "name" : "op_is_ derived_array", "length" : 3},61 { "name" : "op_is_cell_with_type", "length" : 4 }, 65 62 { "name" : "op_in", "length" : 4 }, 66 63 { "name" : "op_get_array_length", "length" : 9 }, -
trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h
r206065 r206098 164 164 case op_is_boolean: 165 165 case op_is_number: 166 case op_is_string:167 case op_is_jsarray:168 case op_is_proxy_object:169 166 case op_is_object: 170 167 case op_is_object_or_null: 168 case op_is_cell_with_type: 171 169 case op_is_function: 172 case op_is_derived_array:173 170 case op_to_number: 174 171 case op_to_string: … … 399 396 case op_is_boolean: 400 397 case op_is_number: 401 case op_is_string:402 case op_is_jsarray:403 case op_is_proxy_object:404 398 case op_is_object: 405 399 case op_is_object_or_null: 400 case op_is_cell_with_type: 406 401 case op_is_function: 407 case op_is_derived_array:408 402 case op_in: 409 403 case op_to_number: -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r206065 r206098 1103 1103 break; 1104 1104 } 1105 case op_is_string: { 1106 printUnaryOp(out, exec, location, it, "is_string"); 1107 break; 1108 } 1109 case op_is_jsarray: { 1110 printUnaryOp(out, exec, location, it, "is_jsarray"); 1111 break; 1112 } 1113 case op_is_proxy_object: { 1114 printUnaryOp(out, exec, location, it, "is_proxy_object"); 1105 case op_is_cell_with_type: { 1106 int r0 = (++it)->u.operand; 1107 int r1 = (++it)->u.operand; 1108 int type = (++it)->u.operand; 1109 printLocationAndOp(out, exec, location, it, "is_cell_with_type"); 1110 out.printf("%s, %s, %d", registerName(r0).data(), registerName(r1).data(), type); 1115 1111 break; 1116 1112 } … … 1125 1121 case op_is_function: { 1126 1122 printUnaryOp(out, exec, location, it, "is_function"); 1127 break;1128 }1129 case op_is_derived_array: {1130 printUnaryOp(out, exec, location, it, "is_derived_array");1131 1123 break; 1132 1124 } -
trunk/Source/JavaScriptCore/bytecode/SpeculatedType.cpp
r206065 r206098 472 472 } 473 473 474 SpeculatedType speculationFromJSType(JSType type) 475 { 476 switch (type) { 477 case StringType: 478 return SpecString; 479 case ArrayType: 480 return SpecArray; 481 case DerivedArrayType: 482 return SpecDerivedArray; 483 case RegExpObjectType: 484 return SpecRegExpObject; 485 case ProxyObjectType: 486 return SpecProxyObject; 487 default: 488 ASSERT_NOT_REACHED(); 489 } 490 return SpecNone; 491 } 492 474 493 SpeculatedType leastUpperBoundOfStrictlyEquivalentSpeculations(SpeculatedType type) 475 494 { -
trunk/Source/JavaScriptCore/bytecode/SpeculatedType.h
r206065 r206098 453 453 SpeculatedType speculationFromCell(JSCell*); 454 454 SpeculatedType speculationFromValue(JSValue); 455 SpeculatedType speculationFromJSType(JSType); 455 456 456 457 SpeculatedType speculationFromTypedArrayType(TypedArrayType); // only valid for typed views. -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r205321 r206098 1660 1660 if (value == "string") { 1661 1661 rewindUnaryOp(); 1662 emitOpcode(op_is_ string);1662 emitOpcode(op_is_cell_with_type); 1663 1663 instructions().append(dst->index()); 1664 1664 instructions().append(srcIndex); 1665 instructions().append(StringType); 1665 1666 return dst; 1666 1667 } … … 4218 4219 } 4219 4220 4221 RegisterID* BytecodeGenerator::emitIsCellWithType(RegisterID* dst, RegisterID* src, JSType type) 4222 { 4223 emitOpcode(op_is_cell_with_type); 4224 instructions().append(dst->index()); 4225 instructions().append(src->index()); 4226 instructions().append(type); 4227 return dst; 4228 } 4220 4229 4221 4230 RegisterID* BytecodeGenerator::emitIsObject(RegisterID* dst, RegisterID* src) -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r206065 r206098 631 631 RegisterID* emitToIndexString(RegisterID* dst, RegisterID* index); 632 632 633 RegisterID* emitIsJSArray(RegisterID* dst, RegisterID* src) { return emitUnaryOp(op_is_jsarray, dst, src); } 634 RegisterID* emitIsProxyObject(RegisterID* dst, RegisterID* src) { return emitUnaryOp(op_is_proxy_object, dst, src); } 633 RegisterID* emitIsCellWithType(RegisterID* dst, RegisterID* src, JSType); 634 RegisterID* emitIsJSArray(RegisterID* dst, RegisterID* src) { return emitIsCellWithType(dst, src, ArrayType); } 635 RegisterID* emitIsProxyObject(RegisterID* dst, RegisterID* src) { return emitIsCellWithType(dst, src, ProxyObjectType); } 635 636 RegisterID* emitIsObject(RegisterID* dst, RegisterID* src); 636 637 RegisterID* emitIsUndefined(RegisterID* dst, RegisterID* src); 637 638 RegisterID* emitIsEmpty(RegisterID* dst, RegisterID* src); 638 RegisterID* emitIsDerivedArray(RegisterID* dst, RegisterID* src) { return emit UnaryOp(op_is_derived_array, dst, src); }639 RegisterID* emitIsDerivedArray(RegisterID* dst, RegisterID* src) { return emitIsCellWithType(dst, src, DerivedArrayType); } 639 640 void emitRequireObjectCoercible(RegisterID* value, const String& error); 640 641 -
trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
r206065 r206098 1014 1014 case IsBoolean: 1015 1015 case IsNumber: 1016 case IsString:1017 1016 case IsObject: 1018 1017 case IsObjectOrNull: … … 1038 1037 case IsNumber: 1039 1038 setConstant(node, jsBoolean(child.value().isNumber())); 1040 break;1041 case IsString:1042 setConstant(node, jsBoolean(isJSString(child.value())));1043 1039 break; 1044 1040 case IsObject: … … 1143 1139 1144 1140 if (!(child.m_type & SpecFullNumber)) { 1145 setConstant(node, jsBoolean(false));1146 constantWasSet = true;1147 break;1148 }1149 1150 break;1151 case IsString:1152 if (!(child.m_type & ~SpecString)) {1153 setConstant(node, jsBoolean(true));1154 constantWasSet = true;1155 break;1156 }1157 1158 if (!(child.m_type & SpecString)) {1159 1141 setConstant(node, jsBoolean(false)); 1160 1142 constantWasSet = true; -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r206065 r206098 2367 2367 2368 2368 insertChecks(); 2369 Node* isRegExpObject = addToGraph(IsCellWithType, OpInfo(RegExpObjectType), OpInfo(SpecRegExpObject),get(virtualRegisterForArgument(1, registerOffset)));2369 Node* isRegExpObject = addToGraph(IsCellWithType, OpInfo(RegExpObjectType), get(virtualRegisterForArgument(1, registerOffset))); 2370 2370 set(VirtualRegister(resultOperand), isRegExpObject); 2371 2371 return true; … … 3971 3971 } 3972 3972 3973 case op_is_string: { 3973 case op_is_cell_with_type: { 3974 JSType type = static_cast<JSType>(currentInstruction[3].u.operand); 3974 3975 Node* value = get(VirtualRegister(currentInstruction[2].u.operand)); 3975 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(IsString, value)); 3976 NEXT_OPCODE(op_is_string); 3977 } 3978 3979 case op_is_jsarray: { 3980 Node* value = get(VirtualRegister(currentInstruction[2].u.operand)); 3981 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(IsCellWithType, OpInfo(ArrayType), OpInfo(SpecArray), value)); 3982 NEXT_OPCODE(op_is_jsarray); 3983 } 3984 3985 case op_is_proxy_object: { 3986 Node* value = get(VirtualRegister(currentInstruction[2].u.operand)); 3987 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(IsCellWithType, OpInfo(ProxyObjectType), OpInfo(SpecProxyObject), value)); 3988 NEXT_OPCODE(op_is_proxy_object); 3976 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(IsCellWithType, OpInfo(type), value)); 3977 NEXT_OPCODE(op_is_cell_with_type); 3989 3978 } 3990 3979 … … 4005 3994 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(IsFunction, value)); 4006 3995 NEXT_OPCODE(op_is_function); 4007 }4008 4009 case op_is_derived_array: {4010 Node* value = get(VirtualRegister(currentInstruction[2].u.operand));4011 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(IsCellWithType, OpInfo(DerivedArrayType), OpInfo(SpecDerivedArray), value));4012 NEXT_OPCODE(op_is_derived_array);4013 3996 } 4014 3997 -
trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp
r206065 r206098 141 141 case op_is_boolean: 142 142 case op_is_number: 143 case op_is_string:144 case op_is_jsarray:145 case op_is_proxy_object:146 143 case op_is_object: 147 144 case op_is_object_or_null: 145 case op_is_cell_with_type: 148 146 case op_is_function: 149 case op_is_derived_array:150 147 case op_not: 151 148 case op_less: -
trunk/Source/JavaScriptCore/dfg/DFGClobberize.h
r206065 r206098 163 163 case IsBoolean: 164 164 case IsNumber: 165 case IsString:166 165 case IsObject: 167 166 case IsTypedArrayView: -
trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp
r206065 r206098 162 162 case IsBoolean: 163 163 case IsNumber: 164 case IsString:165 164 case IsObject: 166 165 case IsObjectOrNull: -
trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r206065 r206098 1397 1397 break; 1398 1398 } 1399 1400 case IsString:1401 if (node->child1()->shouldSpeculateString()) {1402 m_insertionSet.insertNode(1403 m_indexInBlock, SpecNone, Check, node->origin,1404 Edge(node->child1().node(), StringUse));1405 m_graph.convertToConstant(node, jsBoolean(true));1406 observeUseKindOnNode<StringUse>(node);1407 }1408 break;1409 1399 1410 1400 case IsObject: … … 1768 1758 { 1769 1759 switch (node->speculatedTypeForQuery()) { 1760 case SpecString: 1761 if (node->child1()->shouldSpeculateString()) { 1762 m_insertionSet.insertNode( 1763 m_indexInBlock, SpecNone, Check, node->origin, 1764 Edge(node->child1().node(), StringUse)); 1765 m_graph.convertToConstant(node, jsBoolean(true)); 1766 observeUseKindOnNode<StringUse>(node); 1767 return; 1768 } 1769 break; 1770 1770 1771 case SpecProxyObject: 1771 1772 if (node->child1()->shouldSpeculateProxyObject()) { -
trunk/Source/JavaScriptCore/dfg/DFGNode.h
r206065 r206098 1180 1180 SpeculatedType speculatedTypeForQuery() 1181 1181 { 1182 return m_opInfo2.as<SpeculatedType>();1182 return speculationFromJSType(queriedType()); 1183 1183 } 1184 1184 -
trunk/Source/JavaScriptCore/dfg/DFGNodeType.h
r206065 r206098 315 315 macro(IsBoolean, NodeResultBoolean) \ 316 316 macro(IsNumber, NodeResultBoolean) \ 317 macro(IsString, NodeResultBoolean) \318 317 macro(IsObject, NodeResultBoolean) \ 319 318 macro(IsObjectOrNull, NodeResultBoolean) \ -
trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
r206065 r206098 798 798 case IsBoolean: 799 799 case IsNumber: 800 case IsString:801 800 case IsObject: 802 801 case IsObjectOrNull: -
trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h
r206065 r206098 268 268 case IsBoolean: 269 269 case IsNumber: 270 case IsString:271 270 case IsObject: 272 271 case IsObjectOrNull: -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r206065 r206098 4641 4641 } 4642 4642 4643 case IsString: {4644 JSValueOperand value(this, node->child1());4645 GPRTemporary result(this, Reuse, value, TagWord);4646 4647 JITCompiler::Jump isNotCell = m_jit.branchIfNotCell(value.jsValueRegs());4648 4649 m_jit.compare8(JITCompiler::Equal,4650 JITCompiler::Address(value.payloadGPR(), JSCell::typeInfoTypeOffset()),4651 TrustedImm32(StringType),4652 result.gpr());4653 JITCompiler::Jump done = m_jit.jump();4654 4655 isNotCell.link(&m_jit);4656 m_jit.move(TrustedImm32(0), result.gpr());4657 4658 done.link(&m_jit);4659 booleanResult(result.gpr(), node);4660 break;4661 }4662 4663 4643 case IsObject: { 4664 4644 JSValueOperand value(this, node->child1()); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r206065 r206098 4612 4612 } 4613 4613 4614 case IsString: {4615 JSValueOperand value(this, node->child1());4616 GPRTemporary result(this, Reuse, value);4617 4618 JITCompiler::Jump isNotCell = m_jit.branchIfNotCell(value.jsValueRegs());4619 4620 m_jit.compare8(JITCompiler::Equal,4621 JITCompiler::Address(value.gpr(), JSCell::typeInfoTypeOffset()),4622 TrustedImm32(StringType),4623 result.gpr());4624 m_jit.or32(TrustedImm32(ValueFalse), result.gpr());4625 JITCompiler::Jump done = m_jit.jump();4626 4627 isNotCell.link(&m_jit);4628 m_jit.move(TrustedImm32(ValueFalse), result.gpr());4629 4630 done.link(&m_jit);4631 jsValueResult(result.gpr(), node, DataFormatJSBoolean);4632 break;4633 }4634 4635 4614 case MapHash: { 4636 4615 JSValueOperand input(this, node->child1()); -
trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp
r206065 r206098 191 191 case IsBoolean: 192 192 case IsNumber: 193 case IsString:194 193 case IsObject: 195 194 case IsObjectOrNull: -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r206065 r206098 896 896 case IsNumber: 897 897 compileIsNumber(); 898 break;899 case IsString:900 compileIsString();901 898 break; 902 899 case IsCellWithType: … … 6265 6262 } 6266 6263 6267 void compileIsString()6268 {6269 LValue value = lowJSValue(m_node->child1());6270 6271 LBasicBlock isCellCase = m_out.newBlock();6272 LBasicBlock continuation = m_out.newBlock();6273 6274 ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse);6275 m_out.branch(6276 isCell(value, provenType(m_node->child1())), unsure(isCellCase), unsure(continuation));6277 6278 LBasicBlock lastNext = m_out.appendTo(isCellCase, continuation);6279 ValueFromBlock cellResult = m_out.anchor(isString(value, provenType(m_node->child1())));6280 m_out.jump(continuation);6281 6282 m_out.appendTo(continuation, lastNext);6283 setBoolean(m_out.phi(Int32, notCellResult, cellResult));6284 }6285 6286 6264 void compileIsCellWithType() 6287 6265 { -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r206065 r206098 269 269 DEFINE_OP(op_is_boolean) 270 270 DEFINE_OP(op_is_number) 271 DEFINE_OP(op_is_string)272 DEFINE_OP(op_is_jsarray)273 DEFINE_OP(op_is_proxy_object)274 271 DEFINE_OP(op_is_object) 275 DEFINE_OP(op_is_ derived_array)272 DEFINE_OP(op_is_cell_with_type) 276 273 DEFINE_OP(op_jeq_null) 277 274 DEFINE_OP(op_jfalse) -
trunk/Source/JavaScriptCore/jit/JIT.h
r206065 r206098 401 401 int32_t getOperandConstantInt(int src); 402 402 double getOperandConstantDouble(int src); 403 404 void emitIsCellWithType(Instruction*, JSType);405 403 406 404 #if USE(JSVALUE32_64) … … 517 515 void emit_op_is_boolean(Instruction*); 518 516 void emit_op_is_number(Instruction*); 519 void emit_op_is_string(Instruction*);520 void emit_op_is_jsarray(Instruction*);521 void emit_op_is_proxy_object(Instruction*);522 517 void emit_op_is_object(Instruction*); 523 void emit_op_is_ derived_array(Instruction*);518 void emit_op_is_cell_with_type(Instruction*); 524 519 void emit_op_jeq_null(Instruction*); 525 520 void emit_op_jfalse(Instruction*); -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r206065 r206098 244 244 } 245 245 246 void JIT::emit IsCellWithType(Instruction* currentInstruction, JSType type)246 void JIT::emit_op_is_cell_with_type(Instruction* currentInstruction) 247 247 { 248 248 int dst = currentInstruction[1].u.operand; 249 249 int value = currentInstruction[2].u.operand; 250 int type = currentInstruction[3].u.operand; 250 251 251 252 emitGetVirtualRegister(value, regT0); … … 261 262 done.link(this); 262 263 emitPutVirtualRegister(dst); 263 }264 265 void JIT::emit_op_is_string(Instruction* currentInstruction)266 {267 emitIsCellWithType(currentInstruction, StringType);268 }269 270 void JIT::emit_op_is_jsarray(Instruction* currentInstruction)271 {272 emitIsCellWithType(currentInstruction, ArrayType);273 }274 275 void JIT::emit_op_is_proxy_object(Instruction* currentInstruction)276 {277 emitIsCellWithType(currentInstruction, ProxyObjectType);278 }279 280 void JIT::emit_op_is_derived_array(Instruction* currentInstruction)281 {282 emitIsCellWithType(currentInstruction, DerivedArrayType);283 264 } 284 265 -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r206065 r206098 355 355 } 356 356 357 void JIT::emit IsCellWithType(Instruction* currentInstruction, JSType type)357 void JIT::emit_op_is_cell_with_type(Instruction* currentInstruction) 358 358 { 359 359 int dst = currentInstruction[1].u.operand; 360 360 int value = currentInstruction[2].u.operand; 361 int type = currentInstruction[3].u.operand; 361 362 362 363 emitLoad(value, regT1, regT0); … … 371 372 done.link(this); 372 373 emitStoreBool(dst, regT0); 373 }374 375 void JIT::emit_op_is_string(Instruction* currentInstruction)376 {377 emitIsCellWithType(currentInstruction, StringType);378 }379 380 void JIT::emit_op_is_jsarray(Instruction* currentInstruction)381 {382 emitIsCellWithType(currentInstruction, ArrayType);383 }384 385 void JIT::emit_op_is_proxy_object(Instruction* currentInstruction)386 {387 emitIsCellWithType(currentInstruction, ProxyObjectType);388 }389 390 void JIT::emit_op_is_derived_array(Instruction* currentInstruction)391 {392 emitIsCellWithType(currentInstruction, DerivedArrayType);393 374 } 394 375 -
trunk/Source/JavaScriptCore/llint/LLIntData.cpp
r206083 r206098 218 218 ASSERT(bitwise_cast<uintptr_t>(ShadowChicken::Packet::tailMarker()) == static_cast<uintptr_t>(0x7a11)); 219 219 220 STATIC_ASSERT(OPCODE_LENGTH(op_is_string) == 3);221 STATIC_ASSERT(OPCODE_LENGTH(op_is_jsarray) == 3);222 STATIC_ASSERT(OPCODE_LENGTH(op_is_proxy_object) == 3);223 STATIC_ASSERT(OPCODE_LENGTH(op_is_derived_array) == 3);224 225 220 // FIXME: make these assertions less horrible. 226 221 #if !ASSERT_DISABLED -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
r206065 r206098 1258 1258 1259 1259 1260 macro isCellWithType(type) 1260 _llint_op_is_cell_with_type: 1261 traceExecution() 1261 1262 loadi 8[PC], t1 1262 1263 loadi 4[PC], t2 … … 1264 1265 storei BooleanTag, TagOffset[cfr, t2, 8] 1265 1266 bineq t0, CellTag, .notCellCase 1266 cbeq JSCell::m_type[t3], type, t1 1267 loadi 12[PC], t0 1268 cbeq JSCell::m_type[t3], t0, t1 1267 1269 storei t1, PayloadOffset[cfr, t2, 8] 1268 dispatch( 3)1270 dispatch(4) 1269 1271 .notCellCase: 1270 1272 storep 0, PayloadOffset[cfr, t2, 8] 1271 dispatch(3) 1272 end 1273 1274 1275 _llint_op_is_string: 1276 traceExecution() 1277 isCellWithType(StringType) 1278 1279 1280 _llint_op_is_jsarray: 1281 traceExecution() 1282 isCellWithType(ArrayType) 1283 1284 1285 _llint_op_is_proxy_object: 1286 traceExecution() 1287 isCellWithType(ProxyObjectType) 1288 1289 1290 _llint_op_is_derived_array: 1291 traceExecution() 1292 isCellWithType(DerivedArrayType) 1273 dispatch(4) 1293 1274 1294 1275 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r206065 r206098 1147 1147 1148 1148 1149 macro isCellWithType(type) 1149 _llint_op_is_cell_with_type: 1150 traceExecution() 1151 loadisFromInstruction(3, t3) 1150 1152 loadisFromInstruction(2, t1) 1151 1153 loadisFromInstruction(1, t2) 1152 1154 loadConstantOrVariable(t1, t0) 1153 1155 btqnz t0, tagMask, .notCellCase 1154 cbeq JSCell::m_type[t0], t ype, t11156 cbeq JSCell::m_type[t0], t3, t1 1155 1157 orq ValueFalse, t1 1156 1158 storeq t1, [cfr, t2, 8] 1157 dispatch( 3)1159 dispatch(4) 1158 1160 .notCellCase: 1159 1161 storeq ValueFalse, [cfr, t2, 8] 1160 dispatch(3) 1161 end 1162 1163 1164 _llint_op_is_string: 1165 traceExecution() 1166 isCellWithType(StringType) 1167 1168 1169 _llint_op_is_jsarray: 1170 traceExecution() 1171 isCellWithType(ArrayType) 1172 1173 1174 _llint_op_is_proxy_object: 1175 traceExecution() 1176 isCellWithType(ProxyObjectType) 1177 1178 1179 _llint_op_is_derived_array: 1180 traceExecution() 1181 isCellWithType(DerivedArrayType) 1162 dispatch(4) 1182 1163 1183 1164
Note: See TracChangeset
for help on using the changeset viewer.