Changeset 142769 in webkit
- Timestamp:
- Feb 13, 2013 12:08:11 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r142751 r142769 1 2013-02-13 Oliver Hunt <oliver@apple.com> 2 3 Remove unnecessary indirection to non-local variable access operations 4 https://bugs.webkit.org/show_bug.cgi?id=109724 5 6 Reviewed by Filip Pizlo. 7 8 Linked bytecode now stores a direct pointer to the resolve operation 9 vectors, so the interpreter no longer needs a bunch of indirection to 10 to perform non-local lookup. 11 12 * bytecode/CodeBlock.cpp: 13 (JSC::CodeBlock::CodeBlock): 14 * bytecode/CodeBlock.h: 15 (CodeBlock): 16 * bytecode/Instruction.h: 17 * dfg/DFGByteCodeParser.cpp: 18 (ByteCodeParser): 19 (InlineStackEntry): 20 (JSC::DFG::ByteCodeParser::parseResolveOperations): 21 (JSC::DFG::ByteCodeParser::parseBlock): 22 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): 23 * dfg/DFGCapabilities.h: 24 (JSC::DFG::canInlineOpcode): 25 * dfg/DFGGraph.h: 26 (ResolveGlobalData): 27 (ResolveOperationData): 28 (PutToBaseOperationData): 29 * dfg/DFGSpeculativeJIT.h: 30 * dfg/DFGSpeculativeJIT32_64.cpp: 31 (JSC::DFG::SpeculativeJIT::compile): 32 * dfg/DFGSpeculativeJIT64.cpp: 33 (JSC::DFG::SpeculativeJIT::compile): 34 * jit/JITOpcodes.cpp: 35 (JSC::JIT::emit_op_put_to_base): 36 (JSC::JIT::emit_op_resolve): 37 (JSC::JIT::emitSlow_op_resolve): 38 (JSC::JIT::emit_op_resolve_base): 39 (JSC::JIT::emitSlow_op_resolve_base): 40 (JSC::JIT::emit_op_resolve_with_base): 41 (JSC::JIT::emitSlow_op_resolve_with_base): 42 (JSC::JIT::emit_op_resolve_with_this): 43 (JSC::JIT::emitSlow_op_resolve_with_this): 44 (JSC::JIT::emitSlow_op_put_to_base): 45 * jit/JITOpcodes32_64.cpp: 46 (JSC::JIT::emit_op_put_to_base): 47 * llint/LLIntSlowPaths.cpp: 48 (JSC::LLInt::LLINT_SLOW_PATH_DECL): 49 * llint/LowLevelInterpreter.asm: 50 1 51 2013-02-13 Zoltan Herczeg <zherczeg@webkit.org> 2 52 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r141962 r142769 1820 1820 if (size_t size = unlinkedCodeBlock->numberOfResolveOperations()) 1821 1821 m_resolveOperations.grow(size); 1822 size_t putToBaseCount = unlinkedCodeBlock->numberOfPutToBaseOperations(); 1823 m_putToBaseOperations.reserveInitialCapacity(putToBaseCount); 1824 for (size_t i = 0; i < putToBaseCount; ++i) 1825 m_putToBaseOperations.uncheckedAppend(PutToBaseOperation(isStrictMode())); 1822 if (size_t putToBaseCount = unlinkedCodeBlock->numberOfPutToBaseOperations()) { 1823 m_putToBaseOperations.reserveInitialCapacity(putToBaseCount); 1824 for (size_t i = 0; i < putToBaseCount; ++i) 1825 m_putToBaseOperations.uncheckedAppend(PutToBaseOperation(isStrictMode())); 1826 } 1826 1827 1827 1828 // Copy and translate the UnlinkedInstructions … … 1848 1849 } 1849 1850 case op_convert_this: 1850 case op_resolve:1851 case op_resolve_base:1852 case op_resolve_with_base:1853 case op_resolve_with_this:1854 1851 case op_get_by_id: 1855 1852 case op_call_put_result: … … 1876 1873 } 1877 1874 #endif 1878 1875 case op_resolve_base_to_global: 1876 case op_resolve_base_to_global_dynamic: 1877 case op_resolve_base_to_scope: 1878 case op_resolve_base_to_scope_with_top_scope_check: { 1879 instructions[i + 4].u.resolveOperations = &m_resolveOperations[pc[i + 4].u.operand]; 1880 instructions[i + 5].u.putToBaseOperation = &m_putToBaseOperations[pc[i + 5].u.operand]; 1881 break; 1882 } 1883 case op_resolve_global_property: 1884 case op_resolve_global_var: 1885 case op_resolve_scoped_var: 1886 case op_resolve_scoped_var_on_top_scope: 1887 case op_resolve_scoped_var_with_top_scope_check: { 1888 instructions[i + 3].u.resolveOperations = &m_resolveOperations[pc[i + 3].u.operand]; 1889 break; 1890 } 1891 case op_put_to_base: 1892 case op_put_to_base_variable: { 1893 instructions[i + 4].u.putToBaseOperation = &m_putToBaseOperations[pc[i + 4].u.operand]; 1894 break; 1895 } 1896 case op_resolve: { 1897 ValueProfile* profile = &m_valueProfiles[pc[i + opLength - 1].u.operand]; 1898 ASSERT(profile->m_bytecodeOffset == -1); 1899 profile->m_bytecodeOffset = i; 1900 instructions[i + 3].u.resolveOperations = &m_resolveOperations[pc[i + 3].u.operand]; 1901 instructions[i + opLength - 1] = profile; 1902 break; 1903 } 1904 case op_resolve_base: 1905 case op_resolve_with_base: 1906 case op_resolve_with_this: { 1907 ValueProfile* profile = &m_valueProfiles[pc[i + opLength - 1].u.operand]; 1908 ASSERT(profile->m_bytecodeOffset == -1); 1909 profile->m_bytecodeOffset = i; 1910 instructions[i + 4].u.resolveOperations = &m_resolveOperations[pc[i + 4].u.operand]; 1911 if (pc[i].u.opcode != op_resolve_with_this) 1912 instructions[i + 5].u.putToBaseOperation = &m_putToBaseOperations[pc[i + 5].u.operand]; 1913 instructions[i + opLength - 1] = profile; 1914 break; 1915 } 1879 1916 case op_new_object: { 1880 1917 int objectAllocationProfileIndex = pc[i + opLength - 1].u.operand; -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r141050 r142769 212 212 void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset); 213 213 214 uint32_t addResolve()215 {216 m_resolveOperations.grow(m_resolveOperations.size() + 1);217 return m_resolveOperations.size() - 1;218 }219 uint32_t addPutToBase()220 {221 m_putToBaseOperations.append(PutToBaseOperation(isStrictMode()));222 return m_putToBaseOperations.size() - 1;223 }224 225 ResolveOperations* resolveOperations(uint32_t i)226 {227 return &m_resolveOperations[i];228 }229 230 PutToBaseOperation* putToBaseOperation(uint32_t i)231 {232 return &m_putToBaseOperations[i];233 }234 235 size_t numberOfResolveOperations() const { return m_resolveOperations.size(); }236 size_t numberOfPutToBaseOperations() const { return m_putToBaseOperations.size(); }237 238 214 #if ENABLE(JIT) 239 215 … … 883 859 ALWAYS_INLINE JSValue getConstant(int index) const { return m_constantRegisters[index - FirstConstantRegisterIndex].get(); } 884 860 885 unsigned addFunctionDecl(FunctionExecutable* n)886 {887 unsigned size = m_functionDecls.size();888 m_functionDecls.append(WriteBarrier<FunctionExecutable>());889 m_functionDecls.last().set(m_globalObject->globalData(), m_ownerExecutable.get(), n);890 return size;891 }892 861 FunctionExecutable* functionDecl(int index) { return m_functionDecls[index].get(); } 893 862 int numberOfFunctionDecls() { return m_functionDecls.size(); } 894 unsigned addFunctionExpr(FunctionExecutable* n)895 {896 unsigned size = m_functionExprs.size();897 m_functionExprs.append(WriteBarrier<FunctionExecutable>());898 m_functionExprs.last().set(m_globalObject->globalData(), m_ownerExecutable.get(), n);899 return size;900 }901 863 FunctionExecutable* functionExpr(int index) { return m_functionExprs[index].get(); } 902 864 -
trunk/Source/JavaScriptCore/bytecode/Instruction.h
r141050 r142769 34 34 #include "Opcode.h" 35 35 #include "PropertySlot.h" 36 #include "ResolveOperation.h" 36 37 #include "SpecialPointer.h" 37 38 #include "Structure.h" … … 221 222 void* pointer; 222 223 bool* predicatePointer; 224 ResolveOperations* resolveOperations; 225 PutToBaseOperation* putToBaseOperation; 223 226 } u; 224 227 -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r142515 r142769 183 183 184 184 // Convert a set of ResolveOperations into graph nodes 185 bool parseResolveOperations(SpeculatedType, unsigned identifierNumber, unsigned operations, unsigned putToBaseOperation, Node** base, Node** value);185 bool parseResolveOperations(SpeculatedType, unsigned identifierNumber, ResolveOperations*, PutToBaseOperation*, Node** base, Node** value); 186 186 187 187 // Prepare to parse a block. … … 1064 1064 Vector<unsigned> m_constantRemap; 1065 1065 Vector<unsigned> m_constantBufferRemap; 1066 Vector<unsigned> m_resolveOperationRemap;1067 Vector<unsigned> m_putToBaseOperationRemap;1068 1066 1069 1067 // Blocks introduced by this code block, which need successor linking. … … 1763 1761 } 1764 1762 1765 bool ByteCodeParser::parseResolveOperations(SpeculatedType prediction, unsigned identifier, unsigned operations, unsignedputToBaseOperation, Node** base, Node** value)1763 bool ByteCodeParser::parseResolveOperations(SpeculatedType prediction, unsigned identifier, ResolveOperations* resolveOperations, PutToBaseOperation* putToBaseOperation, Node** base, Node** value) 1766 1764 { 1767 ResolveOperations* resolveOperations = m_codeBlock->resolveOperations(operations);1768 1765 if (resolveOperations->isEmpty()) { 1769 1766 addToGraph(ForceOSRExit); … … 1866 1863 ResolveGlobalData& data = m_graph.m_resolveGlobalData.last(); 1867 1864 data.identifierNumber = identifier; 1868 data.resolveOperations Index = operations;1869 data.putToBaseOperation Index= putToBaseOperation;1865 data.resolveOperations = resolveOperations; 1866 data.putToBaseOperation = putToBaseOperation; 1870 1867 data.resolvePropertyIndex = resolveValueOperation - resolveOperations->data(); 1871 1868 *value = resolve; … … 3083 3080 3084 3081 unsigned identifier = m_inlineStackTop->m_identifierRemap[currentInstruction[2].u.operand]; 3085 unsigned operations = m_inlineStackTop->m_resolveOperationRemap[currentInstruction[3].u.operand];3082 ResolveOperations* operations = currentInstruction[3].u.resolveOperations; 3086 3083 Node* value = 0; 3087 3084 if (parseResolveOperations(prediction, identifier, operations, 0, 0, &value)) { … … 3094 3091 ResolveOperationData& data = m_graph.m_resolveOperationsData.last(); 3095 3092 data.identifierNumber = identifier; 3096 data.resolveOperations Index= operations;3093 data.resolveOperations = operations; 3097 3094 3098 3095 set(currentInstruction[1].u.operand, resolve); … … 3106 3103 unsigned identifier = m_inlineStackTop->m_identifierRemap[currentInstruction[2].u.operand]; 3107 3104 unsigned value = currentInstruction[3].u.operand; 3108 unsigned operation = m_inlineStackTop->m_putToBaseOperationRemap[currentInstruction[4].u.operand]; 3109 PutToBaseOperation* putToBase = m_codeBlock->putToBaseOperation(operation); 3105 PutToBaseOperation* putToBase = currentInstruction[4].u.putToBaseOperation; 3110 3106 3111 3107 if (putToBase->m_isDynamic) { … … 3181 3177 3182 3178 unsigned identifier = m_inlineStackTop->m_identifierRemap[currentInstruction[2].u.operand]; 3183 unsigned operations = m_inlineStackTop->m_resolveOperationRemap[currentInstruction[4].u.operand];3184 unsigned putToBaseOperation = m_inlineStackTop->m_putToBaseOperationRemap[currentInstruction[5].u.operand];3179 ResolveOperations* operations = currentInstruction[4].u.resolveOperations; 3180 PutToBaseOperation* putToBaseOperation = currentInstruction[5].u.putToBaseOperation; 3185 3181 3186 3182 Node* base = 0; … … 3194 3190 ResolveOperationData& data = m_graph.m_resolveOperationsData.last(); 3195 3191 data.identifierNumber = identifier; 3196 data.resolveOperations Index= operations;3197 data.putToBaseOperation Index= putToBaseOperation;3192 data.resolveOperations = operations; 3193 data.putToBaseOperation = putToBaseOperation; 3198 3194 3199 3195 set(currentInstruction[1].u.operand, resolve); … … 3206 3202 unsigned valueDst = currentInstruction[2].u.operand; 3207 3203 unsigned identifier = m_inlineStackTop->m_identifierRemap[currentInstruction[3].u.operand]; 3208 unsigned operations = m_inlineStackTop->m_resolveOperationRemap[currentInstruction[4].u.operand];3209 unsigned putToBaseOperation = m_inlineStackTop->m_putToBaseOperationRemap[currentInstruction[5].u.operand];3204 ResolveOperations* operations = currentInstruction[4].u.resolveOperations; 3205 PutToBaseOperation* putToBaseOperation = currentInstruction[5].u.putToBaseOperation; 3210 3206 3211 3207 Node* base = 0; … … 3225 3221 unsigned valueDst = currentInstruction[2].u.operand; 3226 3222 unsigned identifier = m_inlineStackTop->m_identifierRemap[currentInstruction[3].u.operand]; 3227 unsigned operations = m_inlineStackTop->m_resolveOperationRemap[currentInstruction[4].u.operand];3223 ResolveOperations* operations = currentInstruction[4].u.resolveOperations; 3228 3224 3229 3225 Node* base = 0; … … 3490 3486 m_constantRemap.resize(codeBlock->numberOfConstantRegisters()); 3491 3487 m_constantBufferRemap.resize(codeBlock->numberOfConstantBuffers()); 3492 m_resolveOperationRemap.resize(codeBlock->numberOfResolveOperations());3493 m_putToBaseOperationRemap.resize(codeBlock->numberOfPutToBaseOperations());3494 3488 3495 3489 for (size_t i = 0; i < codeBlock->numberOfIdentifiers(); ++i) { … … 3518 3512 m_constantRemap[i] = result.iterator->value; 3519 3513 } 3520 for (size_t i = 0; i < codeBlock->numberOfResolveOperations(); i++) {3521 uint32_t newResolve = byteCodeParser->m_codeBlock->addResolve();3522 m_resolveOperationRemap[i] = newResolve;3523 byteCodeParser->m_codeBlock->resolveOperations(newResolve)->append(*codeBlock->resolveOperations(i));3524 }3525 3514 for (unsigned i = 0; i < codeBlock->numberOfConstantBuffers(); ++i) { 3526 3515 // If we inline the same code block multiple times, we don't want to needlessly … … 3537 3526 byteCodeParser->m_constantBufferCache.add(ConstantBufferKey(codeBlock, i), newIndex); 3538 3527 } 3539 for (size_t i = 0; i < codeBlock->numberOfPutToBaseOperations(); i++) {3540 uint32_t putToBaseResolve = byteCodeParser->m_codeBlock->addPutToBase();3541 m_putToBaseOperationRemap[i] = putToBaseResolve;3542 *byteCodeParser->m_codeBlock->putToBaseOperation(putToBaseResolve) = *codeBlock->putToBaseOperation(i);3543 }3544 3545 3528 m_callsiteBlockHeadNeedsLinking = true; 3546 3529 } else { … … 3557 3540 m_constantRemap.resize(codeBlock->numberOfConstantRegisters()); 3558 3541 m_constantBufferRemap.resize(codeBlock->numberOfConstantBuffers()); 3559 m_resolveOperationRemap.resize(codeBlock->numberOfResolveOperations());3560 m_putToBaseOperationRemap.resize(codeBlock->numberOfPutToBaseOperations());3561 3562 3542 for (size_t i = 0; i < codeBlock->numberOfIdentifiers(); ++i) 3563 3543 m_identifierRemap[i] = i; … … 3566 3546 for (size_t i = 0; i < codeBlock->numberOfConstantBuffers(); ++i) 3567 3547 m_constantBufferRemap[i] = i; 3568 for (size_t i = 0; i < codeBlock->numberOfResolveOperations(); ++i)3569 m_resolveOperationRemap[i] = i;3570 for (size_t i = 0; i < codeBlock->numberOfPutToBaseOperations(); ++i)3571 m_putToBaseOperationRemap[i] = i;3572 3573 3548 m_callsiteBlockHeadNeedsLinking = false; 3574 3549 } -
trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h
r139145 r142769 236 236 case op_resolve_scoped_var_on_top_scope: 237 237 case op_resolve_scoped_var_with_top_scope_check: 238 return canInlineResolveOperations(opcodeID, codeBlock->resolveOperations(pc[3].u.operand));238 return canInlineResolveOperations(opcodeID, pc[3].u.resolveOperations); 239 239 240 240 case op_resolve_base_to_global: … … 245 245 case op_resolve_with_base: 246 246 case op_resolve_with_this: 247 return canInlineResolveOperations(opcodeID, codeBlock->resolveOperations(pc[4].u.operand));247 return canInlineResolveOperations(opcodeID, pc[4].u.resolveOperations); 248 248 249 249 // Inlining doesn't correctly remap regular expression operands. -
trunk/Source/JavaScriptCore/dfg/DFGGraph.h
r142377 r142769 61 61 struct ResolveGlobalData { 62 62 unsigned identifierNumber; 63 unsigned resolveOperationsIndex;64 unsigned putToBaseOperationIndex;63 ResolveOperations* resolveOperations; 64 PutToBaseOperation* putToBaseOperation; 65 65 unsigned resolvePropertyIndex; 66 66 }; … … 68 68 struct ResolveOperationData { 69 69 unsigned identifierNumber; 70 unsigned resolveOperationsIndex;71 unsigned putToBaseOperationIndex;70 ResolveOperations* resolveOperations; 71 PutToBaseOperation* putToBaseOperation; 72 72 }; 73 73 74 74 struct PutToBaseOperationData { 75 unsigned putToBaseOperationIndex;75 PutToBaseOperation* putToBaseOperation; 76 76 }; 77 77 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r142544 r142769 570 570 } 571 571 572 ResolveOperations* resolveOperations(unsigned index)573 {574 return m_jit.codeBlock()->resolveOperations(index);575 }576 577 PutToBaseOperation* putToBaseOperation(unsigned index)578 {579 return m_jit.codeBlock()->putToBaseOperation(index);580 }581 582 572 // Spill all VirtualRegisters back to the JSStack. 583 573 void flushRegisters() -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r142695 r142769 4713 4713 GPRResult2 resultTag(this); 4714 4714 ResolveOperationData& data = m_jit.graph().m_resolveOperationsData[node->resolveOperationsDataIndex()]; 4715 callOperation(operationResolve, resultTag.gpr(), resultPayload.gpr(), identifier(data.identifierNumber), resolveOperations(data.resolveOperationsIndex));4715 callOperation(operationResolve, resultTag.gpr(), resultPayload.gpr(), identifier(data.identifierNumber), data.resolveOperations); 4716 4716 jsValueResult(resultTag.gpr(), resultPayload.gpr(), node); 4717 4717 break; … … 4723 4723 GPRResult2 resultTag(this); 4724 4724 ResolveOperationData& data = m_jit.graph().m_resolveOperationsData[node->resolveOperationsDataIndex()]; 4725 callOperation(operationResolveBase, resultTag.gpr(), resultPayload.gpr(), identifier(data.identifierNumber), resolveOperations(data.resolveOperationsIndex), putToBaseOperation(data.putToBaseOperationIndex));4725 callOperation(operationResolveBase, resultTag.gpr(), resultPayload.gpr(), identifier(data.identifierNumber), data.resolveOperations, data.putToBaseOperation); 4726 4726 jsValueResult(resultTag.gpr(), resultPayload.gpr(), node); 4727 4727 break; … … 4733 4733 GPRResult2 resultTag(this); 4734 4734 ResolveOperationData& data = m_jit.graph().m_resolveOperationsData[node->resolveOperationsDataIndex()]; 4735 callOperation(operationResolveBaseStrictPut, resultTag.gpr(), resultPayload.gpr(), identifier(data.identifierNumber), resolveOperations(data.resolveOperationsIndex), putToBaseOperation(data.putToBaseOperationIndex));4735 callOperation(operationResolveBaseStrictPut, resultTag.gpr(), resultPayload.gpr(), identifier(data.identifierNumber), data.resolveOperations, data.putToBaseOperation); 4736 4736 jsValueResult(resultTag.gpr(), resultPayload.gpr(), node); 4737 4737 break; … … 4750 4750 4751 4751 ResolveGlobalData& data = m_jit.graph().m_resolveGlobalData[node->resolveGlobalDataIndex()]; 4752 ResolveOperation* resolveOperationAddress = &( m_jit.codeBlock()->resolveOperations(data.resolveOperationsIndex)->data()[data.resolvePropertyIndex]);4752 ResolveOperation* resolveOperationAddress = &(data.resolveOperations->data()[data.resolvePropertyIndex]); 4753 4753 4754 4754 // Check Structure of global object -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r142695 r142769 4623 4623 GPRResult result(this); 4624 4624 ResolveOperationData& data = m_jit.graph().m_resolveOperationsData[node->resolveOperationsDataIndex()]; 4625 callOperation(operationResolve, result.gpr(), identifier(data.identifierNumber), resolveOperations(data.resolveOperationsIndex));4625 callOperation(operationResolve, result.gpr(), identifier(data.identifierNumber), data.resolveOperations); 4626 4626 jsValueResult(result.gpr(), node); 4627 4627 break; … … 4632 4632 GPRResult result(this); 4633 4633 ResolveOperationData& data = m_jit.graph().m_resolveOperationsData[node->resolveOperationsDataIndex()]; 4634 callOperation(operationResolveBase, result.gpr(), identifier(data.identifierNumber), resolveOperations(data.resolveOperationsIndex), putToBaseOperation(data.putToBaseOperationIndex));4634 callOperation(operationResolveBase, result.gpr(), identifier(data.identifierNumber), data.resolveOperations, data.putToBaseOperation); 4635 4635 jsValueResult(result.gpr(), node); 4636 4636 break; … … 4641 4641 GPRResult result(this); 4642 4642 ResolveOperationData& data = m_jit.graph().m_resolveOperationsData[node->resolveOperationsDataIndex()]; 4643 callOperation(operationResolveBaseStrictPut, result.gpr(), identifier(data.identifierNumber), resolveOperations(data.resolveOperationsIndex), putToBaseOperation(data.putToBaseOperationIndex));4643 callOperation(operationResolveBaseStrictPut, result.gpr(), identifier(data.identifierNumber), data.resolveOperations, data.putToBaseOperation); 4644 4644 jsValueResult(result.gpr(), node); 4645 4645 break; … … 4656 4656 4657 4657 ResolveGlobalData& data = m_jit.graph().m_resolveGlobalData[node->resolveGlobalDataIndex()]; 4658 ResolveOperation* resolveOperationAddress = &( m_jit.codeBlock()->resolveOperations(data.resolveOperationsIndex)->data()[data.resolvePropertyIndex]);4658 ResolveOperation* resolveOperationAddress = &(data.resolveOperations->data()[data.resolvePropertyIndex]); 4659 4659 4660 4660 // Check Structure of global object -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r141050 r142769 1231 1231 int value = currentInstruction[3].u.operand; 1232 1232 1233 PutToBaseOperation* operation = m_codeBlock->putToBaseOperation(currentInstruction[4].u.operand);1233 PutToBaseOperation* operation = currentInstruction[4].u.putToBaseOperation; 1234 1234 switch (operation->m_kind) { 1235 1235 case PutToBaseOperation::GlobalVariablePutChecked: … … 1523 1523 void JIT::emit_op_resolve(Instruction* currentInstruction) 1524 1524 { 1525 ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[3].u.operand);1525 ResolveOperations* operations = currentInstruction[3].u.resolveOperations; 1526 1526 int dst = currentInstruction[1].u.operand; 1527 1527 emit_resolve_operations(operations, 0, &dst); … … 1530 1530 void JIT::emitSlow_op_resolve(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1531 1531 { 1532 ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[3].u.operand);1532 ResolveOperations* operations = currentInstruction[3].u.resolveOperations; 1533 1533 emitSlow_link_resolve_operations(operations, iter); 1534 1534 JITStubCall stubCall(this, cti_op_resolve); 1535 1535 stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand))); 1536 stubCall.addArgument(TrustedImmPtr( m_codeBlock->resolveOperations(currentInstruction[3].u.operand)));1536 stubCall.addArgument(TrustedImmPtr(currentInstruction[3].u.resolveOperations)); 1537 1537 stubCall.callWithValueProfiling(currentInstruction[1].u.operand); 1538 1538 } … … 1540 1540 void JIT::emit_op_resolve_base(Instruction* currentInstruction) 1541 1541 { 1542 ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);1542 ResolveOperations* operations = currentInstruction[4].u.resolveOperations; 1543 1543 int dst = currentInstruction[1].u.operand; 1544 1544 emit_resolve_operations(operations, &dst, 0); … … 1547 1547 void JIT::emitSlow_op_resolve_base(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1548 1548 { 1549 ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);1549 ResolveOperations* operations = currentInstruction[4].u.resolveOperations; 1550 1550 emitSlow_link_resolve_operations(operations, iter); 1551 1551 JITStubCall stubCall(this, currentInstruction[3].u.operand ? cti_op_resolve_base_strict_put : cti_op_resolve_base); 1552 1552 stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[2].u.operand))); 1553 stubCall.addArgument(TrustedImmPtr( m_codeBlock->resolveOperations(currentInstruction[4].u.operand)));1554 stubCall.addArgument(TrustedImmPtr( m_codeBlock->putToBaseOperation(currentInstruction[5].u.operand)));1553 stubCall.addArgument(TrustedImmPtr(currentInstruction[4].u.resolveOperations)); 1554 stubCall.addArgument(TrustedImmPtr(currentInstruction[5].u.putToBaseOperation)); 1555 1555 stubCall.callWithValueProfiling(currentInstruction[1].u.operand); 1556 1556 } … … 1558 1558 void JIT::emit_op_resolve_with_base(Instruction* currentInstruction) 1559 1559 { 1560 ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);1560 ResolveOperations* operations = currentInstruction[4].u.resolveOperations; 1561 1561 int base = currentInstruction[1].u.operand; 1562 1562 int value = currentInstruction[2].u.operand; … … 1566 1566 void JIT::emitSlow_op_resolve_with_base(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1567 1567 { 1568 ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);1568 ResolveOperations* operations = currentInstruction[4].u.resolveOperations; 1569 1569 emitSlow_link_resolve_operations(operations, iter); 1570 1570 JITStubCall stubCall(this, cti_op_resolve_with_base); 1571 1571 stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand))); 1572 1572 stubCall.addArgument(TrustedImm32(currentInstruction[1].u.operand)); 1573 stubCall.addArgument(TrustedImmPtr( m_codeBlock->resolveOperations(currentInstruction[4].u.operand)));1574 stubCall.addArgument(TrustedImmPtr( m_codeBlock->putToBaseOperation(currentInstruction[5].u.operand)));1573 stubCall.addArgument(TrustedImmPtr(currentInstruction[4].u.resolveOperations)); 1574 stubCall.addArgument(TrustedImmPtr(currentInstruction[5].u.putToBaseOperation)); 1575 1575 stubCall.callWithValueProfiling(currentInstruction[2].u.operand); 1576 1576 } … … 1578 1578 void JIT::emit_op_resolve_with_this(Instruction* currentInstruction) 1579 1579 { 1580 ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);1580 ResolveOperations* operations = currentInstruction[4].u.resolveOperations; 1581 1581 int base = currentInstruction[1].u.operand; 1582 1582 int value = currentInstruction[2].u.operand; … … 1586 1586 void JIT::emitSlow_op_resolve_with_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1587 1587 { 1588 ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);1588 ResolveOperations* operations = currentInstruction[4].u.resolveOperations; 1589 1589 emitSlow_link_resolve_operations(operations, iter); 1590 1590 JITStubCall stubCall(this, cti_op_resolve_with_this); 1591 1591 stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand))); 1592 1592 stubCall.addArgument(TrustedImm32(currentInstruction[1].u.operand)); 1593 stubCall.addArgument(TrustedImmPtr( m_codeBlock->resolveOperations(currentInstruction[4].u.operand)));1593 stubCall.addArgument(TrustedImmPtr(currentInstruction[4].u.resolveOperations)); 1594 1594 stubCall.callWithValueProfiling(currentInstruction[2].u.operand); 1595 1595 } … … 1600 1600 int id = currentInstruction[2].u.operand; 1601 1601 int value = currentInstruction[3].u.operand; 1602 int operation = currentInstruction[4].u.operand; 1603 1604 PutToBaseOperation* putToBaseOperation = m_codeBlock->putToBaseOperation(currentInstruction[4].u.operand); 1602 1603 PutToBaseOperation* putToBaseOperation = currentInstruction[4].u.putToBaseOperation; 1605 1604 switch (putToBaseOperation->m_kind) { 1606 1605 case PutToBaseOperation::VariablePut: … … 1630 1629 stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(id))); 1631 1630 stubCall.addArgument(TrustedImm32(value)); 1632 stubCall.addArgument(TrustedImmPtr( m_codeBlock->putToBaseOperation(operation)));1631 stubCall.addArgument(TrustedImmPtr(putToBaseOperation)); 1633 1632 stubCall.call(); 1634 1633 } -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r141050 r142769 1326 1326 int value = currentInstruction[3].u.operand; 1327 1327 1328 PutToBaseOperation* operation = m_codeBlock->putToBaseOperation(currentInstruction[4].u.operand);1328 PutToBaseOperation* operation = currentInstruction[4].u.putToBaseOperation; 1329 1329 1330 1330 -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r142377 r142769 788 788 LLINT_BEGIN(); 789 789 Identifier ident = exec->codeBlock()->identifier(pc[2].u.operand); 790 ResolveOperations* operations = exec->codeBlock()->resolveOperations(pc[3].u.operand);790 ResolveOperations* operations = pc[3].u.resolveOperations; 791 791 JSValue result = JSScope::resolve(exec, ident, operations); 792 792 ASSERT(operations->size()); 793 ASSERT(operations == exec->codeBlock()->resolveOperations(pc[3].u.operand));794 793 switch (operations->data()[0].m_operation) { 795 794 case ResolveOperation::GetAndReturnGlobalProperty: … … 821 820 { 822 821 LLINT_BEGIN(); 823 PutToBaseOperation* operation = exec->codeBlock()->putToBaseOperation(pc[4].u.operand);822 PutToBaseOperation* operation = pc[4].u.putToBaseOperation; 824 823 JSScope::resolvePut(exec, LLINT_OP_C(1).jsValue(), exec->codeBlock()->identifier(pc[2].u.operand), LLINT_OP_C(3).jsValue(), operation); 825 824 switch (operation->m_kind) { … … 838 837 LLINT_BEGIN(); 839 838 Identifier& ident = exec->codeBlock()->identifier(pc[2].u.operand); 840 ResolveOperations* operations = exec->codeBlock()->resolveOperations(pc[4].u.operand);839 ResolveOperations* operations = pc[4].u.resolveOperations; 841 840 JSValue result; 842 841 if (pc[3].u.operand) { 843 result = JSScope::resolveBase(exec, ident, true, operations, exec->codeBlock()->putToBaseOperation(pc[5].u.operand));842 result = JSScope::resolveBase(exec, ident, true, operations, pc[5].u.putToBaseOperation); 844 843 if (!result) 845 844 LLINT_THROW(globalData.exception); 846 845 } else 847 result = JSScope::resolveBase(exec, ident, false, operations, exec->codeBlock()->putToBaseOperation(pc[5].u.operand));846 result = JSScope::resolveBase(exec, ident, false, operations, pc[5].u.putToBaseOperation); 848 847 ASSERT(operations->size()); 849 848 switch (operations->data()[0].m_operation) { … … 881 880 { 882 881 LLINT_BEGIN(); 883 ResolveOperations* operations = exec->codeBlock()->resolveOperations(pc[4].u.operand);884 JSValue result = JSScope::resolveWithBase(exec, exec->codeBlock()->identifier(pc[3].u.operand), &LLINT_OP(1), operations, exec->codeBlock()->putToBaseOperation(pc[5].u.operand));882 ResolveOperations* operations = pc[4].u.resolveOperations; 883 JSValue result = JSScope::resolveWithBase(exec, exec->codeBlock()->identifier(pc[3].u.operand), &LLINT_OP(1), operations, pc[5].u.putToBaseOperation); 885 884 LLINT_CHECK_EXCEPTION(); 886 885 LLINT_OP(2) = result; … … 892 891 { 893 892 LLINT_BEGIN(); 894 ResolveOperations* operations = exec->codeBlock()->resolveOperations(pc[4].u.operand);893 ResolveOperations* operations = pc[4].u.resolveOperations; 895 894 JSValue result = JSScope::resolveWithThis(exec, exec->codeBlock()->identifier(pc[3].u.operand), &LLINT_OP(1), operations); 896 895 LLINT_CHECK_EXCEPTION(); -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r141050 r142769 526 526 527 527 macro getPutToBaseOperationField(scratch, scratch1, fieldOffset, fieldGetter) 528 loadisFromInstruction(4, scratch) 529 mulp sizeof PutToBaseOperation, scratch, scratch 530 loadp CodeBlock[cfr], scratch1 531 loadp VectorBufferOffset + CodeBlock::m_putToBaseOperations[scratch1], scratch1 532 fieldGetter(fieldOffset[scratch1, scratch, 1]) 528 loadpFromInstruction(4, scratch) 529 fieldGetter(fieldOffset[scratch]) 533 530 end 534 531 … … 578 575 dispatch(5) 579 576 580 macro getResolveOperation(resolveOperationIndex, dest, scratch) 581 loadisFromInstruction(resolveOperationIndex, dest) 582 mulp sizeof ResolveOperations, dest, dest 583 loadp CodeBlock[cfr], scratch 584 loadp VectorBufferOffset + CodeBlock::m_resolveOperations[scratch], scratch 585 loadp VectorBufferOffset[scratch, dest, 1], dest 577 macro getResolveOperation(resolveOperationIndex, dest) 578 loadpFromInstruction(resolveOperationIndex, dest) 579 loadp VectorBufferOffset[dest], dest 586 580 end 587 581 … … 646 640 _llint_op_resolve_global_property: 647 641 traceExecution() 648 getResolveOperation(3, t0 , t1)642 getResolveOperation(3, t0) 649 643 loadp CodeBlock[cfr], t1 650 644 loadp CodeBlock::m_globalObject[t1], t1 … … 665 659 _llint_op_resolve_global_var: 666 660 traceExecution() 667 getResolveOperation(3, t0 , t1)661 getResolveOperation(3, t0) 668 662 loadp ResolveOperation::m_registerAddress[t0], t0 669 663 loadisFromInstruction(1, t1) … … 687 681 _llint_op_resolve_scoped_var: 688 682 traceExecution() 689 getResolveOperation(3, t0 , t1)683 getResolveOperation(3, t0) 690 684 resolveScopedVarBody(t0) 691 685 dispatch(5) … … 693 687 _llint_op_resolve_scoped_var_on_top_scope: 694 688 traceExecution() 695 getResolveOperation(3, t0 , t1)689 getResolveOperation(3, t0) 696 690 697 691 # Load destination index … … 710 704 _llint_op_resolve_scoped_var_with_top_scope_check: 711 705 traceExecution() 712 getResolveOperation(3, t0 , t1)706 getResolveOperation(3, t0) 713 707 # First ResolveOperation tells us what register to check 714 708 loadis ResolveOperation::m_activationRegister[t0], t1 … … 737 731 .llint_op_resolve_local: 738 732 traceExecution() 739 getResolveOperation(3, t0 , t1)733 getResolveOperation(3, t0) 740 734 btpz t0, .noInstructions 741 735 loadis ResolveOperation::m_operation[t0], t1 … … 773 767 _llint_op_resolve_base_to_scope: 774 768 traceExecution() 775 getResolveOperation(4, t0 , t1)769 getResolveOperation(4, t0) 776 770 # First ResolveOperation is to skip scope chain nodes 777 771 getScope(macro(dest) … … 790 784 _llint_op_resolve_base_to_scope_with_top_scope_check: 791 785 traceExecution() 792 getResolveOperation(4, t0 , t1)786 getResolveOperation(4, t0) 793 787 # First ResolveOperation tells us what register to check 794 788 loadis ResolveOperation::m_activationRegister[t0], t1 … … 828 822 macro interpretResolveWithBase(opcodeLength, slowPath) 829 823 traceExecution() 830 getResolveOperation(4, t0 , t1)824 getResolveOperation(4, t0) 831 825 btpz t0, .slowPath 832 826
Note: See TracChangeset
for help on using the changeset viewer.