Ignore:
Timestamp:
Aug 31, 2013, 7:02:47 PM (12 years ago)
Author:
[email protected]
Message:

CodeBlock refactoring broke profile dumping
https://bugs.webkit.org/show_bug.cgi?id=120551

Reviewed by Michael Saboff.

Fix the bug, and did a big clean-up of how Executable returns CodeBlocks. A lot
of the problems we have with code like CodeBlock::baselineVersion() is that we
were trying *way too hard* to side-step the fact that Executable can't return a
CodeBlock*. Previously it could only return CodeBlock&, so if it didn't have a
CodeBlock yet, you were screwed. And if you didn't know, or weren't sure, if it
did have a CodeBlock, you were really going to have a bad time. Also it really
bugs me that the methods were called generatedBytecode(). In all other contexts
if you ask for a CodeBlock, then method to call is codeBlock(). So I made all
of those changes.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::baselineVersion):
(JSC::ProgramCodeBlock::replacement):
(JSC::EvalCodeBlock::replacement):
(JSC::FunctionCodeBlock::replacement):
(JSC::CodeBlock::globalObjectFor):

  • bytecode/CodeOrigin.cpp:

(JSC::InlineCallFrame::hash):

  • dfg/DFGOperations.cpp:
  • interpreter/Interpreter.cpp:

(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):

  • jit/JITCode.h:

(JSC::JITCode::isExecutableScript):
(JSC::JITCode::isLowerTier):

  • jit/JITStubs.cpp:

(JSC::lazyLinkFor):
(JSC::DEFINE_STUB_FUNCTION):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::traceFunctionPrologue):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::setUpCall):

  • runtime/ArrayPrototype.cpp:

(JSC::isNumericCompareFunction):

  • runtime/CommonSlowPaths.h:

(JSC::CommonSlowPaths::arityCheckFor):

  • runtime/Executable.cpp:

(JSC::ScriptExecutable::installCode):

  • runtime/Executable.h:

(JSC::EvalExecutable::codeBlock):
(JSC::ProgramExecutable::codeBlock):
(JSC::FunctionExecutable::eitherCodeBlock):
(JSC::FunctionExecutable::codeBlockForCall):
(JSC::FunctionExecutable::codeBlockForConstruct):
(JSC::FunctionExecutable::codeBlockFor):

  • runtime/FunctionExecutableDump.cpp:

(JSC::FunctionExecutableDump::dump):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITCode.h

    r153319 r154935  
    8181    }
    8282   
     83    static bool isExecutableScript(JITType jitType)
     84    {
     85        switch (jitType) {
     86        case None:
     87        case HostCallThunk:
     88            return false;
     89        default:
     90            return true;
     91        }
     92    }
     93   
    8394    static bool couldBeInterpreted(JITType jitType)
    8495    {
     
    106117    static bool isLowerTier(JITType expectedLower, JITType expectedHigher)
    107118    {
    108         RELEASE_ASSERT(isJIT(expectedLower));
    109         RELEASE_ASSERT(isJIT(expectedHigher));
     119        RELEASE_ASSERT(isExecutableScript(expectedLower));
     120        RELEASE_ASSERT(isExecutableScript(expectedHigher));
    110121        return expectedLower < expectedHigher;
    111122    }
Note: See TracChangeset for help on using the changeset viewer.