Ignore:
Timestamp:
Jan 15, 2020, 1:30:57 PM (5 years ago)
Author:
[email protected]
Message:

Revert bytecode checkpoints since it breaks watch
https://bugs.webkit.org/show_bug.cgi?id=206301

Unreviewed, revert.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r254464 r254632  
    114114        , m_numArguments(m_codeBlock->numParameters())
    115115        , m_numLocals(m_codeBlock->numCalleeLocals())
    116         , m_numTmps(m_codeBlock->numTmps())
    117116        , m_parameterSlots(0)
    118117        , m_numPassedVarArgs(0)
     
    142141            m_graph.block(i)->ensureLocals(newNumLocals);
    143142    }
    144 
    145     void ensureTmps(unsigned newNumTmps)
    146     {
    147         VERBOSE_LOG("   ensureTmps: trying to raise m_numTmps from ", m_numTmps, " to ", newNumTmps, "\n");
    148         if (newNumTmps <= m_numTmps)
    149             return;
    150         m_numTmps = newNumTmps;
    151         for (size_t i = 0; i < m_graph.numBlocks(); ++i)
    152             m_graph.block(i)->ensureTmps(newNumTmps);
    153     }
    154 
    155143
    156144    // Helper for min and max.
     
    285273    void linkBlocks(Vector<BasicBlock*>& unlinkedBlocks, Vector<BasicBlock*>& possibleTargets);
    286274   
    287     void progressToNextCheckpoint()
    288     {
    289         m_currentIndex = BytecodeIndex(m_currentIndex.offset(), m_currentIndex.checkpoint() + 1);
    290         // At this point, it's again OK to OSR exit.
    291         m_exitOK = true;
    292         addToGraph(ExitOK);
    293 
    294         processSetLocalQueue();
    295     }
    296 
    297     VariableAccessData* newVariableAccessData(Operand operand)
     275    VariableAccessData* newVariableAccessData(VirtualRegister operand)
    298276    {
    299277        ASSERT(!operand.isConstant());
     
    304282   
    305283    // Get/Set the operands/result of a bytecode instruction.
    306     Node* getDirect(Operand operand)
     284    Node* getDirect(VirtualRegister operand)
    307285    {
    308286        ASSERT(!operand.isConstant());
    309287
     288        // Is this an argument?
    310289        if (operand.isArgument())
    311             return getArgument(operand.virtualRegister());
    312 
    313         return getLocalOrTmp(operand);
     290            return getArgument(operand);
     291
     292        // Must be a local.
     293        return getLocal(operand);
    314294    }
    315295
     
    321301            if (constantIndex >= oldSize || !m_constants[constantIndex]) {
    322302                const CodeBlock& codeBlock = *m_inlineStackTop->m_codeBlock;
    323                 JSValue value = codeBlock.getConstant(operand);
    324                 SourceCodeRepresentation sourceCodeRepresentation = codeBlock.constantSourceCodeRepresentation(operand);
     303                JSValue value = codeBlock.getConstant(operand.offset());
     304                SourceCodeRepresentation sourceCodeRepresentation = codeBlock.constantSourceCodeRepresentation(operand.offset());
    325305                if (constantIndex >= oldSize) {
    326306                    m_constants.grow(constantIndex + 1);
     
    381361        ImmediateNakedSet
    382362    };
    383 
    384     Node* setDirect(Operand operand, Node* value, SetMode setMode = NormalSet)
     363    Node* setDirect(VirtualRegister operand, Node* value, SetMode setMode = NormalSet)
    385364    {
    386         addToGraph(MovHint, OpInfo(operand), value);
     365        addToGraph(MovHint, OpInfo(operand.offset()), value);
    387366
    388367        // We can't exit anymore because our OSR exit state has changed.
     
    398377        return delayed.execute(this);
    399378    }
    400 
     379   
    401380    void processSetLocalQueue()
    402381    {
     
    416395        ASSERT(node->origin.semantic.bytecodeIndex() == m_currentIndex);
    417396        ConcurrentJSLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
    418         LazyOperandValueProfileKey key(m_currentIndex, node->operand());
     397        LazyOperandValueProfileKey key(m_currentIndex, node->local());
    419398        SpeculatedType prediction = m_inlineStackTop->m_lazyOperands.prediction(locker, key);
    420399        node->variableAccessData()->predict(prediction);
     
    423402
    424403    // Used in implementing get/set, above, where the operand is a local variable.
    425     Node* getLocalOrTmp(Operand operand)
     404    Node* getLocal(VirtualRegister operand)
    426405    {
    427         ASSERT(operand.isTmp() || operand.isLocal());
    428         Node*& node = m_currentBlock->variablesAtTail.operand(operand);
     406        unsigned local = operand.toLocal();
     407
     408        Node* node = m_currentBlock->variablesAtTail.local(local);
    429409       
    430410        // This has two goals: 1) link together variable access datas, and 2)
     
    451431       
    452432        node = injectLazyOperandSpeculation(addToGraph(GetLocal, OpInfo(variable)));
     433        m_currentBlock->variablesAtTail.local(local) = node;
    453434        return node;
    454435    }
    455     Node* setLocalOrTmp(const CodeOrigin& semanticOrigin, Operand operand, Node* value, SetMode setMode = NormalSet)
     436    Node* setLocal(const CodeOrigin& semanticOrigin, VirtualRegister operand, Node* value, SetMode setMode = NormalSet)
    456437    {
    457         ASSERT(operand.isTmp() || operand.isLocal());
    458438        SetForScope<CodeOrigin> originChange(m_currentSemanticOrigin, semanticOrigin);
    459439
    460         if (operand.isTmp() && static_cast<unsigned>(operand.value()) >= m_numTmps) {
    461             if (inlineCallFrame())
    462                 dataLogLn(*inlineCallFrame());
    463             dataLogLn("Bad operand: ", operand, " but current number of tmps is: ", m_numTmps, " code block has: ", m_profiledBlock->numTmps(), " tmps.");
    464             CRASH();
    465         }
    466 
    467         if (setMode != ImmediateNakedSet && !operand.isTmp()) {
    468             VirtualRegister reg = operand.virtualRegister();
    469             ArgumentPosition* argumentPosition = findArgumentPositionForLocal(reg);
     440        unsigned local = operand.toLocal();
     441       
     442        if (setMode != ImmediateNakedSet) {
     443            ArgumentPosition* argumentPosition = findArgumentPositionForLocal(operand);
    470444            if (argumentPosition)
    471445                flushDirect(operand, argumentPosition);
    472             else if (m_graph.needsScopeRegister() && reg == m_codeBlock->scopeRegister())
     446            else if (m_graph.needsScopeRegister() && operand == m_codeBlock->scopeRegister())
    473447                flush(operand);
    474448        }
     
    480454            m_inlineStackTop->m_exitProfile.hasExitSite(semanticOrigin.bytecodeIndex(), BadIndexingType));
    481455        Node* node = addToGraph(SetLocal, OpInfo(variableAccessData), value);
    482         m_currentBlock->variablesAtTail.operand(operand) = node;
     456        m_currentBlock->variablesAtTail.local(local) = node;
    483457        return node;
    484458    }
     
    512486        return node;
    513487    }
    514     Node* setArgument(const CodeOrigin& semanticOrigin, Operand operand, Node* value, SetMode setMode = NormalSet)
     488    Node* setArgument(const CodeOrigin& semanticOrigin, VirtualRegister operand, Node* value, SetMode setMode = NormalSet)
    515489    {
    516490        SetForScope<CodeOrigin> originChange(m_currentSemanticOrigin, semanticOrigin);
    517491
    518         VirtualRegister reg = operand.virtualRegister();
    519         unsigned argument = reg.toArgument();
     492        unsigned argument = operand.toArgument();
    520493        ASSERT(argument < m_numArguments);
    521494       
    522         VariableAccessData* variableAccessData = newVariableAccessData(reg);
     495        VariableAccessData* variableAccessData = newVariableAccessData(operand);
    523496
    524497        // Always flush arguments, except for 'this'. If 'this' is created by us,
     
    526499        if (argument || m_graph.needsFlushedThis()) {
    527500            if (setMode != ImmediateNakedSet)
    528                 flushDirect(reg);
     501                flushDirect(operand);
    529502        }
    530503       
     
    562535            return stack->m_argumentPositions[argument];
    563536        }
    564         return nullptr;
    565     }
    566    
    567     ArgumentPosition* findArgumentPosition(Operand operand)
     537        return 0;
     538    }
     539   
     540    ArgumentPosition* findArgumentPosition(VirtualRegister operand)
    568541    {
    569         if (operand.isTmp())
    570             return nullptr;
    571542        if (operand.isArgument())
    572543            return findArgumentPositionForArgument(operand.toArgument());
    573         return findArgumentPositionForLocal(operand.virtualRegister());
     544        return findArgumentPositionForLocal(operand);
    574545    }
    575546
     
    582553            numArguments = inlineCallFrame->argumentsWithFixup.size();
    583554            if (inlineCallFrame->isClosureCall)
    584                 addFlushDirect(inlineCallFrame, remapOperand(inlineCallFrame, CallFrameSlot::callee));
     555                addFlushDirect(inlineCallFrame, remapOperand(inlineCallFrame, VirtualRegister(CallFrameSlot::callee)));
    585556            if (inlineCallFrame->isVarargs())
    586                 addFlushDirect(inlineCallFrame, remapOperand(inlineCallFrame, CallFrameSlot::argumentCountIncludingThis));
     557                addFlushDirect(inlineCallFrame, remapOperand(inlineCallFrame, VirtualRegister(CallFrameSlot::argumentCountIncludingThis)));
    587558        } else
    588559            numArguments = m_graph.baselineCodeBlockFor(inlineCallFrame)->numParameters();
     
    607578                CodeBlock* codeBlock = m_graph.baselineCodeBlockFor(inlineCallFrame);
    608579                FullBytecodeLiveness& fullLiveness = m_graph.livenessFor(codeBlock);
    609                 // Note: We don't need to handle tmps here because tmps are not required to be flushed to the stack.
    610580                const auto& livenessAtBytecode = fullLiveness.getLiveness(bytecodeIndex, m_graph.appropriateLivenessCalculationPoint(origin, isCallerOrigin));
    611581                for (unsigned local = codeBlock->numCalleeLocals(); local--;) {
     
    617587    }
    618588
    619     void flush(Operand operand)
     589    void flush(VirtualRegister operand)
    620590    {
    621591        flushDirect(m_inlineStackTop->remapOperand(operand));
    622592    }
    623593   
    624     void flushDirect(Operand operand)
     594    void flushDirect(VirtualRegister operand)
    625595    {
    626596        flushDirect(operand, findArgumentPosition(operand));
    627597    }
    628598
    629     void flushDirect(Operand operand, ArgumentPosition* argumentPosition)
     599    void flushDirect(VirtualRegister operand, ArgumentPosition* argumentPosition)
    630600    {
    631601        addFlushOrPhantomLocal<Flush>(operand, argumentPosition);
     
    633603
    634604    template<NodeType nodeType>
    635     void addFlushOrPhantomLocal(Operand operand, ArgumentPosition* argumentPosition)
     605    void addFlushOrPhantomLocal(VirtualRegister operand, ArgumentPosition* argumentPosition)
    636606    {
    637607        ASSERT(!operand.isConstant());
    638608       
    639         Node*& node = m_currentBlock->variablesAtTail.operand(operand);
     609        Node* node = m_currentBlock->variablesAtTail.operand(operand);
    640610       
    641611        VariableAccessData* variable;
     
    647617       
    648618        node = addToGraph(nodeType, OpInfo(variable));
     619        m_currentBlock->variablesAtTail.operand(operand) = node;
    649620        if (argumentPosition)
    650621            argumentPosition->addVariable(variable);
    651622    }
    652623
    653     void phantomLocalDirect(Operand operand)
     624    void phantomLocalDirect(VirtualRegister operand)
    654625    {
    655626        addFlushOrPhantomLocal<PhantomLocal>(operand, findArgumentPosition(operand));
     
    658629    void flush(InlineStackEntry* inlineStackEntry)
    659630    {
    660         auto addFlushDirect = [&] (InlineCallFrame*, Operand operand) { flushDirect(operand); };
     631        auto addFlushDirect = [&] (InlineCallFrame*, VirtualRegister reg) { flushDirect(reg); };
    661632        flushImpl(inlineStackEntry->m_inlineCallFrame, addFlushDirect);
    662633    }
     
    664635    void flushForTerminal()
    665636    {
    666         auto addFlushDirect = [&] (InlineCallFrame*, Operand operand) { flushDirect(operand); };
    667         auto addPhantomLocalDirect = [&] (InlineCallFrame*, Operand operand) { phantomLocalDirect(operand); };
     637        auto addFlushDirect = [&] (InlineCallFrame*, VirtualRegister reg) { flushDirect(reg); };
     638        auto addPhantomLocalDirect = [&] (InlineCallFrame*, VirtualRegister reg) { phantomLocalDirect(reg); };
    668639        flushForTerminalImpl(currentCodeOrigin(), addFlushDirect, addPhantomLocalDirect);
    669640    }
     
    792763            Edge(child1), Edge(child2), Edge(child3));
    793764        return addToGraph(result);
    794     }
    795     Node* addToGraph(NodeType op, Operand operand, Node* child1)
    796     {
    797         ASSERT(op == MovHint);
    798         return addToGraph(op, OpInfo(operand.kind()), OpInfo(operand.value()), child1);
    799765    }
    800766    Node* addToGraph(NodeType op, OpInfo info1, OpInfo info2, Edge child1, Edge child2 = Edge(), Edge child3 = Edge())
     
    11281094    // The number of arguments passed to the function.
    11291095    unsigned m_numArguments;
    1130     // The number of locals (vars + temporaries) used by the bytecode for the function.
     1096    // The number of locals (vars + temporaries) used in the function.
    11311097    unsigned m_numLocals;
    1132     // The max number of temps used for forwarding data to an OSR exit checkpoint.
    1133     unsigned m_numTmps;
    11341098    // The number of slots (in units of sizeof(Register)) that we need to
    11351099    // preallocate for arguments to outgoing calls from this frame. This
     
    11981162        ~InlineStackEntry();
    11991163       
    1200         Operand remapOperand(Operand operand) const
     1164        VirtualRegister remapOperand(VirtualRegister operand) const
    12011165        {
    12021166            if (!m_inlineCallFrame)
    12031167                return operand;
    1204 
    1205             if (operand.isTmp())
    1206                 return Operand::tmp(operand.value() + m_inlineCallFrame->tmpOffset);
    12071168           
    1208             ASSERT(!operand.virtualRegister().isConstant());
    1209 
    1210             return operand.virtualRegister() + m_inlineCallFrame->stackOffset;
     1169            ASSERT(!operand.isConstant());
     1170
     1171            return VirtualRegister(operand.offset() + m_inlineCallFrame->stackOffset);
    12111172        }
    12121173    };
     
    12171178   
    12181179    struct DelayedSetLocal {
     1180        CodeOrigin m_origin;
     1181        VirtualRegister m_operand;
     1182        Node* m_value;
     1183        SetMode m_setMode;
     1184       
    12191185        DelayedSetLocal() { }
    1220         DelayedSetLocal(const CodeOrigin& origin, Operand operand, Node* value, SetMode setMode)
     1186        DelayedSetLocal(const CodeOrigin& origin, VirtualRegister operand, Node* value, SetMode setMode)
    12211187            : m_origin(origin)
    12221188            , m_operand(operand)
     
    12311197            if (m_operand.isArgument())
    12321198                return parser->setArgument(m_origin, m_operand, m_value, m_setMode);
    1233             return parser->setLocalOrTmp(m_origin, m_operand, m_value, m_setMode);
    1234         }
    1235 
    1236         CodeOrigin m_origin;
    1237         Operand m_operand;
    1238         Node* m_value { nullptr };
    1239         SetMode m_setMode;
     1199            return parser->setLocal(m_origin, m_operand, m_value, m_setMode);
     1200        }
    12401201    };
    12411202   
     
    12501211{
    12511212    ASSERT(bytecodeIndex);
    1252     Ref<BasicBlock> block = adoptRef(*new BasicBlock(bytecodeIndex, m_numArguments, m_numLocals, m_numTmps, 1));
     1213    Ref<BasicBlock> block = adoptRef(*new BasicBlock(bytecodeIndex, m_numArguments, m_numLocals, 1));
    12531214    BasicBlock* blockPtr = block.ptr();
    12541215    // m_blockLinkingTargets must always be sorted in increasing order of bytecodeBegin
     
    12621223BasicBlock* ByteCodeParser::allocateUntargetableBlock()
    12631224{
    1264     Ref<BasicBlock> block = adoptRef(*new BasicBlock(BytecodeIndex(), m_numArguments, m_numLocals, m_numTmps, 1));
     1225    Ref<BasicBlock> block = adoptRef(*new BasicBlock(BytecodeIndex(), m_numArguments, m_numLocals, 1));
    12651226    BasicBlock* blockPtr = block.ptr();
    12661227    m_graph.appendBlock(WTFMove(block));
     
    14651426                continue;
    14661427            // If the target InlineCallFrame is Varargs, we do not know how many arguments are actually filled by LoadVarargs. Varargs InlineCallFrame's
    1467             // argumentCountIncludingThis is maximum number of potentially filled arguments by xkLoadVarargs. We "continue" to the upper frame which may be
     1428            // argumentCountIncludingThis is maximum number of potentially filled arguments by LoadVarargs. We "continue" to the upper frame which may be
    14681429            // a good target to jump into.
    14691430            if (callFrame->isVarargs())
     
    14911452        if (stackEntry->m_inlineCallFrame) {
    14921453            if (stackEntry->m_inlineCallFrame->isClosureCall)
    1493                 setDirect(remapOperand(stackEntry->m_inlineCallFrame, CallFrameSlot::callee), callTargetNode, NormalSet);
     1454                setDirect(stackEntry->remapOperand(VirtualRegister(CallFrameSlot::callee)), callTargetNode, NormalSet);
    14941455        } else
    14951456            addToGraph(SetCallee, callTargetNode);
     
    16561617    int registerOffsetAfterFixup = registerOffset - numberOfStackPaddingSlots;
    16571618   
    1658     Operand inlineCallFrameStart = VirtualRegister(m_inlineStackTop->remapOperand(VirtualRegister(registerOffsetAfterFixup)).value() + CallFrame::headerSizeInRegisters);
     1619    int inlineCallFrameStart = m_inlineStackTop->remapOperand(VirtualRegister(registerOffsetAfterFixup)).offset() + CallFrame::headerSizeInRegisters;
    16591620   
    16601621    ensureLocals(
    1661         inlineCallFrameStart.toLocal() + 1 +
     1622        VirtualRegister(inlineCallFrameStart).toLocal() + 1 +
    16621623        CallFrame::headerSizeInRegisters + codeBlock->numCalleeLocals());
    16631624   
    1664     ensureTmps((m_inlineStackTop->m_inlineCallFrame ? m_inlineStackTop->m_inlineCallFrame->tmpOffset : 0) + m_inlineStackTop->m_codeBlock->numTmps() + codeBlock->numTmps());
    1665 
    16661625    size_t argumentPositionStart = m_graph.m_argumentPositions.size();
    16671626
    16681627    if (result.isValid())
    1669         result = m_inlineStackTop->remapOperand(result).virtualRegister();
     1628        result = m_inlineStackTop->remapOperand(result);
    16701629
    16711630    VariableAccessData* calleeVariable = nullptr;
     
    16801639    InlineStackEntry* callerStackTop = m_inlineStackTop;
    16811640    InlineStackEntry inlineStackEntry(this, codeBlock, codeBlock, callee.function(), result,
    1682         inlineCallFrameStart.virtualRegister(), argumentCountIncludingThis, kind, continuationBlock);
     1641        (VirtualRegister)inlineCallFrameStart, argumentCountIncludingThis, kind, continuationBlock);
    16831642
    16841643    // This is where the actual inlining really happens.
     
    17151674        // callee make it so that if we exit at <HERE>, we can recover loc9 and loc10.
    17161675        for (int index = 0; index < argumentCountIncludingThis; ++index) {
    1717             Operand argumentToGet = callerStackTop->remapOperand(virtualRegisterForArgument(index, registerOffset));
     1676            VirtualRegister argumentToGet = callerStackTop->remapOperand(virtualRegisterForArgument(index, registerOffset));
    17181677            Node* value = getDirect(argumentToGet);
    1719             addToGraph(MovHint, OpInfo(argumentToGet), value);
     1678            addToGraph(MovHint, OpInfo(argumentToGet.offset()), value);
    17201679            m_setLocalQueue.append(DelayedSetLocal { currentCodeOrigin(), argumentToGet, value, ImmediateNakedSet });
    17211680        }
     
    17611720        if (registerOffsetAfterFixup != registerOffset) {
    17621721            for (int index = 0; index < argumentCountIncludingThis; ++index) {
    1763                 Operand argumentToGet = callerStackTop->remapOperand(virtualRegisterForArgument(index, registerOffset));
     1722                VirtualRegister argumentToGet = callerStackTop->remapOperand(virtualRegisterForArgument(index, registerOffset));
    17641723                Node* value = getDirect(argumentToGet);
    1765                 Operand argumentToSet = m_inlineStackTop->remapOperand(virtualRegisterForArgument(index));
    1766                 addToGraph(MovHint, OpInfo(argumentToSet), value);
     1724                VirtualRegister argumentToSet = m_inlineStackTop->remapOperand(virtualRegisterForArgument(index));
     1725                addToGraph(MovHint, OpInfo(argumentToSet.offset()), value);
    17671726                m_setLocalQueue.append(DelayedSetLocal { currentCodeOrigin(), argumentToSet, value, ImmediateNakedSet });
    17681727            }
    17691728        }
    17701729        for (int index = 0; index < arityFixupCount; ++index) {
    1771             Operand argumentToSet = m_inlineStackTop->remapOperand(virtualRegisterForArgument(argumentCountIncludingThis + index));
    1772             addToGraph(MovHint, OpInfo(argumentToSet), undefined);
     1730            VirtualRegister argumentToSet = m_inlineStackTop->remapOperand(virtualRegisterForArgument(argumentCountIncludingThis + index));
     1731            addToGraph(MovHint, OpInfo(argumentToSet.offset()), undefined);
    17731732            m_setLocalQueue.append(DelayedSetLocal { currentCodeOrigin(), argumentToSet, undefined, ImmediateNakedSet });
    17741733        }
     
    19371896       
    19381897        int remappedRegisterOffset =
    1939         m_inlineStackTop->remapOperand(VirtualRegister(registerOffset)).virtualRegister().offset();
     1898        m_inlineStackTop->remapOperand(VirtualRegister(registerOffset)).offset();
    19401899       
    19411900        ensureLocals(VirtualRegister(remappedRegisterOffset).toLocal());
    19421901       
    19431902        int argumentStart = registerOffset + CallFrame::headerSizeInRegisters;
    1944         int remappedArgumentStart = m_inlineStackTop->remapOperand(VirtualRegister(argumentStart)).virtualRegister().offset();
     1903        int remappedArgumentStart = m_inlineStackTop->remapOperand(VirtualRegister(argumentStart)).offset();
    19451904       
    19461905        LoadVarargsData* data = m_graph.m_loadVarargsData.add();
     
    19501909        data->limit = maxArgumentCountIncludingThis;
    19511910        data->mandatoryMinimum = mandatoryMinimum;
    1952 
    1953         if (callOp == TailCallForwardVarargs) {
    1954             Node* argumentCount;
    1955             if (!inlineCallFrame())
    1956                 argumentCount = addToGraph(GetArgumentCountIncludingThis);
    1957             else if (inlineCallFrame()->isVarargs())
    1958                 argumentCount = getDirect(remapOperand(inlineCallFrame(), CallFrameSlot::argumentCountIncludingThis));
    1959             else
    1960                 argumentCount = addToGraph(JSConstant, OpInfo(m_graph.freeze(jsNumber(inlineCallFrame()->argumentCountIncludingThis))));
    1961             addToGraph(ForwardVarargs, OpInfo(data), argumentCount);
    1962         } else {
    1963             Node* arguments = get(argumentsArgument);
    1964             auto argCountTmp = m_inlineStackTop->remapOperand(Operand::tmp(OpCallVarargs::argCountIncludingThis));
    1965             setDirect(argCountTmp, addToGraph(VarargsLength, OpInfo(data), arguments));
    1966             progressToNextCheckpoint();
    1967 
    1968             addToGraph(LoadVarargs, OpInfo(data), getLocalOrTmp(argCountTmp), arguments);
    1969         }
     1911       
     1912        if (callOp == TailCallForwardVarargs)
     1913            addToGraph(ForwardVarargs, OpInfo(data));
     1914        else
     1915            addToGraph(LoadVarargs, OpInfo(data), get(argumentsArgument));
    19701916       
    19711917        // LoadVarargs may OSR exit. Hence, we need to keep alive callTargetNode, thisArgument
     
    19791925        // before SSA.
    19801926       
    1981         VariableAccessData* countVariable = newVariableAccessData(data->count);
     1927        VariableAccessData* countVariable = newVariableAccessData(VirtualRegister(remappedRegisterOffset + CallFrameSlot::argumentCountIncludingThis));
    19821928        // This is pretty lame, but it will force the count to be flushed as an int. This doesn't
    19831929        // matter very much, since our use of a SetArgumentDefinitely and Flushes for this local slot is
     
    19861932        countVariable->mergeIsProfitableToUnbox(true);
    19871933        Node* setArgumentCount = addToGraph(SetArgumentDefinitely, OpInfo(countVariable));
    1988         m_currentBlock->variablesAtTail.setOperand(countVariable->operand(), setArgumentCount);
     1934        m_currentBlock->variablesAtTail.setOperand(countVariable->local(), setArgumentCount);
    19891935       
    19901936        set(VirtualRegister(argumentStart), get(thisArgument), ImmediateNakedSet);
     
    20101956           
    20111957            Node* setArgument = addToGraph(numSetArguments >= mandatoryMinimum ? SetArgumentMaybe : SetArgumentDefinitely, OpInfo(variable));
    2012             m_currentBlock->variablesAtTail.setOperand(variable->operand(), setArgument);
     1958            m_currentBlock->variablesAtTail.setOperand(variable->local(), setArgument);
    20131959            ++numSetArguments;
    20141960        }
     
    21102056    VERBOSE_LOG("Register offset: ", registerOffset);
    21112057    VirtualRegister calleeReg(registerOffset + CallFrameSlot::callee);
    2112     calleeReg = m_inlineStackTop->remapOperand(calleeReg).virtualRegister();
     2058    calleeReg = m_inlineStackTop->remapOperand(calleeReg);
    21132059    VERBOSE_LOG("Callee is going to be ", calleeReg, "\n");
    21142060    setDirect(calleeReg, callTargetNode, ImmediateSetWithFlush);
     
    52135159            auto bytecode = currentInstruction->as<OpNewRegexp>();
    52145160            ASSERT(bytecode.m_regexp.isConstant());
    5215             FrozenValue* frozenRegExp = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_regexp));
     5161            FrozenValue* frozenRegExp = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_regexp.offset()));
    52165162            set(bytecode.m_dst, addToGraph(NewRegexp, OpInfo(frozenRegExp), jsConstant(jsNumber(0))));
    52175163            NEXT_OPCODE(op_new_regexp);
     
    62946240            RELEASE_ASSERT(!m_currentBlock->size() || (m_graph.compilation() && m_currentBlock->size() == 1 && m_currentBlock->at(0)->op() == CountExecution));
    62956241
    6296             ValueProfileAndVirtualRegisterBuffer* buffer = bytecode.metadata(codeBlock).m_buffer;
     6242            ValueProfileAndOperandBuffer* buffer = bytecode.metadata(codeBlock).m_buffer;
    62976243
    62986244            if (!buffer) {
     
    63116257                ConcurrentJSLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
    63126258
    6313                 buffer->forEach([&] (ValueProfileAndVirtualRegister& profile) {
     6259                buffer->forEach([&] (ValueProfileAndOperand& profile) {
    63146260                    VirtualRegister operand(profile.m_operand);
    63156261                    SpeculatedType prediction = profile.computeUpdatedPrediction(locker);
     
    63396285
    63406286            unsigned numberOfLocals = 0;
    6341             buffer->forEach([&] (ValueProfileAndVirtualRegister& profile) {
     6287            buffer->forEach([&] (ValueProfileAndOperand& profile) {
    63426288                VirtualRegister operand(profile.m_operand);
    63436289                if (operand.isArgument())
     
    63466292                Node* value = addToGraph(ExtractCatchLocal, OpInfo(numberOfLocals), OpInfo(localPredictions[numberOfLocals]));
    63476293                ++numberOfLocals;
    6348                 addToGraph(MovHint, OpInfo(operand), value);
     6294                addToGraph(MovHint, OpInfo(profile.m_operand), value);
    63496295                localsToSet.uncheckedAppend(std::make_pair(operand, value));
    63506296            });
     
    64746420        case op_jneq_ptr: {
    64756421            auto bytecode = currentInstruction->as<OpJneqPtr>();
    6476             FrozenValue* frozenPointer = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_specialPointer));
     6422            FrozenValue* frozenPointer = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_specialPointer.offset()));
    64776423            unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
    64786424            Node* child = get(bytecode.m_value);
     
    69426888            auto bytecode = currentInstruction->as<OpCreateLexicalEnvironment>();
    69436889            ASSERT(bytecode.m_symbolTable.isConstant() && bytecode.m_initialValue.isConstant());
    6944             FrozenValue* symbolTable = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_symbolTable));
    6945             FrozenValue* initialValue = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_initialValue));
     6890            FrozenValue* symbolTable = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_symbolTable.offset()));
     6891            FrozenValue* initialValue = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_initialValue.offset()));
    69466892            Node* scope = get(bytecode.m_scope);
    69476893            Node* lexicalEnvironment = addToGraph(CreateActivation, OpInfo(symbolTable), OpInfo(initialValue), scope);
     
    69736919            // bytecode-level liveness of the scope register.
    69746920            auto bytecode = currentInstruction->as<OpGetScope>();
    6975             Node* callee = get(CallFrameSlot::callee);
     6921            Node* callee = get(VirtualRegister(CallFrameSlot::callee));
    69766922            Node* result;
    69776923            if (JSFunction* function = callee->dynamicCastConstant<JSFunction*>(*m_vm))
     
    73987344        // plan finishes.
    73997345        m_inlineCallFrame->baselineCodeBlock.setWithoutWriteBarrier(codeBlock->baselineVersion());
    7400         m_inlineCallFrame->setTmpOffset((m_caller->m_inlineCallFrame ? m_caller->m_inlineCallFrame->tmpOffset : 0) + m_caller->m_codeBlock->numTmps());
    74017346        m_inlineCallFrame->setStackOffset(inlineCallFrameStart.offset() - CallFrame::headerSizeInRegisters);
    74027347        m_inlineCallFrame->argumentCountIncludingThis = argumentCountIncludingThis;
    7403         RELEASE_ASSERT(m_inlineCallFrame->argumentCountIncludingThis == argumentCountIncludingThis);
    74047348        if (callee) {
    74057349            m_inlineCallFrame->calleeRecovery = ValueRecovery::constant(callee);
     
    77637707
    77647708                    if (node->hasVariableAccessData(m_graph))
    7765                         mapping.operand(node->operand()) = node->variableAccessData();
     7709                        mapping.operand(node->local()) = node->variableAccessData();
    77667710
    77677711                    if (node->op() != ForceOSRExit)
     
    77837727                    }
    77847728
    7785                     auto insertLivenessPreservingOp = [&] (InlineCallFrame* inlineCallFrame, NodeType op, Operand operand) {
     7729                    auto insertLivenessPreservingOp = [&] (InlineCallFrame* inlineCallFrame, NodeType op, VirtualRegister operand) {
    77867730                        VariableAccessData* variable = mapping.operand(operand);
    77877731                        if (!variable) {
     
    77907734                        }
    77917735
    7792                         Operand argument = unmapOperand(inlineCallFrame, operand);
     7736                        VirtualRegister argument = operand - (inlineCallFrame ? inlineCallFrame->stackOffset : 0);
    77937737                        if (argument.isArgument() && !argument.isHeader()) {
    77947738                            const Vector<ArgumentPosition*>& arguments = m_inlineCallFrameToArgumentPositions.get(inlineCallFrame);
     
    77977741                        insertionSet.insertNode(nodeIndex, SpecNone, op, origin, OpInfo(variable));
    77987742                    };
    7799                     auto addFlushDirect = [&] (InlineCallFrame* inlineCallFrame, Operand operand) {
     7743                    auto addFlushDirect = [&] (InlineCallFrame* inlineCallFrame, VirtualRegister operand) {
    78007744                        insertLivenessPreservingOp(inlineCallFrame, Flush, operand);
    78017745                    };
    7802                     auto addPhantomLocalDirect = [&] (InlineCallFrame* inlineCallFrame, Operand operand) {
     7746                    auto addPhantomLocalDirect = [&] (InlineCallFrame* inlineCallFrame, VirtualRegister operand) {
    78037747                        insertLivenessPreservingOp(inlineCallFrame, PhantomLocal, operand);
    78047748                    };
     
    78657809    }
    78667810
    7867     m_graph.m_tmps = m_numTmps;
    78687811    m_graph.m_localVars = m_numLocals;
    78697812    m_graph.m_parameterSlots = m_parameterSlots;
Note: See TracChangeset for help on using the changeset viewer.