CodeBlock refactoring broke profile dumping
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Sep 2013 02:02:47 +0000 (02:02 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Sep 2013 02:02:47 +0000 (02:02 +0000)
commitc70fb3287a394dabb7db365c6d71fb14dcba3bf7
tree716ee70ee79454ba534ec3c90d00283eb25b200b
parent42b7533199cb14a609e4c080d377bc144cec0029
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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/CodeOrigin.cpp
Source/JavaScriptCore/dfg/DFGOperations.cpp
Source/JavaScriptCore/interpreter/Interpreter.cpp
Source/JavaScriptCore/jit/JITCode.h
Source/JavaScriptCore/jit/JITStubs.cpp
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
Source/JavaScriptCore/runtime/ArrayPrototype.cpp
Source/JavaScriptCore/runtime/CommonSlowPaths.h
Source/JavaScriptCore/runtime/Executable.cpp
Source/JavaScriptCore/runtime/Executable.h
Source/JavaScriptCore/runtime/FunctionExecutableDump.cpp