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/interpreter/Interpreter.cpp

    r154824 r154935  
    738738        return checkedReturn(callFrame->vm().throwException(callFrame, error));
    739739
    740     ProgramCodeBlock* codeBlock = &program->generatedBytecode();
     740    ProgramCodeBlock* codeBlock = program->codeBlock();
    741741
    742742    if (UNLIKELY(vm.watchdog.didFire(callFrame)))
     
    808808            return checkedReturn(callFrame->vm().throwException(callFrame, compileError));
    809809        }
    810         newCodeBlock = &callData.js.functionExecutable->generatedBytecodeForCall();
     810        newCodeBlock = callData.js.functionExecutable->codeBlockForCall();
    811811        ASSERT(!!newCodeBlock);
    812812        newCodeBlock->m_shouldAlwaysBeInlined = false;
     
    887887            return checkedReturn(callFrame->vm().throwException(callFrame, compileError));
    888888        }
    889         newCodeBlock = &constructData.js.functionExecutable->generatedBytecodeForConstruct();
     889        newCodeBlock = constructData.js.functionExecutable->codeBlockForConstruct();
    890890        ASSERT(!!newCodeBlock);
    891891        newCodeBlock->m_shouldAlwaysBeInlined = false;
     
    962962        return CallFrameClosure();
    963963    }
    964     CodeBlock* newCodeBlock = &functionExecutable->generatedBytecodeForCall();
     964    CodeBlock* newCodeBlock = functionExecutable->codeBlockForCall();
    965965    newCodeBlock->m_shouldAlwaysBeInlined = false;
    966966
     
    10761076    if (UNLIKELY(!!compileError))
    10771077        return checkedReturn(callFrame->vm().throwException(callFrame, compileError));
    1078     EvalCodeBlock* codeBlock = &eval->generatedBytecode();
     1078    EvalCodeBlock* codeBlock = eval->codeBlock();
    10791079
    10801080    if (numVariables || numFunctions) {
Note: See TracChangeset for help on using the changeset viewer.