Ignore:
Timestamp:
Oct 17, 2011, 4:54:41 PM (14 years ago)
Author:
[email protected]
Message:

DFG bytecode parser should understand inline stacks
https://bugs.webkit.org/show_bug.cgi?id=70278

Reviewed by Oliver Hunt.

The DFG bytecode parser is now capable of parsing multiple code blocks at
once. This remains turned off since not all inlining functionality is
implemented.

This required making a few changes elsewhere in the system. The bytecode
parser now may do some of the same things that the bytecode generator does,
like allocating constants and identifiers. Basic block linking relies on
bytecode indices, which are only meaningful within the context of one basic
block. This is fine, so long as linking is done eagerly whenever switching
from one code block to another.

  • bytecode/CodeOrigin.h:

(JSC::CodeOrigin::CodeOrigin):

  • bytecompiler/BytecodeGenerator.h:
  • dfg/DFGBasicBlock.h:
  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::ByteCodeParser):
(JSC::DFG::ByteCodeParser::get):
(JSC::DFG::ByteCodeParser::set):
(JSC::DFG::ByteCodeParser::getThis):
(JSC::DFG::ByteCodeParser::setThis):
(JSC::DFG::ByteCodeParser::currentCodeOrigin):
(JSC::DFG::ByteCodeParser::getPrediction):
(JSC::DFG::ByteCodeParser::makeSafe):
(JSC::DFG::ByteCodeParser::makeDivSafe):
(JSC::DFG::ByteCodeParser::InlineStackEntry::executable):
(JSC::DFG::ByteCodeParser::InlineStackEntry::~InlineStackEntry):
(JSC::DFG::ByteCodeParser::InlineStackEntry::remapOperand):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::linkBlock):
(JSC::DFG::ByteCodeParser::linkBlocks):
(JSC::DFG::ByteCodeParser::setupPredecessors):
(JSC::DFG::ByteCodeParser::buildOperandMapsIfNecessary):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
(JSC::DFG::ByteCodeParser::parseCodeBlock):
(JSC::DFG::ByteCodeParser::parse):

  • dfg/DFGGraph.h:

(JSC::DFG::GetBytecodeBeginForBlock::GetBytecodeBeginForBlock):
(JSC::DFG::GetBytecodeBeginForBlock::operator()):
(JSC::DFG::Graph::blockIndexForBytecodeOffset):

  • dfg/DFGNode.h:
  • runtime/Identifier.h:

(JSC::IdentifierMapIndexHashTraits::emptyValue):

  • runtime/JSValue.h:
  • wtf/StdLibExtras.h:

(WTF::binarySearchWithFunctor):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeOrigin.h

    r97512 r97675  
    5050    }
    5151   
     52    explicit CodeOrigin(uint32_t bytecodeIndex, InlineCallFrame* inlineCallFrame)
     53        : bytecodeIndex(bytecodeIndex)
     54        , inlineCallFrame(inlineCallFrame)
     55    {
     56    }
     57   
    5258    bool isSet() const { return bytecodeIndex != std::numeric_limits<uint32_t>::max(); }
    5359};
Note: See TracChangeset for help on using the changeset viewer.