Changeset 142769 in webkit


Ignore:
Timestamp:
Feb 13, 2013 12:08:11 PM (11 years ago)
Author:
oliver@apple.com
Message:

Remove unnecessary indirection to non-local variable access operations
https://bugs.webkit.org/show_bug.cgi?id=109724

Reviewed by Filip Pizlo.

Linked bytecode now stores a direct pointer to the resolve operation
vectors, so the interpreter no longer needs a bunch of indirection to
to perform non-local lookup.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):

  • bytecode/CodeBlock.h:

(CodeBlock):

  • bytecode/Instruction.h:
  • dfg/DFGByteCodeParser.cpp:

(ByteCodeParser):
(InlineStackEntry):
(JSC::DFG::ByteCodeParser::parseResolveOperations):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):

  • dfg/DFGCapabilities.h:

(JSC::DFG::canInlineOpcode):

  • dfg/DFGGraph.h:

(ResolveGlobalData):
(ResolveOperationData):
(PutToBaseOperationData):

  • dfg/DFGSpeculativeJIT.h:
  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_put_to_base):
(JSC::JIT::emit_op_resolve):
(JSC::JIT::emitSlow_op_resolve):
(JSC::JIT::emit_op_resolve_base):
(JSC::JIT::emitSlow_op_resolve_base):
(JSC::JIT::emit_op_resolve_with_base):
(JSC::JIT::emitSlow_op_resolve_with_base):
(JSC::JIT::emit_op_resolve_with_this):
(JSC::JIT::emitSlow_op_resolve_with_this):
(JSC::JIT::emitSlow_op_put_to_base):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_put_to_base):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LowLevelInterpreter.asm:
Location:
trunk/Source/JavaScriptCore
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r142751 r142769  
     12013-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
    1512013-02-13  Zoltan Herczeg  <zherczeg@webkit.org>
    252
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r141962 r142769  
    18201820    if (size_t size = unlinkedCodeBlock->numberOfResolveOperations())
    18211821        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    }
    18261827
    18271828    // Copy and translate the UnlinkedInstructions
     
    18481849        }
    18491850        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:
    18541851        case op_get_by_id:
    18551852        case op_call_put_result:
     
    18761873        }
    18771874#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        }
    18791916        case op_new_object: {
    18801917            int objectAllocationProfileIndex = pc[i + opLength - 1].u.operand;
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r141050 r142769  
    212212        void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset);
    213213
    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 
    238214#if ENABLE(JIT)
    239215
     
    883859        ALWAYS_INLINE JSValue getConstant(int index) const { return m_constantRegisters[index - FirstConstantRegisterIndex].get(); }
    884860
    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         }
    892861        FunctionExecutable* functionDecl(int index) { return m_functionDecls[index].get(); }
    893862        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         }
    901863        FunctionExecutable* functionExpr(int index) { return m_functionExprs[index].get(); }
    902864
  • trunk/Source/JavaScriptCore/bytecode/Instruction.h

    r141050 r142769  
    3434#include "Opcode.h"
    3535#include "PropertySlot.h"
     36#include "ResolveOperation.h"
    3637#include "SpecialPointer.h"
    3738#include "Structure.h"
     
    221222            void* pointer;
    222223            bool* predicatePointer;
     224            ResolveOperations* resolveOperations;
     225            PutToBaseOperation* putToBaseOperation;
    223226        } u;
    224227       
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r142515 r142769  
    183183   
    184184    // 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);
    186186
    187187    // Prepare to parse a block.
     
    10641064        Vector<unsigned> m_constantRemap;
    10651065        Vector<unsigned> m_constantBufferRemap;
    1066         Vector<unsigned> m_resolveOperationRemap;
    1067         Vector<unsigned> m_putToBaseOperationRemap;
    10681066       
    10691067        // Blocks introduced by this code block, which need successor linking.
     
    17631761}
    17641762
    1765 bool ByteCodeParser::parseResolveOperations(SpeculatedType prediction, unsigned identifier, unsigned operations, unsigned putToBaseOperation, Node** base, Node** value)
     1763bool ByteCodeParser::parseResolveOperations(SpeculatedType prediction, unsigned identifier, ResolveOperations* resolveOperations, PutToBaseOperation* putToBaseOperation, Node** base, Node** value)
    17661764{
    1767     ResolveOperations* resolveOperations = m_codeBlock->resolveOperations(operations);
    17681765    if (resolveOperations->isEmpty()) {
    17691766        addToGraph(ForceOSRExit);
     
    18661863        ResolveGlobalData& data = m_graph.m_resolveGlobalData.last();
    18671864        data.identifierNumber = identifier;
    1868         data.resolveOperationsIndex = operations;
    1869         data.putToBaseOperationIndex = putToBaseOperation;
     1865        data.resolveOperations = resolveOperations;
     1866        data.putToBaseOperation = putToBaseOperation;
    18701867        data.resolvePropertyIndex = resolveValueOperation - resolveOperations->data();
    18711868        *value = resolve;
     
    30833080           
    30843081            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;
    30863083            Node* value = 0;
    30873084            if (parseResolveOperations(prediction, identifier, operations, 0, 0, &value)) {
     
    30943091            ResolveOperationData& data = m_graph.m_resolveOperationsData.last();
    30953092            data.identifierNumber = identifier;
    3096             data.resolveOperationsIndex = operations;
     3093            data.resolveOperations = operations;
    30973094
    30983095            set(currentInstruction[1].u.operand, resolve);
     
    31063103            unsigned identifier = m_inlineStackTop->m_identifierRemap[currentInstruction[2].u.operand];
    31073104            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;
    31103106
    31113107            if (putToBase->m_isDynamic) {
     
    31813177           
    31823178            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;
    31853181
    31863182            Node* base = 0;
     
    31943190            ResolveOperationData& data = m_graph.m_resolveOperationsData.last();
    31953191            data.identifierNumber = identifier;
    3196             data.resolveOperationsIndex = operations;
    3197             data.putToBaseOperationIndex = putToBaseOperation;
     3192            data.resolveOperations = operations;
     3193            data.putToBaseOperation = putToBaseOperation;
    31983194       
    31993195            set(currentInstruction[1].u.operand, resolve);
     
    32063202            unsigned valueDst = currentInstruction[2].u.operand;
    32073203            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;
    32103206
    32113207            Node* base = 0;
     
    32253221            unsigned valueDst = currentInstruction[2].u.operand;
    32263222            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;
    32283224
    32293225            Node* base = 0;
     
    34903486        m_constantRemap.resize(codeBlock->numberOfConstantRegisters());
    34913487        m_constantBufferRemap.resize(codeBlock->numberOfConstantBuffers());
    3492         m_resolveOperationRemap.resize(codeBlock->numberOfResolveOperations());
    3493         m_putToBaseOperationRemap.resize(codeBlock->numberOfPutToBaseOperations());
    34943488
    34953489        for (size_t i = 0; i < codeBlock->numberOfIdentifiers(); ++i) {
     
    35183512            m_constantRemap[i] = result.iterator->value;
    35193513        }
    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         }
    35253514        for (unsigned i = 0; i < codeBlock->numberOfConstantBuffers(); ++i) {
    35263515            // If we inline the same code block multiple times, we don't want to needlessly
     
    35373526            byteCodeParser->m_constantBufferCache.add(ConstantBufferKey(codeBlock, i), newIndex);
    35383527        }
    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        
    35453528        m_callsiteBlockHeadNeedsLinking = true;
    35463529    } else {
     
    35573540        m_constantRemap.resize(codeBlock->numberOfConstantRegisters());
    35583541        m_constantBufferRemap.resize(codeBlock->numberOfConstantBuffers());
    3559         m_resolveOperationRemap.resize(codeBlock->numberOfResolveOperations());
    3560         m_putToBaseOperationRemap.resize(codeBlock->numberOfPutToBaseOperations());
    3561 
    35623542        for (size_t i = 0; i < codeBlock->numberOfIdentifiers(); ++i)
    35633543            m_identifierRemap[i] = i;
     
    35663546        for (size_t i = 0; i < codeBlock->numberOfConstantBuffers(); ++i)
    35673547            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 
    35733548        m_callsiteBlockHeadNeedsLinking = false;
    35743549    }
  • trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h

    r139145 r142769  
    236236    case op_resolve_scoped_var_on_top_scope:
    237237    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);
    239239
    240240    case op_resolve_base_to_global:
     
    245245    case op_resolve_with_base:
    246246    case op_resolve_with_this:
    247         return canInlineResolveOperations(opcodeID, codeBlock->resolveOperations(pc[4].u.operand));
     247        return canInlineResolveOperations(opcodeID, pc[4].u.resolveOperations);
    248248       
    249249    // Inlining doesn't correctly remap regular expression operands.
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.h

    r142377 r142769  
    6161struct ResolveGlobalData {
    6262    unsigned identifierNumber;
    63     unsigned resolveOperationsIndex;
    64     unsigned putToBaseOperationIndex;
     63    ResolveOperations* resolveOperations;
     64    PutToBaseOperation* putToBaseOperation;
    6565    unsigned resolvePropertyIndex;
    6666};
     
    6868struct ResolveOperationData {
    6969    unsigned identifierNumber;
    70     unsigned resolveOperationsIndex;
    71     unsigned putToBaseOperationIndex;
     70    ResolveOperations* resolveOperations;
     71    PutToBaseOperation* putToBaseOperation;
    7272};
    7373
    7474struct PutToBaseOperationData {
    75     unsigned putToBaseOperationIndex;
     75    PutToBaseOperation* putToBaseOperation;
    7676};
    7777
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r142544 r142769  
    570570    }
    571571
    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 
    582572    // Spill all VirtualRegisters back to the JSStack.
    583573    void flushRegisters()
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r142695 r142769  
    47134713        GPRResult2 resultTag(this);
    47144714        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);
    47164716        jsValueResult(resultTag.gpr(), resultPayload.gpr(), node);
    47174717        break;
     
    47234723        GPRResult2 resultTag(this);
    47244724        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);
    47264726        jsValueResult(resultTag.gpr(), resultPayload.gpr(), node);
    47274727        break;
     
    47334733        GPRResult2 resultTag(this);
    47344734        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);
    47364736        jsValueResult(resultTag.gpr(), resultPayload.gpr(), node);
    47374737        break;
     
    47504750
    47514751        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]);
    47534753
    47544754        // Check Structure of global object
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r142695 r142769  
    46234623        GPRResult result(this);
    46244624        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);
    46264626        jsValueResult(result.gpr(), node);
    46274627        break;
     
    46324632        GPRResult result(this);
    46334633        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);
    46354635        jsValueResult(result.gpr(), node);
    46364636        break;
     
    46414641        GPRResult result(this);
    46424642        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);
    46444644        jsValueResult(result.gpr(), node);
    46454645        break;
     
    46564656
    46574657        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]);
    46594659
    46604660        // Check Structure of global object
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r141050 r142769  
    12311231    int value = currentInstruction[3].u.operand;
    12321232
    1233     PutToBaseOperation* operation = m_codeBlock->putToBaseOperation(currentInstruction[4].u.operand);
     1233    PutToBaseOperation* operation = currentInstruction[4].u.putToBaseOperation;
    12341234    switch (operation->m_kind) {
    12351235    case PutToBaseOperation::GlobalVariablePutChecked:
     
    15231523void JIT::emit_op_resolve(Instruction* currentInstruction)
    15241524{
    1525     ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[3].u.operand);
     1525    ResolveOperations* operations = currentInstruction[3].u.resolveOperations;
    15261526    int dst = currentInstruction[1].u.operand;
    15271527    emit_resolve_operations(operations, 0, &dst);
     
    15301530void JIT::emitSlow_op_resolve(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    15311531{
    1532     ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[3].u.operand);
     1532    ResolveOperations* operations = currentInstruction[3].u.resolveOperations;
    15331533    emitSlow_link_resolve_operations(operations, iter);
    15341534    JITStubCall stubCall(this, cti_op_resolve);
    15351535    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));
    15371537    stubCall.callWithValueProfiling(currentInstruction[1].u.operand);
    15381538}
     
    15401540void JIT::emit_op_resolve_base(Instruction* currentInstruction)
    15411541{
    1542     ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);
     1542    ResolveOperations* operations = currentInstruction[4].u.resolveOperations;
    15431543    int dst = currentInstruction[1].u.operand;
    15441544    emit_resolve_operations(operations, &dst, 0);
     
    15471547void JIT::emitSlow_op_resolve_base(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    15481548{
    1549     ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);
     1549    ResolveOperations* operations = currentInstruction[4].u.resolveOperations;
    15501550    emitSlow_link_resolve_operations(operations, iter);
    15511551    JITStubCall stubCall(this, currentInstruction[3].u.operand ? cti_op_resolve_base_strict_put : cti_op_resolve_base);
    15521552    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));
    15551555    stubCall.callWithValueProfiling(currentInstruction[1].u.operand);
    15561556}
     
    15581558void JIT::emit_op_resolve_with_base(Instruction* currentInstruction)
    15591559{
    1560     ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);
     1560    ResolveOperations* operations = currentInstruction[4].u.resolveOperations;
    15611561    int base = currentInstruction[1].u.operand;
    15621562    int value = currentInstruction[2].u.operand;
     
    15661566void JIT::emitSlow_op_resolve_with_base(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    15671567{
    1568     ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);
     1568    ResolveOperations* operations = currentInstruction[4].u.resolveOperations;
    15691569    emitSlow_link_resolve_operations(operations, iter);
    15701570    JITStubCall stubCall(this, cti_op_resolve_with_base);
    15711571    stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand)));
    15721572    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));
    15751575    stubCall.callWithValueProfiling(currentInstruction[2].u.operand);
    15761576}
     
    15781578void JIT::emit_op_resolve_with_this(Instruction* currentInstruction)
    15791579{
    1580     ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);
     1580    ResolveOperations* operations = currentInstruction[4].u.resolveOperations;
    15811581    int base = currentInstruction[1].u.operand;
    15821582    int value = currentInstruction[2].u.operand;
     
    15861586void JIT::emitSlow_op_resolve_with_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    15871587{
    1588     ResolveOperations* operations = m_codeBlock->resolveOperations(currentInstruction[4].u.operand);
     1588    ResolveOperations* operations = currentInstruction[4].u.resolveOperations;
    15891589    emitSlow_link_resolve_operations(operations, iter);
    15901590    JITStubCall stubCall(this, cti_op_resolve_with_this);
    15911591    stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(currentInstruction[3].u.operand)));
    15921592    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));
    15941594    stubCall.callWithValueProfiling(currentInstruction[2].u.operand);
    15951595}
     
    16001600    int id = currentInstruction[2].u.operand;
    16011601    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;
    16051604    switch (putToBaseOperation->m_kind) {
    16061605    case PutToBaseOperation::VariablePut:
     
    16301629    stubCall.addArgument(TrustedImmPtr(&m_codeBlock->identifier(id)));
    16311630    stubCall.addArgument(TrustedImm32(value));
    1632     stubCall.addArgument(TrustedImmPtr(m_codeBlock->putToBaseOperation(operation)));
     1631    stubCall.addArgument(TrustedImmPtr(putToBaseOperation));
    16331632    stubCall.call();
    16341633}
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r141050 r142769  
    13261326    int value = currentInstruction[3].u.operand;
    13271327
    1328     PutToBaseOperation* operation = m_codeBlock->putToBaseOperation(currentInstruction[4].u.operand);
     1328    PutToBaseOperation* operation = currentInstruction[4].u.putToBaseOperation;
    13291329
    13301330
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r142377 r142769  
    788788    LLINT_BEGIN();
    789789    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;
    791791    JSValue result = JSScope::resolve(exec, ident, operations);
    792792    ASSERT(operations->size());
    793     ASSERT(operations == exec->codeBlock()->resolveOperations(pc[3].u.operand));
    794793    switch (operations->data()[0].m_operation) {
    795794    case ResolveOperation::GetAndReturnGlobalProperty:
     
    821820{
    822821    LLINT_BEGIN();
    823     PutToBaseOperation* operation = exec->codeBlock()->putToBaseOperation(pc[4].u.operand);
     822    PutToBaseOperation* operation = pc[4].u.putToBaseOperation;
    824823    JSScope::resolvePut(exec, LLINT_OP_C(1).jsValue(), exec->codeBlock()->identifier(pc[2].u.operand), LLINT_OP_C(3).jsValue(), operation);
    825824    switch (operation->m_kind) {
     
    838837    LLINT_BEGIN();
    839838    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;
    841840    JSValue result;
    842841    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);
    844843        if (!result)
    845844            LLINT_THROW(globalData.exception);
    846845    } 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);
    848847    ASSERT(operations->size());
    849848    switch (operations->data()[0].m_operation) {
     
    881880{
    882881    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);
    885884    LLINT_CHECK_EXCEPTION();
    886885    LLINT_OP(2) = result;
     
    892891{
    893892    LLINT_BEGIN();
    894     ResolveOperations* operations = exec->codeBlock()->resolveOperations(pc[4].u.operand);
     893    ResolveOperations* operations = pc[4].u.resolveOperations;
    895894    JSValue result = JSScope::resolveWithThis(exec, exec->codeBlock()->identifier(pc[3].u.operand), &LLINT_OP(1), operations);
    896895    LLINT_CHECK_EXCEPTION();
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r141050 r142769  
    526526
    527527macro 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])
    533530end
    534531
     
    578575    dispatch(5)
    579576
    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
     577macro getResolveOperation(resolveOperationIndex, dest)
     578    loadpFromInstruction(resolveOperationIndex, dest)
     579    loadp VectorBufferOffset[dest], dest
    586580end
    587581
     
    646640_llint_op_resolve_global_property:
    647641    traceExecution()
    648     getResolveOperation(3, t0, t1)
     642    getResolveOperation(3, t0)
    649643    loadp CodeBlock[cfr], t1
    650644    loadp CodeBlock::m_globalObject[t1], t1
     
    665659_llint_op_resolve_global_var:
    666660    traceExecution()
    667     getResolveOperation(3, t0, t1)
     661    getResolveOperation(3, t0)
    668662    loadp ResolveOperation::m_registerAddress[t0], t0
    669663    loadisFromInstruction(1, t1)
     
    687681_llint_op_resolve_scoped_var:
    688682    traceExecution()
    689     getResolveOperation(3, t0, t1)
     683    getResolveOperation(3, t0)
    690684    resolveScopedVarBody(t0)
    691685    dispatch(5)
     
    693687_llint_op_resolve_scoped_var_on_top_scope:
    694688    traceExecution()
    695     getResolveOperation(3, t0, t1)
     689    getResolveOperation(3, t0)
    696690
    697691    # Load destination index
     
    710704_llint_op_resolve_scoped_var_with_top_scope_check:
    711705    traceExecution()
    712     getResolveOperation(3, t0, t1)
     706    getResolveOperation(3, t0)
    713707    # First ResolveOperation tells us what register to check
    714708    loadis ResolveOperation::m_activationRegister[t0], t1
     
    737731.llint_op_resolve_local:
    738732    traceExecution()
    739     getResolveOperation(3, t0, t1)
     733    getResolveOperation(3, t0)
    740734    btpz t0, .noInstructions
    741735    loadis ResolveOperation::m_operation[t0], t1
     
    773767_llint_op_resolve_base_to_scope:
    774768    traceExecution()
    775     getResolveOperation(4, t0, t1)
     769    getResolveOperation(4, t0)
    776770    # First ResolveOperation is to skip scope chain nodes
    777771    getScope(macro(dest)
     
    790784_llint_op_resolve_base_to_scope_with_top_scope_check:
    791785    traceExecution()
    792     getResolveOperation(4, t0, t1)
     786    getResolveOperation(4, t0)
    793787    # First ResolveOperation tells us what register to check
    794788    loadis ResolveOperation::m_activationRegister[t0], t1
     
    828822macro interpretResolveWithBase(opcodeLength, slowPath)
    829823    traceExecution()
    830     getResolveOperation(4, t0, t1)
     824    getResolveOperation(4, t0)
    831825    btpz t0, .slowPath
    832826
Note: See TracChangeset for help on using the changeset viewer.