The code to link FunctionExecutable is duplicated everywhere
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 Mar 2015 22:10:10 +0000 (22:10 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 Mar 2015 22:10:10 +0000 (22:10 +0000)
commitaf76b904d1c60206256dc7046bf49c90753e7c92
tree67549487c12a38d8a30066c5a7e4c855eecc5589
parenta1e7ed6d03b2371adf6048eeaf0df57f2c852e2d
The code to link FunctionExecutable is duplicated everywhere
https://bugs.webkit.org/show_bug.cgi?id=142436

Reviewed by Darin Adler.

Reduced code duplication by factoring out linkInsideExecutable and linkGlobalCode.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock): Calls linkInsideExecutable.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedFunctionExecutable::linkInsideExecutable): Renamed from link. Now takes care of startOffset.
This change was needed to use this function in CodeBlock::CodeBlock. Also, this function no longer takes
lineOffset since this information is already stored in the source code.
(JSC::UnlinkedFunctionExecutable::linkGlobalCode): Extracted from FunctionExecutable::fromGlobalCode.

* bytecode/UnlinkedCodeBlock.h:

* generate-js-builtins: Calls linkGlobalCode.

* runtime/Executable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties): Calls linkGlobalCode.
(JSC::FunctionExecutable::fromGlobalCode): Calls linkGlobalCode.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
Source/JavaScriptCore/generate-js-builtins
Source/JavaScriptCore/runtime/Executable.cpp