Title: [188242] trunk/Source/_javascript_Core
Revision
188242
Author
gga...@apple.com
Date
2015-08-10 18:26:30 -0700 (Mon, 10 Aug 2015)

Log Message

Start beating UnlinkedCodeBlock.h/.cpp with the "One Class per File" stick
https://bugs.webkit.org/show_bug.cgi?id=147856

Reviewed by Saam Barati.

Split out UnlinkedFunctionExecutable.h/.cpp and ExecutableInfo.h into separate files.

* CMakeLists.txt:
* _javascript_Core.vcxproj/_javascript_Core.vcxproj:
* _javascript_Core.vcxproj/_javascript_Core.vcxproj.filters:
* _javascript_Core.xcodeproj/project.pbxproj:
* bytecode/ExecutableInfo.h: Copied from Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h.
(JSC::ExecutableInfo::ExecutableInfo):
(JSC::UnlinkedStringJumpTable::offsetForValue): Deleted.
(JSC::UnlinkedSimpleJumpTable::add): Deleted.
(JSC::UnlinkedInstruction::UnlinkedInstruction): Deleted.
(JSC::UnlinkedCodeBlock::isConstructor): Deleted.
(JSC::UnlinkedCodeBlock::isStrictMode): Deleted.
(JSC::UnlinkedCodeBlock::usesEval): Deleted.
(JSC::UnlinkedCodeBlock::needsFullScopeChain): Deleted.
(JSC::UnlinkedCodeBlock::hasExpressionInfo): Deleted.
(JSC::UnlinkedCodeBlock::setThisRegister): Deleted.
(JSC::UnlinkedCodeBlock::setScopeRegister): Deleted.
(JSC::UnlinkedCodeBlock::setActivationRegister): Deleted.
(JSC::UnlinkedCodeBlock::usesGlobalObject): Deleted.
(JSC::UnlinkedCodeBlock::setGlobalObjectRegister): Deleted.
(JSC::UnlinkedCodeBlock::globalObjectRegister): Deleted.
(JSC::UnlinkedCodeBlock::setNumParameters): Deleted.
(JSC::UnlinkedCodeBlock::addParameter): Deleted.
(JSC::UnlinkedCodeBlock::numParameters): Deleted.
(JSC::UnlinkedCodeBlock::addRegExp): Deleted.
(JSC::UnlinkedCodeBlock::numberOfRegExps): Deleted.
(JSC::UnlinkedCodeBlock::regexp): Deleted.
(JSC::UnlinkedCodeBlock::numberOfIdentifiers): Deleted.
(JSC::UnlinkedCodeBlock::addIdentifier): Deleted.
(JSC::UnlinkedCodeBlock::identifier): Deleted.
(JSC::UnlinkedCodeBlock::identifiers): Deleted.
(JSC::UnlinkedCodeBlock::addConstant): Deleted.
(JSC::UnlinkedCodeBlock::registerIndexForLinkTimeConstant): Deleted.
(JSC::UnlinkedCodeBlock::constantRegisters): Deleted.
(JSC::UnlinkedCodeBlock::constantRegister): Deleted.
(JSC::UnlinkedCodeBlock::isConstantRegisterIndex): Deleted.
(JSC::UnlinkedCodeBlock::constantsSourceCodeRepresentation): Deleted.
(JSC::UnlinkedCodeBlock::numberOfJumpTargets): Deleted.
(JSC::UnlinkedCodeBlock::addJumpTarget): Deleted.
(JSC::UnlinkedCodeBlock::jumpTarget): Deleted.
(JSC::UnlinkedCodeBlock::lastJumpTarget): Deleted.
(JSC::UnlinkedCodeBlock::isBuiltinFunction): Deleted.
(JSC::UnlinkedCodeBlock::constructorKind): Deleted.
(JSC::UnlinkedCodeBlock::shrinkToFit): Deleted.
(JSC::UnlinkedCodeBlock::numberOfSwitchJumpTables): Deleted.
(JSC::UnlinkedCodeBlock::addSwitchJumpTable): Deleted.
(JSC::UnlinkedCodeBlock::switchJumpTable): Deleted.
(JSC::UnlinkedCodeBlock::numberOfStringSwitchJumpTables): Deleted.
(JSC::UnlinkedCodeBlock::addStringSwitchJumpTable): Deleted.
(JSC::UnlinkedCodeBlock::stringSwitchJumpTable): Deleted.
(JSC::UnlinkedCodeBlock::addFunctionDecl): Deleted.
(JSC::UnlinkedCodeBlock::functionDecl): Deleted.
(JSC::UnlinkedCodeBlock::numberOfFunctionDecls): Deleted.
(JSC::UnlinkedCodeBlock::addFunctionExpr): Deleted.
(JSC::UnlinkedCodeBlock::functionExpr): Deleted.
(JSC::UnlinkedCodeBlock::numberOfFunctionExprs): Deleted.
(JSC::UnlinkedCodeBlock::numberOfExceptionHandlers): Deleted.
(JSC::UnlinkedCodeBlock::addExceptionHandler): Deleted.
(JSC::UnlinkedCodeBlock::exceptionHandler): Deleted.
(JSC::UnlinkedCodeBlock::vm): Deleted.
(JSC::UnlinkedCodeBlock::addArrayProfile): Deleted.
(JSC::UnlinkedCodeBlock::numberOfArrayProfiles): Deleted.
(JSC::UnlinkedCodeBlock::addArrayAllocationProfile): Deleted.
(JSC::UnlinkedCodeBlock::numberOfArrayAllocationProfiles): Deleted.
(JSC::UnlinkedCodeBlock::addObjectAllocationProfile): Deleted.
(JSC::UnlinkedCodeBlock::numberOfObjectAllocationProfiles): Deleted.
(JSC::UnlinkedCodeBlock::addValueProfile): Deleted.
(JSC::UnlinkedCodeBlock::numberOfValueProfiles): Deleted.
(JSC::UnlinkedCodeBlock::addLLIntCallLinkInfo): Deleted.
(JSC::UnlinkedCodeBlock::numberOfLLintCallLinkInfos): Deleted.
(JSC::UnlinkedCodeBlock::codeType): Deleted.
(JSC::UnlinkedCodeBlock::thisRegister): Deleted.
(JSC::UnlinkedCodeBlock::scopeRegister): Deleted.
(JSC::UnlinkedCodeBlock::activationRegister): Deleted.
(JSC::UnlinkedCodeBlock::hasActivationRegister): Deleted.
(JSC::UnlinkedCodeBlock::addPropertyAccessInstruction): Deleted.
(JSC::UnlinkedCodeBlock::numberOfPropertyAccessInstructions): Deleted.
(JSC::UnlinkedCodeBlock::propertyAccessInstructions): Deleted.
(JSC::UnlinkedCodeBlock::constantBufferCount): Deleted.
(JSC::UnlinkedCodeBlock::addConstantBuffer): Deleted.
(JSC::UnlinkedCodeBlock::constantBuffer): Deleted.
(JSC::UnlinkedCodeBlock::hasRareData): Deleted.
(JSC::UnlinkedCodeBlock::recordParse): Deleted.
(JSC::UnlinkedCodeBlock::codeFeatures): Deleted.
(JSC::UnlinkedCodeBlock::hasCapturedVariables): Deleted.
(JSC::UnlinkedCodeBlock::firstLine): Deleted.
(JSC::UnlinkedCodeBlock::lineCount): Deleted.
(JSC::UnlinkedCodeBlock::startColumn): Deleted.
(JSC::UnlinkedCodeBlock::endColumn): Deleted.
(JSC::UnlinkedCodeBlock::addOpProfileControlFlowBytecodeOffset): Deleted.
(JSC::UnlinkedCodeBlock::opProfileControlFlowBytecodeOffsets): Deleted.
(JSC::UnlinkedCodeBlock::finishCreation): Deleted.
(JSC::UnlinkedCodeBlock::createRareDataIfNecessary): Deleted.
(JSC::UnlinkedGlobalCodeBlock::UnlinkedGlobalCodeBlock): Deleted.
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
(JSC::generateFunctionCodeBlock): Deleted.
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable): Deleted.
(JSC::UnlinkedFunctionExecutable::visitChildren): Deleted.
(JSC::UnlinkedFunctionExecutable::link): Deleted.
(JSC::UnlinkedFunctionExecutable::fromGlobalCode): Deleted.
(JSC::UnlinkedFunctionExecutable::codeBlockFor): Deleted.
* bytecode/UnlinkedCodeBlock.h:
(JSC::ExecutableInfo::ExecutableInfo): Deleted.
(JSC::ExecutableInfo::needsActivation): Deleted.
(JSC::ExecutableInfo::usesEval): Deleted.
(JSC::ExecutableInfo::isStrictMode): Deleted.
(JSC::ExecutableInfo::isConstructor): Deleted.
(JSC::ExecutableInfo::isBuiltinFunction): Deleted.
(JSC::ExecutableInfo::constructorKind): Deleted.
* bytecode/UnlinkedFunctionExecutable.cpp: Copied from Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp.
(JSC::generateFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::codeBlockFor):
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock): Deleted.
(JSC::UnlinkedCodeBlock::visitChildren): Deleted.
(JSC::UnlinkedCodeBlock::lineNumberForBytecodeOffset): Deleted.
(JSC::UnlinkedCodeBlock::getLineAndColumn): Deleted.
(JSC::dumpLineColumnEntry): Deleted.
(JSC::UnlinkedCodeBlock::dumpExpressionRangeInfo): Deleted.
(JSC::UnlinkedCodeBlock::expressionRangeForBytecodeOffset): Deleted.
(JSC::UnlinkedCodeBlock::addExpressionInfo): Deleted.
(JSC::UnlinkedCodeBlock::typeProfilerExpressionInfoForBytecodeOffset): Deleted.
(JSC::UnlinkedCodeBlock::addTypeProfilerExpressionInfo): Deleted.
(JSC::UnlinkedProgramCodeBlock::visitChildren): Deleted.
(JSC::UnlinkedCodeBlock::~UnlinkedCodeBlock): Deleted.
(JSC::UnlinkedProgramCodeBlock::destroy): Deleted.
(JSC::UnlinkedEvalCodeBlock::destroy): Deleted.
(JSC::UnlinkedFunctionCodeBlock::destroy): Deleted.
(JSC::UnlinkedFunctionExecutable::destroy): Deleted.
(JSC::UnlinkedCodeBlock::setInstructions): Deleted.
(JSC::UnlinkedCodeBlock::instructions): Deleted.
* bytecode/UnlinkedFunctionExecutable.h: Copied from Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h.
(JSC::ExecutableInfo::ExecutableInfo): Deleted.
(JSC::ExecutableInfo::needsActivation): Deleted.
(JSC::ExecutableInfo::usesEval): Deleted.
(JSC::ExecutableInfo::isStrictMode): Deleted.
(JSC::ExecutableInfo::isConstructor): Deleted.
(JSC::ExecutableInfo::isBuiltinFunction): Deleted.
(JSC::ExecutableInfo::constructorKind): Deleted.
(JSC::UnlinkedStringJumpTable::offsetForValue): Deleted.
(JSC::UnlinkedSimpleJumpTable::add): Deleted.
(JSC::UnlinkedInstruction::UnlinkedInstruction): Deleted.
(JSC::UnlinkedCodeBlock::isConstructor): Deleted.
(JSC::UnlinkedCodeBlock::isStrictMode): Deleted.
(JSC::UnlinkedCodeBlock::usesEval): Deleted.
(JSC::UnlinkedCodeBlock::needsFullScopeChain): Deleted.
(JSC::UnlinkedCodeBlock::hasExpressionInfo): Deleted.
(JSC::UnlinkedCodeBlock::setThisRegister): Deleted.
(JSC::UnlinkedCodeBlock::setScopeRegister): Deleted.
(JSC::UnlinkedCodeBlock::setActivationRegister): Deleted.
(JSC::UnlinkedCodeBlock::usesGlobalObject): Deleted.
(JSC::UnlinkedCodeBlock::setGlobalObjectRegister): Deleted.
(JSC::UnlinkedCodeBlock::globalObjectRegister): Deleted.
(JSC::UnlinkedCodeBlock::setNumParameters): Deleted.
(JSC::UnlinkedCodeBlock::addParameter): Deleted.
(JSC::UnlinkedCodeBlock::numParameters): Deleted.
(JSC::UnlinkedCodeBlock::addRegExp): Deleted.
(JSC::UnlinkedCodeBlock::numberOfRegExps): Deleted.
(JSC::UnlinkedCodeBlock::regexp): Deleted.
(JSC::UnlinkedCodeBlock::numberOfIdentifiers): Deleted.
(JSC::UnlinkedCodeBlock::addIdentifier): Deleted.
(JSC::UnlinkedCodeBlock::identifier): Deleted.
(JSC::UnlinkedCodeBlock::identifiers): Deleted.
(JSC::UnlinkedCodeBlock::addConstant): Deleted.
(JSC::UnlinkedCodeBlock::registerIndexForLinkTimeConstant): Deleted.
(JSC::UnlinkedCodeBlock::constantRegisters): Deleted.
(JSC::UnlinkedCodeBlock::constantRegister): Deleted.
(JSC::UnlinkedCodeBlock::isConstantRegisterIndex): Deleted.
(JSC::UnlinkedCodeBlock::constantsSourceCodeRepresentation): Deleted.
(JSC::UnlinkedCodeBlock::numberOfJumpTargets): Deleted.
(JSC::UnlinkedCodeBlock::addJumpTarget): Deleted.
(JSC::UnlinkedCodeBlock::jumpTarget): Deleted.
(JSC::UnlinkedCodeBlock::lastJumpTarget): Deleted.
(JSC::UnlinkedCodeBlock::isBuiltinFunction): Deleted.
(JSC::UnlinkedCodeBlock::constructorKind): Deleted.
(JSC::UnlinkedCodeBlock::shrinkToFit): Deleted.
(JSC::UnlinkedCodeBlock::numberOfSwitchJumpTables): Deleted.
(JSC::UnlinkedCodeBlock::addSwitchJumpTable): Deleted.
(JSC::UnlinkedCodeBlock::switchJumpTable): Deleted.
(JSC::UnlinkedCodeBlock::numberOfStringSwitchJumpTables): Deleted.
(JSC::UnlinkedCodeBlock::addStringSwitchJumpTable): Deleted.
(JSC::UnlinkedCodeBlock::stringSwitchJumpTable): Deleted.
(JSC::UnlinkedCodeBlock::addFunctionDecl): Deleted.
(JSC::UnlinkedCodeBlock::functionDecl): Deleted.
(JSC::UnlinkedCodeBlock::numberOfFunctionDecls): Deleted.
(JSC::UnlinkedCodeBlock::addFunctionExpr): Deleted.
(JSC::UnlinkedCodeBlock::functionExpr): Deleted.
(JSC::UnlinkedCodeBlock::numberOfFunctionExprs): Deleted.
(JSC::UnlinkedCodeBlock::numberOfExceptionHandlers): Deleted.
(JSC::UnlinkedCodeBlock::addExceptionHandler): Deleted.
(JSC::UnlinkedCodeBlock::exceptionHandler): Deleted.
(JSC::UnlinkedCodeBlock::vm): Deleted.
(JSC::UnlinkedCodeBlock::addArrayProfile): Deleted.
(JSC::UnlinkedCodeBlock::numberOfArrayProfiles): Deleted.
(JSC::UnlinkedCodeBlock::addArrayAllocationProfile): Deleted.
(JSC::UnlinkedCodeBlock::numberOfArrayAllocationProfiles): Deleted.
(JSC::UnlinkedCodeBlock::addObjectAllocationProfile): Deleted.
(JSC::UnlinkedCodeBlock::numberOfObjectAllocationProfiles): Deleted.
(JSC::UnlinkedCodeBlock::addValueProfile): Deleted.
(JSC::UnlinkedCodeBlock::numberOfValueProfiles): Deleted.
(JSC::UnlinkedCodeBlock::addLLIntCallLinkInfo): Deleted.
(JSC::UnlinkedCodeBlock::numberOfLLintCallLinkInfos): Deleted.
(JSC::UnlinkedCodeBlock::codeType): Deleted.
(JSC::UnlinkedCodeBlock::thisRegister): Deleted.
(JSC::UnlinkedCodeBlock::scopeRegister): Deleted.
(JSC::UnlinkedCodeBlock::activationRegister): Deleted.
(JSC::UnlinkedCodeBlock::hasActivationRegister): Deleted.
(JSC::UnlinkedCodeBlock::addPropertyAccessInstruction): Deleted.
(JSC::UnlinkedCodeBlock::numberOfPropertyAccessInstructions): Deleted.
(JSC::UnlinkedCodeBlock::propertyAccessInstructions): Deleted.
(JSC::UnlinkedCodeBlock::constantBufferCount): Deleted.
(JSC::UnlinkedCodeBlock::addConstantBuffer): Deleted.
(JSC::UnlinkedCodeBlock::constantBuffer): Deleted.
(JSC::UnlinkedCodeBlock::hasRareData): Deleted.
(JSC::UnlinkedCodeBlock::recordParse): Deleted.
(JSC::UnlinkedCodeBlock::codeFeatures): Deleted.
(JSC::UnlinkedCodeBlock::hasCapturedVariables): Deleted.
(JSC::UnlinkedCodeBlock::firstLine): Deleted.
(JSC::UnlinkedCodeBlock::lineCount): Deleted.
(JSC::UnlinkedCodeBlock::startColumn): Deleted.
(JSC::UnlinkedCodeBlock::endColumn): Deleted.
(JSC::UnlinkedCodeBlock::addOpProfileControlFlowBytecodeOffset): Deleted.
(JSC::UnlinkedCodeBlock::opProfileControlFlowBytecodeOffsets): Deleted.
(JSC::UnlinkedCodeBlock::finishCreation): Deleted.
(JSC::UnlinkedCodeBlock::createRareDataIfNecessary): Deleted.
(JSC::UnlinkedGlobalCodeBlock::UnlinkedGlobalCodeBlock): Deleted.
* runtime/Executable.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/CMakeLists.txt (188241 => 188242)


--- trunk/Source/_javascript_Core/CMakeLists.txt	2015-08-11 01:11:11 UTC (rev 188241)
+++ trunk/Source/_javascript_Core/CMakeLists.txt	2015-08-11 01:26:30 UTC (rev 188242)
@@ -115,6 +115,7 @@
     bytecode/ToThisStatus.cpp
     bytecode/TrackedReferences.cpp
     bytecode/UnlinkedCodeBlock.cpp
+    bytecode/UnlinkedFunctionExecutable.cpp
     bytecode/UnlinkedInstructionStream.cpp
     bytecode/ValueRecovery.cpp
     bytecode/VariableWriteFireDetail.cpp

Modified: trunk/Source/_javascript_Core/ChangeLog (188241 => 188242)


--- trunk/Source/_javascript_Core/ChangeLog	2015-08-11 01:11:11 UTC (rev 188241)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-08-11 01:26:30 UTC (rev 188242)
@@ -1,3 +1,239 @@
+2015-08-10  Geoffrey Garen  <gga...@apple.com>
+
+        Start beating UnlinkedCodeBlock.h/.cpp with the "One Class per File" stick
+        https://bugs.webkit.org/show_bug.cgi?id=147856
+
+        Reviewed by Saam Barati.
+
+        Split out UnlinkedFunctionExecutable.h/.cpp and ExecutableInfo.h into separate files.
+
+        * CMakeLists.txt:
+        * _javascript_Core.vcxproj/_javascript_Core.vcxproj:
+        * _javascript_Core.vcxproj/_javascript_Core.vcxproj.filters:
+        * _javascript_Core.xcodeproj/project.pbxproj:
+        * bytecode/ExecutableInfo.h: Copied from Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h.
+        (JSC::ExecutableInfo::ExecutableInfo):
+        (JSC::UnlinkedStringJumpTable::offsetForValue): Deleted.
+        (JSC::UnlinkedSimpleJumpTable::add): Deleted.
+        (JSC::UnlinkedInstruction::UnlinkedInstruction): Deleted.
+        (JSC::UnlinkedCodeBlock::isConstructor): Deleted.
+        (JSC::UnlinkedCodeBlock::isStrictMode): Deleted.
+        (JSC::UnlinkedCodeBlock::usesEval): Deleted.
+        (JSC::UnlinkedCodeBlock::needsFullScopeChain): Deleted.
+        (JSC::UnlinkedCodeBlock::hasExpressionInfo): Deleted.
+        (JSC::UnlinkedCodeBlock::setThisRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::setScopeRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::setActivationRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::usesGlobalObject): Deleted.
+        (JSC::UnlinkedCodeBlock::setGlobalObjectRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::globalObjectRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::setNumParameters): Deleted.
+        (JSC::UnlinkedCodeBlock::addParameter): Deleted.
+        (JSC::UnlinkedCodeBlock::numParameters): Deleted.
+        (JSC::UnlinkedCodeBlock::addRegExp): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfRegExps): Deleted.
+        (JSC::UnlinkedCodeBlock::regexp): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfIdentifiers): Deleted.
+        (JSC::UnlinkedCodeBlock::addIdentifier): Deleted.
+        (JSC::UnlinkedCodeBlock::identifier): Deleted.
+        (JSC::UnlinkedCodeBlock::identifiers): Deleted.
+        (JSC::UnlinkedCodeBlock::addConstant): Deleted.
+        (JSC::UnlinkedCodeBlock::registerIndexForLinkTimeConstant): Deleted.
+        (JSC::UnlinkedCodeBlock::constantRegisters): Deleted.
+        (JSC::UnlinkedCodeBlock::constantRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::isConstantRegisterIndex): Deleted.
+        (JSC::UnlinkedCodeBlock::constantsSourceCodeRepresentation): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfJumpTargets): Deleted.
+        (JSC::UnlinkedCodeBlock::addJumpTarget): Deleted.
+        (JSC::UnlinkedCodeBlock::jumpTarget): Deleted.
+        (JSC::UnlinkedCodeBlock::lastJumpTarget): Deleted.
+        (JSC::UnlinkedCodeBlock::isBuiltinFunction): Deleted.
+        (JSC::UnlinkedCodeBlock::constructorKind): Deleted.
+        (JSC::UnlinkedCodeBlock::shrinkToFit): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfSwitchJumpTables): Deleted.
+        (JSC::UnlinkedCodeBlock::addSwitchJumpTable): Deleted.
+        (JSC::UnlinkedCodeBlock::switchJumpTable): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfStringSwitchJumpTables): Deleted.
+        (JSC::UnlinkedCodeBlock::addStringSwitchJumpTable): Deleted.
+        (JSC::UnlinkedCodeBlock::stringSwitchJumpTable): Deleted.
+        (JSC::UnlinkedCodeBlock::addFunctionDecl): Deleted.
+        (JSC::UnlinkedCodeBlock::functionDecl): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfFunctionDecls): Deleted.
+        (JSC::UnlinkedCodeBlock::addFunctionExpr): Deleted.
+        (JSC::UnlinkedCodeBlock::functionExpr): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfFunctionExprs): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfExceptionHandlers): Deleted.
+        (JSC::UnlinkedCodeBlock::addExceptionHandler): Deleted.
+        (JSC::UnlinkedCodeBlock::exceptionHandler): Deleted.
+        (JSC::UnlinkedCodeBlock::vm): Deleted.
+        (JSC::UnlinkedCodeBlock::addArrayProfile): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfArrayProfiles): Deleted.
+        (JSC::UnlinkedCodeBlock::addArrayAllocationProfile): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfArrayAllocationProfiles): Deleted.
+        (JSC::UnlinkedCodeBlock::addObjectAllocationProfile): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfObjectAllocationProfiles): Deleted.
+        (JSC::UnlinkedCodeBlock::addValueProfile): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfValueProfiles): Deleted.
+        (JSC::UnlinkedCodeBlock::addLLIntCallLinkInfo): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfLLintCallLinkInfos): Deleted.
+        (JSC::UnlinkedCodeBlock::codeType): Deleted.
+        (JSC::UnlinkedCodeBlock::thisRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::scopeRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::activationRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::hasActivationRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::addPropertyAccessInstruction): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfPropertyAccessInstructions): Deleted.
+        (JSC::UnlinkedCodeBlock::propertyAccessInstructions): Deleted.
+        (JSC::UnlinkedCodeBlock::constantBufferCount): Deleted.
+        (JSC::UnlinkedCodeBlock::addConstantBuffer): Deleted.
+        (JSC::UnlinkedCodeBlock::constantBuffer): Deleted.
+        (JSC::UnlinkedCodeBlock::hasRareData): Deleted.
+        (JSC::UnlinkedCodeBlock::recordParse): Deleted.
+        (JSC::UnlinkedCodeBlock::codeFeatures): Deleted.
+        (JSC::UnlinkedCodeBlock::hasCapturedVariables): Deleted.
+        (JSC::UnlinkedCodeBlock::firstLine): Deleted.
+        (JSC::UnlinkedCodeBlock::lineCount): Deleted.
+        (JSC::UnlinkedCodeBlock::startColumn): Deleted.
+        (JSC::UnlinkedCodeBlock::endColumn): Deleted.
+        (JSC::UnlinkedCodeBlock::addOpProfileControlFlowBytecodeOffset): Deleted.
+        (JSC::UnlinkedCodeBlock::opProfileControlFlowBytecodeOffsets): Deleted.
+        (JSC::UnlinkedCodeBlock::finishCreation): Deleted.
+        (JSC::UnlinkedCodeBlock::createRareDataIfNecessary): Deleted.
+        (JSC::UnlinkedGlobalCodeBlock::UnlinkedGlobalCodeBlock): Deleted.
+        * bytecode/UnlinkedCodeBlock.cpp:
+        (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
+        (JSC::generateFunctionCodeBlock): Deleted.
+        (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable): Deleted.
+        (JSC::UnlinkedFunctionExecutable::visitChildren): Deleted.
+        (JSC::UnlinkedFunctionExecutable::link): Deleted.
+        (JSC::UnlinkedFunctionExecutable::fromGlobalCode): Deleted.
+        (JSC::UnlinkedFunctionExecutable::codeBlockFor): Deleted.
+        * bytecode/UnlinkedCodeBlock.h:
+        (JSC::ExecutableInfo::ExecutableInfo): Deleted.
+        (JSC::ExecutableInfo::needsActivation): Deleted.
+        (JSC::ExecutableInfo::usesEval): Deleted.
+        (JSC::ExecutableInfo::isStrictMode): Deleted.
+        (JSC::ExecutableInfo::isConstructor): Deleted.
+        (JSC::ExecutableInfo::isBuiltinFunction): Deleted.
+        (JSC::ExecutableInfo::constructorKind): Deleted.
+        * bytecode/UnlinkedFunctionExecutable.cpp: Copied from Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp.
+        (JSC::generateFunctionCodeBlock):
+        (JSC::UnlinkedFunctionExecutable::codeBlockFor):
+        (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock): Deleted.
+        (JSC::UnlinkedCodeBlock::visitChildren): Deleted.
+        (JSC::UnlinkedCodeBlock::lineNumberForBytecodeOffset): Deleted.
+        (JSC::UnlinkedCodeBlock::getLineAndColumn): Deleted.
+        (JSC::dumpLineColumnEntry): Deleted.
+        (JSC::UnlinkedCodeBlock::dumpExpressionRangeInfo): Deleted.
+        (JSC::UnlinkedCodeBlock::expressionRangeForBytecodeOffset): Deleted.
+        (JSC::UnlinkedCodeBlock::addExpressionInfo): Deleted.
+        (JSC::UnlinkedCodeBlock::typeProfilerExpressionInfoForBytecodeOffset): Deleted.
+        (JSC::UnlinkedCodeBlock::addTypeProfilerExpressionInfo): Deleted.
+        (JSC::UnlinkedProgramCodeBlock::visitChildren): Deleted.
+        (JSC::UnlinkedCodeBlock::~UnlinkedCodeBlock): Deleted.
+        (JSC::UnlinkedProgramCodeBlock::destroy): Deleted.
+        (JSC::UnlinkedEvalCodeBlock::destroy): Deleted.
+        (JSC::UnlinkedFunctionCodeBlock::destroy): Deleted.
+        (JSC::UnlinkedFunctionExecutable::destroy): Deleted.
+        (JSC::UnlinkedCodeBlock::setInstructions): Deleted.
+        (JSC::UnlinkedCodeBlock::instructions): Deleted.
+        * bytecode/UnlinkedFunctionExecutable.h: Copied from Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h.
+        (JSC::ExecutableInfo::ExecutableInfo): Deleted.
+        (JSC::ExecutableInfo::needsActivation): Deleted.
+        (JSC::ExecutableInfo::usesEval): Deleted.
+        (JSC::ExecutableInfo::isStrictMode): Deleted.
+        (JSC::ExecutableInfo::isConstructor): Deleted.
+        (JSC::ExecutableInfo::isBuiltinFunction): Deleted.
+        (JSC::ExecutableInfo::constructorKind): Deleted.
+        (JSC::UnlinkedStringJumpTable::offsetForValue): Deleted.
+        (JSC::UnlinkedSimpleJumpTable::add): Deleted.
+        (JSC::UnlinkedInstruction::UnlinkedInstruction): Deleted.
+        (JSC::UnlinkedCodeBlock::isConstructor): Deleted.
+        (JSC::UnlinkedCodeBlock::isStrictMode): Deleted.
+        (JSC::UnlinkedCodeBlock::usesEval): Deleted.
+        (JSC::UnlinkedCodeBlock::needsFullScopeChain): Deleted.
+        (JSC::UnlinkedCodeBlock::hasExpressionInfo): Deleted.
+        (JSC::UnlinkedCodeBlock::setThisRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::setScopeRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::setActivationRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::usesGlobalObject): Deleted.
+        (JSC::UnlinkedCodeBlock::setGlobalObjectRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::globalObjectRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::setNumParameters): Deleted.
+        (JSC::UnlinkedCodeBlock::addParameter): Deleted.
+        (JSC::UnlinkedCodeBlock::numParameters): Deleted.
+        (JSC::UnlinkedCodeBlock::addRegExp): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfRegExps): Deleted.
+        (JSC::UnlinkedCodeBlock::regexp): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfIdentifiers): Deleted.
+        (JSC::UnlinkedCodeBlock::addIdentifier): Deleted.
+        (JSC::UnlinkedCodeBlock::identifier): Deleted.
+        (JSC::UnlinkedCodeBlock::identifiers): Deleted.
+        (JSC::UnlinkedCodeBlock::addConstant): Deleted.
+        (JSC::UnlinkedCodeBlock::registerIndexForLinkTimeConstant): Deleted.
+        (JSC::UnlinkedCodeBlock::constantRegisters): Deleted.
+        (JSC::UnlinkedCodeBlock::constantRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::isConstantRegisterIndex): Deleted.
+        (JSC::UnlinkedCodeBlock::constantsSourceCodeRepresentation): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfJumpTargets): Deleted.
+        (JSC::UnlinkedCodeBlock::addJumpTarget): Deleted.
+        (JSC::UnlinkedCodeBlock::jumpTarget): Deleted.
+        (JSC::UnlinkedCodeBlock::lastJumpTarget): Deleted.
+        (JSC::UnlinkedCodeBlock::isBuiltinFunction): Deleted.
+        (JSC::UnlinkedCodeBlock::constructorKind): Deleted.
+        (JSC::UnlinkedCodeBlock::shrinkToFit): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfSwitchJumpTables): Deleted.
+        (JSC::UnlinkedCodeBlock::addSwitchJumpTable): Deleted.
+        (JSC::UnlinkedCodeBlock::switchJumpTable): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfStringSwitchJumpTables): Deleted.
+        (JSC::UnlinkedCodeBlock::addStringSwitchJumpTable): Deleted.
+        (JSC::UnlinkedCodeBlock::stringSwitchJumpTable): Deleted.
+        (JSC::UnlinkedCodeBlock::addFunctionDecl): Deleted.
+        (JSC::UnlinkedCodeBlock::functionDecl): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfFunctionDecls): Deleted.
+        (JSC::UnlinkedCodeBlock::addFunctionExpr): Deleted.
+        (JSC::UnlinkedCodeBlock::functionExpr): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfFunctionExprs): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfExceptionHandlers): Deleted.
+        (JSC::UnlinkedCodeBlock::addExceptionHandler): Deleted.
+        (JSC::UnlinkedCodeBlock::exceptionHandler): Deleted.
+        (JSC::UnlinkedCodeBlock::vm): Deleted.
+        (JSC::UnlinkedCodeBlock::addArrayProfile): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfArrayProfiles): Deleted.
+        (JSC::UnlinkedCodeBlock::addArrayAllocationProfile): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfArrayAllocationProfiles): Deleted.
+        (JSC::UnlinkedCodeBlock::addObjectAllocationProfile): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfObjectAllocationProfiles): Deleted.
+        (JSC::UnlinkedCodeBlock::addValueProfile): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfValueProfiles): Deleted.
+        (JSC::UnlinkedCodeBlock::addLLIntCallLinkInfo): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfLLintCallLinkInfos): Deleted.
+        (JSC::UnlinkedCodeBlock::codeType): Deleted.
+        (JSC::UnlinkedCodeBlock::thisRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::scopeRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::activationRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::hasActivationRegister): Deleted.
+        (JSC::UnlinkedCodeBlock::addPropertyAccessInstruction): Deleted.
+        (JSC::UnlinkedCodeBlock::numberOfPropertyAccessInstructions): Deleted.
+        (JSC::UnlinkedCodeBlock::propertyAccessInstructions): Deleted.
+        (JSC::UnlinkedCodeBlock::constantBufferCount): Deleted.
+        (JSC::UnlinkedCodeBlock::addConstantBuffer): Deleted.
+        (JSC::UnlinkedCodeBlock::constantBuffer): Deleted.
+        (JSC::UnlinkedCodeBlock::hasRareData): Deleted.
+        (JSC::UnlinkedCodeBlock::recordParse): Deleted.
+        (JSC::UnlinkedCodeBlock::codeFeatures): Deleted.
+        (JSC::UnlinkedCodeBlock::hasCapturedVariables): Deleted.
+        (JSC::UnlinkedCodeBlock::firstLine): Deleted.
+        (JSC::UnlinkedCodeBlock::lineCount): Deleted.
+        (JSC::UnlinkedCodeBlock::startColumn): Deleted.
+        (JSC::UnlinkedCodeBlock::endColumn): Deleted.
+        (JSC::UnlinkedCodeBlock::addOpProfileControlFlowBytecodeOffset): Deleted.
+        (JSC::UnlinkedCodeBlock::opProfileControlFlowBytecodeOffsets): Deleted.
+        (JSC::UnlinkedCodeBlock::finishCreation): Deleted.
+        (JSC::UnlinkedCodeBlock::createRareDataIfNecessary): Deleted.
+        (JSC::UnlinkedGlobalCodeBlock::UnlinkedGlobalCodeBlock): Deleted.
+        * runtime/Executable.h:
+
 2015-08-10  Mark Lam  <mark....@apple.com>
 
         Refactor LiveObjectList and LiveObjectData into their own files.

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj (188241 => 188242)


--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj	2015-08-11 01:11:11 UTC (rev 188241)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj	2015-08-11 01:26:30 UTC (rev 188242)
@@ -355,6 +355,7 @@
     <ClCompile Include="..\bytecode\ToThisStatus.cpp" />
     <ClCompile Include="..\bytecode\TrackedReferences.cpp" />
     <ClCompile Include="..\bytecode\UnlinkedCodeBlock.cpp" />
+    <ClCompile Include="..\bytecode\UnlinkedFunctionExecutable.cpp" />
     <ClCompile Include="..\bytecode\UnlinkedInstructionStream.cpp" />
     <ClCompile Include="..\bytecode\ValueRecovery.cpp" />
     <ClCompile Include="..\bytecode\VariableWriteFireDetail.cpp" />

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj.filters (188241 => 188242)


--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj.filters	2015-08-11 01:11:11 UTC (rev 188241)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj.filters	2015-08-11 01:26:30 UTC (rev 188242)
@@ -219,6 +219,9 @@
     <ClCompile Include="..\bytecode\UnlinkedCodeBlock.cpp">
       <Filter>bytecode</Filter>
     </ClCompile>
+    <ClCompile Include="..\bytecode\UnlinkedFunctionExecutable.cpp">
+      <Filter>bytecode</Filter>
+    </ClCompile>
     <ClCompile Include="..\bytecode\UnlinkedInstructionStream.cpp">
       <Filter>bytecode</Filter>
     </ClCompile>

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (188241 => 188242)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2015-08-11 01:11:11 UTC (rev 188241)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2015-08-11 01:26:30 UTC (rev 188242)
@@ -770,6 +770,9 @@
 		140D17D70E8AD4A9000CD17D /* JSBasePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		141211310A48794D00480255 /* _javascript_Core.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* _javascript_Core.framework */; };
 		141211340A48795800480255 /* minidom.c in Sources */ = {isa = PBXBuildFile; fileRef = 141211020A48780900480255 /* minidom.c */; };
+		14142E511B796ECE00F4BF4B /* UnlinkedFunctionExecutable.h in Headers */ = {isa = PBXBuildFile; fileRef = 14142E501B796ECE00F4BF4B /* UnlinkedFunctionExecutable.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		14142E531B796EDD00F4BF4B /* ExecutableInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 14142E521B796EDD00F4BF4B /* ExecutableInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		14142E551B7973C000F4BF4B /* UnlinkedFunctionExecutable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14142E541B7973C000F4BF4B /* UnlinkedFunctionExecutable.cpp */; };
 		141448CB13A176EC00F5BA1A /* MarkedBlockSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 141448CA13A176EC00F5BA1A /* MarkedBlockSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		141448CD13A1783700F5BA1A /* TinyBloomFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 141448CC13A1783700F5BA1A /* TinyBloomFilter.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		14150133154BB13F005D8C98 /* WeakSetInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 14150132154BB13F005D8C98 /* WeakSetInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2550,6 +2553,9 @@
 		141211020A48780900480255 /* minidom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = minidom.c; path = tests/minidom.c; sourceTree = "<group>"; };
 		1412110D0A48788700480255 /* minidom.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; name = minidom.js; path = tests/minidom.js; sourceTree = "<group>"; };
 		141211200A48793C00480255 /* minidom */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = minidom; sourceTree = BUILT_PRODUCTS_DIR; };
+		14142E501B796ECE00F4BF4B /* UnlinkedFunctionExecutable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnlinkedFunctionExecutable.h; sourceTree = "<group>"; };
+		14142E521B796EDD00F4BF4B /* ExecutableInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutableInfo.h; sourceTree = "<group>"; };
+		14142E541B7973C000F4BF4B /* UnlinkedFunctionExecutable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnlinkedFunctionExecutable.cpp; sourceTree = "<group>"; };
 		141448CA13A176EC00F5BA1A /* MarkedBlockSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkedBlockSet.h; sourceTree = "<group>"; };
 		141448CC13A1783700F5BA1A /* TinyBloomFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TinyBloomFilter.h; sourceTree = "<group>"; };
 		14150132154BB13F005D8C98 /* WeakSetInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakSetInlines.h; sourceTree = "<group>"; };
@@ -5428,6 +5434,7 @@
 				0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */,
 				0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */,
 				969A07920ED1D3AE00F1F681 /* EvalCodeCache.h */,
+				14142E521B796EDD00F4BF4B /* ExecutableInfo.h */,
 				0F56A1D415001CF2002992B1 /* ExecutionCounter.cpp */,
 				0F56A1D115000F31002992B1 /* ExecutionCounter.h */,
 				0F0332BF18ADFAE1005F979A /* ExitingJITType.cpp */,
@@ -5495,6 +5502,8 @@
 				0F2D4DE719832DAC007D4B19 /* TypeLocation.h */,
 				A79E781E15EECBA80047C855 /* UnlinkedCodeBlock.cpp */,
 				A79E781F15EECBA80047C855 /* UnlinkedCodeBlock.h */,
+				14142E501B796ECE00F4BF4B /* UnlinkedFunctionExecutable.h */,
+				14142E541B7973C000F4BF4B /* UnlinkedFunctionExecutable.cpp */,
 				B59F89381891ADB500D5CCDC /* UnlinkedInstructionStream.cpp */,
 				B59F89371891AD3300D5CCDC /* UnlinkedInstructionStream.h */,
 				0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */,
@@ -6083,12 +6092,14 @@
 				0FDDBFB61666EEDA00C55FEF /* DFGVariableAccessDataDump.h in Headers */,
 				0F2BDC491522809600CD8910 /* DFGVariableEvent.h in Headers */,
 				0F2BDC4B1522809D00CD8910 /* DFGVariableEventStream.h in Headers */,
+				14142E511B796ECE00F4BF4B /* UnlinkedFunctionExecutable.h in Headers */,
 				0FFFC96014EF90BD00C72532 /* DFGVirtualRegisterAllocationPhase.h in Headers */,
 				0FC97F4218202119002C9B26 /* DFGWatchpointCollectionPhase.h in Headers */,
 				0FDB2CE8174830A2007B3C1B /* DFGWorklist.h in Headers */,
 				0FF42731158EBD54004CB9FF /* Disassembler.h in Headers */,
 				A70447EE17A0BD7000F5898E /* DumpContext.h in Headers */,
 				99E45A2418A1B2590026D88F /* EmptyInputCursor.h in Headers */,
+				14142E531B796EDD00F4BF4B /* ExecutableInfo.h in Headers */,
 				99E45A2618A1B2590026D88F /* EncodedValue.h in Headers */,
 				0F5874EE194FEB1200AAB2C1 /* DFGMayExit.h in Headers */,
 				BC3046070E1F497F003232CF /* Error.h in Headers */,
@@ -7646,6 +7657,7 @@
 				0FB5467914F5C46B002C2989 /* LazyOperandValueProfile.cpp in Sources */,
 				95AB83420DA4322500BC83F3 /* LegacyProfiler.cpp in Sources */,
 				148F21B0107EC5410042EC2C /* Lexer.cpp in Sources */,
+				14142E551B7973C000F4BF4B /* UnlinkedFunctionExecutable.cpp in Sources */,
 				0FF4275715914A20004CB9FF /* LinkBuffer.cpp in Sources */,
 				A7E2EA6C0FB460CF00601F06 /* LiteralParser.cpp in Sources */,
 				FE20CE9D15F04A9500DF3430 /* LLIntCLoop.cpp in Sources */,

Copied: trunk/Source/_javascript_Core/bytecode/ExecutableInfo.h (from rev 188219, trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h) (0 => 188242)


--- trunk/Source/_javascript_Core/bytecode/ExecutableInfo.h	                        (rev 0)
+++ trunk/Source/_javascript_Core/bytecode/ExecutableInfo.h	2015-08-11 01:26:30 UTC (rev 188242)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2012-2015 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ExecutableInfo_h
+#define ExecutableInfo_h
+
+#include "ParserModes.h"
+
+namespace JSC {
+
+struct ExecutableInfo {
+    ExecutableInfo(bool needsActivation, bool usesEval, bool isStrictMode, bool isConstructor, bool isBuiltinFunction, ConstructorKind constructorKind)
+        : m_needsActivation(needsActivation)
+        , m_usesEval(usesEval)
+        , m_isStrictMode(isStrictMode)
+        , m_isConstructor(isConstructor)
+        , m_isBuiltinFunction(isBuiltinFunction)
+        , m_constructorKind(static_cast<unsigned>(constructorKind))
+    {
+        ASSERT(m_constructorKind == static_cast<unsigned>(constructorKind));
+    }
+
+    bool needsActivation() const { return m_needsActivation; }
+    bool usesEval() const { return m_usesEval; }
+    bool isStrictMode() const { return m_isStrictMode; }
+    bool isConstructor() const { return m_isConstructor; }
+    bool isBuiltinFunction() const { return m_isBuiltinFunction; }
+    ConstructorKind constructorKind() const { return static_cast<ConstructorKind>(m_constructorKind); }
+
+private:
+    unsigned m_needsActivation : 1;
+    unsigned m_usesEval : 1;
+    unsigned m_isStrictMode : 1;
+    unsigned m_isConstructor : 1;
+    unsigned m_isBuiltinFunction : 1;
+    unsigned m_constructorKind : 2;
+};
+
+} // namespace JSC
+
+#endif // ExecutableInfo_h

Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp (188241 => 188242)


--- trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp	2015-08-11 01:11:11 UTC (rev 188241)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp	2015-08-11 01:26:30 UTC (rev 188242)
@@ -31,6 +31,7 @@
 #include "ClassInfo.h"
 #include "CodeCache.h"
 #include "Executable.h"
+#include "ExecutableInfo.h"
 #include "FunctionOverrides.h"
 #include "JSString.h"
 #include "JSCInlines.h"
@@ -43,179 +44,12 @@
 
 namespace JSC {
 
-static_assert(sizeof(UnlinkedFunctionExecutable) <= 256, "UnlinkedFunctionExecutable should fit in a 256-byte cell.");
-
-const ClassInfo UnlinkedFunctionExecutable::s_info = { "UnlinkedFunctionExecutable", 0, 0, CREATE_METHOD_TABLE(UnlinkedFunctionExecutable) };
 const ClassInfo UnlinkedCodeBlock::s_info = { "UnlinkedCodeBlock", 0, 0, CREATE_METHOD_TABLE(UnlinkedCodeBlock) };
 const ClassInfo UnlinkedGlobalCodeBlock::s_info = { "UnlinkedGlobalCodeBlock", &Base::s_info, 0, CREATE_METHOD_TABLE(UnlinkedGlobalCodeBlock) };
 const ClassInfo UnlinkedProgramCodeBlock::s_info = { "UnlinkedProgramCodeBlock", &Base::s_info, 0, CREATE_METHOD_TABLE(UnlinkedProgramCodeBlock) };
 const ClassInfo UnlinkedEvalCodeBlock::s_info = { "UnlinkedEvalCodeBlock", &Base::s_info, 0, CREATE_METHOD_TABLE(UnlinkedEvalCodeBlock) };
 const ClassInfo UnlinkedFunctionCodeBlock::s_info = { "UnlinkedFunctionCodeBlock", &Base::s_info, 0, CREATE_METHOD_TABLE(UnlinkedFunctionCodeBlock) };
 
-static UnlinkedFunctionCodeBlock* generateFunctionCodeBlock(
-    VM& vm, UnlinkedFunctionExecutable* executable, const SourceCode& source,
-    CodeSpecializationKind kind, DebuggerMode debuggerMode, ProfilerMode profilerMode,
-    UnlinkedFunctionKind functionKind, ParserError& error)
-{
-    JSParserBuiltinMode builtinMode = executable->isBuiltinFunction() ? JSParserBuiltinMode::Builtin : JSParserBuiltinMode::NotBuiltin;
-    JSParserStrictMode strictMode = executable->isInStrictContext() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
-    std::unique_ptr<FunctionNode> function = parse<FunctionNode>(
-        &vm, source, executable->name(), builtinMode, strictMode, 
-        JSParserCodeType::Function, error, nullptr, executable->parseMode());
-
-    if (!function) {
-        ASSERT(error.isValid());
-        return nullptr;
-    }
-
-    function->finishParsing(executable->name(), executable->functionMode());
-    executable->recordParse(function->features(), function->hasCapturedVariables());
-    
-    UnlinkedFunctionCodeBlock* result = UnlinkedFunctionCodeBlock::create(&vm, FunctionCode,
-        ExecutableInfo(function->needsActivation(), function->usesEval(), function->isStrictMode(), kind == CodeForConstruct, functionKind == UnlinkedBuiltinFunction, executable->constructorKind()));
-    auto generator(std::make_unique<BytecodeGenerator>(vm, function.get(), result, debuggerMode, profilerMode, executable->parentScopeTDZVariables()));
-    error = generator->generate();
-    if (error.isValid())
-        return nullptr;
-    return result;
-}
-
-UnlinkedFunctionExecutable::UnlinkedFunctionExecutable(VM* vm, Structure* structure, const SourceCode& source, RefPtr<SourceProvider>&& sourceOverride, FunctionMetadataNode* node, UnlinkedFunctionKind kind, ConstructAbility constructAbility, VariableEnvironment& parentScopeTDZVariables)
-    : Base(*vm, structure)
-    , m_name(node->ident())
-    , m_inferredName(node->inferredName())
-    , m_sourceOverride(WTF::move(sourceOverride))
-    , m_firstLineOffset(node->firstLine() - source.firstLine())
-    , m_lineCount(node->lastLine() - node->firstLine())
-    , m_unlinkedFunctionNameStart(node->functionNameStart() - source.startOffset())
-    , m_unlinkedBodyStartColumn(node->startColumn())
-    , m_unlinkedBodyEndColumn(m_lineCount ? node->endColumn() : node->endColumn() - node->startColumn())
-    , m_startOffset(node->source().startOffset() - source.startOffset())
-    , m_sourceLength(node->source().length())
-    , m_parametersStartOffset(node->parametersStart())
-    , m_typeProfilingStartOffset(node->functionKeywordStart())
-    , m_typeProfilingEndOffset(node->startStartOffset() + node->source().length() - 1)
-    , m_parameterCount(node->parameterCount())
-    , m_parseMode(node->parseMode())
-    , m_features(0)
-    , m_isInStrictContext(node->isInStrictContext())
-    , m_hasCapturedVariables(false)
-    , m_isBuiltinFunction(kind == UnlinkedBuiltinFunction)
-    , m_constructAbility(static_cast<unsigned>(constructAbility))
-    , m_constructorKind(static_cast<unsigned>(node->constructorKind()))
-    , m_functionMode(node->functionMode())
-{
-    ASSERT(m_constructorKind == static_cast<unsigned>(node->constructorKind()));
-    m_parentScopeTDZVariables.swap(parentScopeTDZVariables);
-}
-
-void UnlinkedFunctionExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor)
-{
-    UnlinkedFunctionExecutable* thisObject = jsCast<UnlinkedFunctionExecutable*>(cell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Base::visitChildren(thisObject, visitor);
-    visitor.append(&thisObject->m_codeBlockForCall);
-    visitor.append(&thisObject->m_codeBlockForConstruct);
-    visitor.append(&thisObject->m_nameValue);
-}
-
-FunctionExecutable* UnlinkedFunctionExecutable::link(VM& vm, const SourceCode& ownerSource, int overrideLineNumber)
-{
-    SourceCode source = m_sourceOverride ? SourceCode(m_sourceOverride) : ownerSource;
-    unsigned firstLine = source.firstLine() + m_firstLineOffset;
-    unsigned startOffset = source.startOffset() + m_startOffset;
-    unsigned lineCount = m_lineCount;
-
-    // Adjust to one-based indexing.
-    bool startColumnIsOnFirstSourceLine = !m_firstLineOffset;
-    unsigned startColumn = m_unlinkedBodyStartColumn + (startColumnIsOnFirstSourceLine ? source.startColumn() : 1);
-    bool endColumnIsOnStartLine = !lineCount;
-    unsigned endColumn = m_unlinkedBodyEndColumn + (endColumnIsOnStartLine ? startColumn : 1);
-
-    SourceCode code(source.provider(), startOffset, startOffset + m_sourceLength, firstLine, startColumn);
-    FunctionOverrides::OverrideInfo overrideInfo;
-    bool hasFunctionOverride = false;
-
-    if (UNLIKELY(Options::functionOverrides())) {
-        hasFunctionOverride = FunctionOverrides::initializeOverrideFor(code, overrideInfo);
-        if (hasFunctionOverride) {
-            firstLine = overrideInfo.firstLine;
-            lineCount = overrideInfo.lineCount;
-            startColumn = overrideInfo.startColumn;
-            endColumn = overrideInfo.endColumn;
-            code = overrideInfo.sourceCode;
-        }
-    }
-
-    FunctionExecutable* result = FunctionExecutable::create(vm, code, this, firstLine, firstLine + lineCount, startColumn, endColumn);
-    if (overrideLineNumber != -1)
-        result->setOverrideLineNumber(overrideLineNumber);
-
-    if (UNLIKELY(hasFunctionOverride)) {
-        result->overrideParameterAndTypeProfilingStartEndOffsets(
-            overrideInfo.parametersStartOffset,
-            overrideInfo.typeProfilingStartOffset,
-            overrideInfo.typeProfilingEndOffset);
-    }
-
-    return result;
-}
-
-UnlinkedFunctionExecutable* UnlinkedFunctionExecutable::fromGlobalCode(
-    const Identifier& name, ExecState& exec, const SourceCode& source, 
-    JSObject*& exception, int overrideLineNumber)
-{
-    ParserError error;
-    VM& vm = exec.vm();
-    CodeCache* codeCache = vm.codeCache();
-    UnlinkedFunctionExecutable* executable = codeCache->getFunctionExecutableFromGlobalCode(vm, name, source, error);
-
-    auto& globalObject = *exec.lexicalGlobalObject();
-    if (globalObject.hasDebugger())
-        globalObject.debugger()->sourceParsed(&exec, source.provider(), error.line(), error.message());
-
-    if (error.isValid()) {
-        exception = error.toErrorObject(&globalObject, source, overrideLineNumber);
-        return nullptr;
-    }
-
-    return executable;
-}
-
-UnlinkedFunctionCodeBlock* UnlinkedFunctionExecutable::codeBlockFor(
-    VM& vm, const SourceCode& source, CodeSpecializationKind specializationKind, 
-    DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError& error)
-{
-    switch (specializationKind) {
-    case CodeForCall:
-        if (UnlinkedFunctionCodeBlock* codeBlock = m_codeBlockForCall.get())
-            return codeBlock;
-        break;
-    case CodeForConstruct:
-        if (UnlinkedFunctionCodeBlock* codeBlock = m_codeBlockForConstruct.get())
-            return codeBlock;
-        break;
-    }
-
-    UnlinkedFunctionCodeBlock* result = generateFunctionCodeBlock(
-        vm, this, source, specializationKind, debuggerMode, profilerMode, 
-        isBuiltinFunction() ? UnlinkedBuiltinFunction : UnlinkedNormalFunction, 
-        error);
-    
-    if (error.isValid())
-        return nullptr;
-
-    switch (specializationKind) {
-    case CodeForCall:
-        m_codeBlockForCall.set(vm, this, result);
-        break;
-    case CodeForConstruct:
-        m_codeBlockForConstruct.set(vm, this, result);
-        break;
-    }
-    return result;
-}
-
 UnlinkedCodeBlock::UnlinkedCodeBlock(VM* vm, Structure* structure, CodeType codeType, const ExecutableInfo& info)
     : Base(*vm, structure)
     , m_numVars(0)

Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h (188241 => 188242)


--- trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h	2015-08-11 01:11:11 UTC (rev 188241)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h	2015-08-11 01:26:30 UTC (rev 188242)
@@ -39,9 +39,9 @@
 #include "RegExp.h"
 #include "SpecialPointer.h"
 #include "SymbolTable.h"
+#include "UnlinkedFunctionExecutable.h"
 #include "VariableEnvironment.h"
 #include "VirtualRegister.h"
-
 #include <wtf/RefCountedArray.h>
 #include <wtf/Vector.h>
 
@@ -58,7 +58,9 @@
 class SymbolTable;
 class UnlinkedCodeBlock;
 class UnlinkedFunctionCodeBlock;
+class UnlinkedFunctionExecutable;
 class UnlinkedInstructionStream;
+struct ExecutableInfo;
 
 typedef unsigned UnlinkedValueProfile;
 typedef unsigned UnlinkedArrayProfile;
@@ -66,157 +68,6 @@
 typedef unsigned UnlinkedObjectAllocationProfile;
 typedef unsigned UnlinkedLLIntCallLinkInfo;
 
-struct ExecutableInfo {
-    ExecutableInfo(bool needsActivation, bool usesEval, bool isStrictMode, bool isConstructor, bool isBuiltinFunction, ConstructorKind constructorKind)
-        : m_needsActivation(needsActivation)
-        , m_usesEval(usesEval)
-        , m_isStrictMode(isStrictMode)
-        , m_isConstructor(isConstructor)
-        , m_isBuiltinFunction(isBuiltinFunction)
-        , m_constructorKind(static_cast<unsigned>(constructorKind))
-    {
-        ASSERT(m_constructorKind == static_cast<unsigned>(constructorKind));
-    }
-
-    bool needsActivation() const { return m_needsActivation; }
-    bool usesEval() const { return m_usesEval; }
-    bool isStrictMode() const { return m_isStrictMode; }
-    bool isConstructor() const { return m_isConstructor; }
-    bool isBuiltinFunction() const { return m_isBuiltinFunction; }
-    ConstructorKind constructorKind() const { return static_cast<ConstructorKind>(m_constructorKind); }
-
-private:
-    unsigned m_needsActivation : 1;
-    unsigned m_usesEval : 1;
-    unsigned m_isStrictMode : 1;
-    unsigned m_isConstructor : 1;
-    unsigned m_isBuiltinFunction : 1;
-    unsigned m_constructorKind : 2;
-};
-
-enum UnlinkedFunctionKind {
-    UnlinkedNormalFunction,
-    UnlinkedBuiltinFunction,
-};
-
-class UnlinkedFunctionExecutable final : public JSCell {
-public:
-    friend class BuiltinExecutables;
-    friend class CodeCache;
-    friend class VM;
-
-    typedef JSCell Base;
-    static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
-
-    static UnlinkedFunctionExecutable* create(VM* vm, const SourceCode& source, FunctionMetadataNode* node, UnlinkedFunctionKind unlinkedFunctionKind, ConstructAbility constructAbility, VariableEnvironment& parentScopeTDZVariables, RefPtr<SourceProvider>&& sourceOverride = nullptr)
-    {
-        UnlinkedFunctionExecutable* instance = new (NotNull, allocateCell<UnlinkedFunctionExecutable>(vm->heap))
-            UnlinkedFunctionExecutable(vm, vm->unlinkedFunctionExecutableStructure.get(), source, WTF::move(sourceOverride), node, unlinkedFunctionKind, constructAbility, parentScopeTDZVariables);
-        instance->finishCreation(*vm);
-        return instance;
-    }
-
-    const Identifier& name() const { return m_name; }
-    const Identifier& inferredName() const { return m_inferredName; }
-    JSString* nameValue() const { return m_nameValue.get(); }
-    unsigned parameterCount() const { return m_parameterCount; };
-    FunctionParseMode parseMode() const { return m_parseMode; };
-    bool isInStrictContext() const { return m_isInStrictContext; }
-    FunctionMode functionMode() const { return static_cast<FunctionMode>(m_functionMode); }
-    ConstructorKind constructorKind() const { return static_cast<ConstructorKind>(m_constructorKind); }
-
-    unsigned unlinkedFunctionNameStart() const { return m_unlinkedFunctionNameStart; }
-    unsigned unlinkedBodyStartColumn() const { return m_unlinkedBodyStartColumn; }
-    unsigned unlinkedBodyEndColumn() const { return m_unlinkedBodyEndColumn; }
-    unsigned startOffset() const { return m_startOffset; }
-    unsigned sourceLength() { return m_sourceLength; }
-    unsigned parametersStartOffset() const { return m_parametersStartOffset; }
-    unsigned typeProfilingStartOffset() const { return m_typeProfilingStartOffset; }
-    unsigned typeProfilingEndOffset() const { return m_typeProfilingEndOffset; }
-
-    UnlinkedFunctionCodeBlock* codeBlockFor(
-        VM&, const SourceCode&, CodeSpecializationKind, DebuggerMode, ProfilerMode, 
-        ParserError&);
-
-    static UnlinkedFunctionExecutable* fromGlobalCode(
-        const Identifier&, ExecState&, const SourceCode&, JSObject*& exception, 
-        int overrideLineNumber);
-
-    FunctionExecutable* link(VM&, const SourceCode&, int overrideLineNumber = -1);
-
-    void clearCodeForRecompilation()
-    {
-        m_codeBlockForCall.clear();
-        m_codeBlockForConstruct.clear();
-    }
-
-    void recordParse(CodeFeatures features, bool hasCapturedVariables)
-    {
-        m_features = features;
-        m_hasCapturedVariables = hasCapturedVariables;
-    }
-
-    CodeFeatures features() const { return m_features; }
-    bool hasCapturedVariables() const { return m_hasCapturedVariables; }
-
-    static const bool needsDestruction = true;
-    static void destroy(JSCell*);
-
-    bool isBuiltinFunction() const { return m_isBuiltinFunction; }
-    ConstructAbility constructAbility() const { return static_cast<ConstructAbility>(m_constructAbility); }
-    bool isClassConstructorFunction() const { return constructorKind() != ConstructorKind::None; }
-    const VariableEnvironment* parentScopeTDZVariables() const { return &m_parentScopeTDZVariables; }
-
-private:
-    UnlinkedFunctionExecutable(VM*, Structure*, const SourceCode&, RefPtr<SourceProvider>&& sourceOverride, FunctionMetadataNode*, UnlinkedFunctionKind, ConstructAbility, VariableEnvironment&);
-    WriteBarrier<UnlinkedFunctionCodeBlock> m_codeBlockForCall;
-    WriteBarrier<UnlinkedFunctionCodeBlock> m_codeBlockForConstruct;
-
-    Identifier m_name;
-    Identifier m_inferredName;
-    WriteBarrier<JSString> m_nameValue;
-    RefPtr<SourceProvider> m_sourceOverride;
-    VariableEnvironment m_parentScopeTDZVariables;
-    unsigned m_firstLineOffset;
-    unsigned m_lineCount;
-    unsigned m_unlinkedFunctionNameStart;
-    unsigned m_unlinkedBodyStartColumn;
-    unsigned m_unlinkedBodyEndColumn;
-    unsigned m_startOffset;
-    unsigned m_sourceLength;
-    unsigned m_parametersStartOffset;
-    unsigned m_typeProfilingStartOffset;
-    unsigned m_typeProfilingEndOffset;
-    unsigned m_parameterCount;
-    FunctionParseMode m_parseMode;
-
-    CodeFeatures m_features;
-
-    unsigned m_isInStrictContext : 1;
-    unsigned m_hasCapturedVariables : 1;
-    unsigned m_isBuiltinFunction : 1;
-    unsigned m_constructAbility: 1;
-    unsigned m_constructorKind : 2;
-    unsigned m_functionMode : 1; // FunctionMode
-
-protected:
-    void finishCreation(VM& vm)
-    {
-        Base::finishCreation(vm);
-        m_nameValue.set(vm, this, jsString(&vm, name().string()));
-    }
-
-    static void visitChildren(JSCell*, SlotVisitor&);
-
-public:
-    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto)
-    {
-        return Structure::create(vm, globalObject, proto, TypeInfo(UnlinkedFunctionExecutableType, StructureFlags), info());
-    }
-
-    DECLARE_EXPORT_INFO;
-};
-
 struct UnlinkedStringJumpTable {
     typedef HashMap<RefPtr<StringImpl>, int32_t> StringOffsetTable;
     StringOffsetTable offsetTable;

Copied: trunk/Source/_javascript_Core/bytecode/UnlinkedFunctionExecutable.cpp (from rev 188219, trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp) (0 => 188242)


--- trunk/Source/_javascript_Core/bytecode/UnlinkedFunctionExecutable.cpp	                        (rev 0)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedFunctionExecutable.cpp	2015-08-11 01:26:30 UTC (rev 188242)
@@ -0,0 +1,214 @@
+/*
+ * Copyright (C) 2012, 2013, 2015 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "UnlinkedFunctionExecutable.h"
+
+#include "BytecodeGenerator.h"
+#include "ClassInfo.h"
+#include "CodeCache.h"
+#include "Executable.h"
+#include "ExecutableInfo.h"
+#include "FunctionOverrides.h"
+#include "JSCInlines.h"
+#include "JSString.h"
+#include "Parser.h"
+#include "SourceProvider.h"
+#include "Structure.h"
+#include "SymbolTable.h"
+#include "UnlinkedInstructionStream.h"
+#include <wtf/DataLog.h>
+
+namespace JSC {
+
+static_assert(sizeof(UnlinkedFunctionExecutable) <= 256, "UnlinkedFunctionExecutable should fit in a 256-byte cell.");
+
+const ClassInfo UnlinkedFunctionExecutable::s_info = { "UnlinkedFunctionExecutable", 0, 0, CREATE_METHOD_TABLE(UnlinkedFunctionExecutable) };
+
+static UnlinkedFunctionCodeBlock* generateFunctionCodeBlock(
+    VM& vm, UnlinkedFunctionExecutable* executable, const SourceCode& source,
+    CodeSpecializationKind kind, DebuggerMode debuggerMode, ProfilerMode profilerMode,
+    UnlinkedFunctionKind functionKind, ParserError& error)
+{
+    JSParserBuiltinMode builtinMode = executable->isBuiltinFunction() ? JSParserBuiltinMode::Builtin : JSParserBuiltinMode::NotBuiltin;
+    JSParserStrictMode strictMode = executable->isInStrictContext() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
+    std::unique_ptr<FunctionNode> function = parse<FunctionNode>(
+        &vm, source, executable->name(), builtinMode, strictMode, 
+        JSParserCodeType::Function, error, nullptr, executable->parseMode());
+
+    if (!function) {
+        ASSERT(error.isValid());
+        return nullptr;
+    }
+
+    function->finishParsing(executable->name(), executable->functionMode());
+    executable->recordParse(function->features(), function->hasCapturedVariables());
+    
+    UnlinkedFunctionCodeBlock* result = UnlinkedFunctionCodeBlock::create(&vm, FunctionCode,
+        ExecutableInfo(function->needsActivation(), function->usesEval(), function->isStrictMode(), kind == CodeForConstruct, functionKind == UnlinkedBuiltinFunction, executable->constructorKind()));
+    auto generator(std::make_unique<BytecodeGenerator>(vm, function.get(), result, debuggerMode, profilerMode, executable->parentScopeTDZVariables()));
+    error = generator->generate();
+    if (error.isValid())
+        return nullptr;
+    return result;
+}
+
+UnlinkedFunctionExecutable::UnlinkedFunctionExecutable(VM* vm, Structure* structure, const SourceCode& source, RefPtr<SourceProvider>&& sourceOverride, FunctionMetadataNode* node, UnlinkedFunctionKind kind, ConstructAbility constructAbility, VariableEnvironment& parentScopeTDZVariables)
+    : Base(*vm, structure)
+    , m_name(node->ident())
+    , m_inferredName(node->inferredName())
+    , m_sourceOverride(WTF::move(sourceOverride))
+    , m_firstLineOffset(node->firstLine() - source.firstLine())
+    , m_lineCount(node->lastLine() - node->firstLine())
+    , m_unlinkedFunctionNameStart(node->functionNameStart() - source.startOffset())
+    , m_unlinkedBodyStartColumn(node->startColumn())
+    , m_unlinkedBodyEndColumn(m_lineCount ? node->endColumn() : node->endColumn() - node->startColumn())
+    , m_startOffset(node->source().startOffset() - source.startOffset())
+    , m_sourceLength(node->source().length())
+    , m_parametersStartOffset(node->parametersStart())
+    , m_typeProfilingStartOffset(node->functionKeywordStart())
+    , m_typeProfilingEndOffset(node->startStartOffset() + node->source().length() - 1)
+    , m_parameterCount(node->parameterCount())
+    , m_parseMode(node->parseMode())
+    , m_features(0)
+    , m_isInStrictContext(node->isInStrictContext())
+    , m_hasCapturedVariables(false)
+    , m_isBuiltinFunction(kind == UnlinkedBuiltinFunction)
+    , m_constructAbility(static_cast<unsigned>(constructAbility))
+    , m_constructorKind(static_cast<unsigned>(node->constructorKind()))
+    , m_functionMode(node->functionMode())
+{
+    ASSERT(m_constructorKind == static_cast<unsigned>(node->constructorKind()));
+    m_parentScopeTDZVariables.swap(parentScopeTDZVariables);
+}
+
+void UnlinkedFunctionExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+    UnlinkedFunctionExecutable* thisObject = jsCast<UnlinkedFunctionExecutable*>(cell);
+    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+    Base::visitChildren(thisObject, visitor);
+    visitor.append(&thisObject->m_codeBlockForCall);
+    visitor.append(&thisObject->m_codeBlockForConstruct);
+    visitor.append(&thisObject->m_nameValue);
+}
+
+FunctionExecutable* UnlinkedFunctionExecutable::link(VM& vm, const SourceCode& ownerSource, int overrideLineNumber)
+{
+    SourceCode source = m_sourceOverride ? SourceCode(m_sourceOverride) : ownerSource;
+    unsigned firstLine = source.firstLine() + m_firstLineOffset;
+    unsigned startOffset = source.startOffset() + m_startOffset;
+    unsigned lineCount = m_lineCount;
+
+    // Adjust to one-based indexing.
+    bool startColumnIsOnFirstSourceLine = !m_firstLineOffset;
+    unsigned startColumn = m_unlinkedBodyStartColumn + (startColumnIsOnFirstSourceLine ? source.startColumn() : 1);
+    bool endColumnIsOnStartLine = !lineCount;
+    unsigned endColumn = m_unlinkedBodyEndColumn + (endColumnIsOnStartLine ? startColumn : 1);
+
+    SourceCode code(source.provider(), startOffset, startOffset + m_sourceLength, firstLine, startColumn);
+    FunctionOverrides::OverrideInfo overrideInfo;
+    bool hasFunctionOverride = false;
+
+    if (UNLIKELY(Options::functionOverrides())) {
+        hasFunctionOverride = FunctionOverrides::initializeOverrideFor(code, overrideInfo);
+        if (hasFunctionOverride) {
+            firstLine = overrideInfo.firstLine;
+            lineCount = overrideInfo.lineCount;
+            startColumn = overrideInfo.startColumn;
+            endColumn = overrideInfo.endColumn;
+            code = overrideInfo.sourceCode;
+        }
+    }
+
+    FunctionExecutable* result = FunctionExecutable::create(vm, code, this, firstLine, firstLine + lineCount, startColumn, endColumn);
+    if (overrideLineNumber != -1)
+        result->setOverrideLineNumber(overrideLineNumber);
+
+    if (UNLIKELY(hasFunctionOverride)) {
+        result->overrideParameterAndTypeProfilingStartEndOffsets(
+            overrideInfo.parametersStartOffset,
+            overrideInfo.typeProfilingStartOffset,
+            overrideInfo.typeProfilingEndOffset);
+    }
+
+    return result;
+}
+
+UnlinkedFunctionExecutable* UnlinkedFunctionExecutable::fromGlobalCode(
+    const Identifier& name, ExecState& exec, const SourceCode& source, 
+    JSObject*& exception, int overrideLineNumber)
+{
+    ParserError error;
+    VM& vm = exec.vm();
+    CodeCache* codeCache = vm.codeCache();
+    UnlinkedFunctionExecutable* executable = codeCache->getFunctionExecutableFromGlobalCode(vm, name, source, error);
+
+    auto& globalObject = *exec.lexicalGlobalObject();
+    if (globalObject.hasDebugger())
+        globalObject.debugger()->sourceParsed(&exec, source.provider(), error.line(), error.message());
+
+    if (error.isValid()) {
+        exception = error.toErrorObject(&globalObject, source, overrideLineNumber);
+        return nullptr;
+    }
+
+    return executable;
+}
+
+UnlinkedFunctionCodeBlock* UnlinkedFunctionExecutable::codeBlockFor(
+    VM& vm, const SourceCode& source, CodeSpecializationKind specializationKind, 
+    DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError& error)
+{
+    switch (specializationKind) {
+    case CodeForCall:
+        if (UnlinkedFunctionCodeBlock* codeBlock = m_codeBlockForCall.get())
+            return codeBlock;
+        break;
+    case CodeForConstruct:
+        if (UnlinkedFunctionCodeBlock* codeBlock = m_codeBlockForConstruct.get())
+            return codeBlock;
+        break;
+    }
+
+    UnlinkedFunctionCodeBlock* result = generateFunctionCodeBlock(
+        vm, this, source, specializationKind, debuggerMode, profilerMode, 
+        isBuiltinFunction() ? UnlinkedBuiltinFunction : UnlinkedNormalFunction, 
+        error);
+    
+    if (error.isValid())
+        return nullptr;
+
+    switch (specializationKind) {
+    case CodeForCall:
+        m_codeBlockForCall.set(vm, this, result);
+        break;
+    case CodeForConstruct:
+        m_codeBlockForConstruct.set(vm, this, result);
+        break;
+    }
+    return result;
+}
+
+} // namespace JSC

Copied: trunk/Source/_javascript_Core/bytecode/UnlinkedFunctionExecutable.h (from rev 188219, trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h) (0 => 188242)


--- trunk/Source/_javascript_Core/bytecode/UnlinkedFunctionExecutable.h	                        (rev 0)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedFunctionExecutable.h	2015-08-11 01:26:30 UTC (rev 188242)
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2012-2015 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UnlinkedFunctionExecutable_h
+#define UnlinkedFunctionExecutable_h
+
+#include "BytecodeConventions.h"
+#include "CodeSpecializationKind.h"
+#include "CodeType.h"
+#include "ConstructAbility.h"
+#include "ExpressionRangeInfo.h"
+#include "HandlerInfo.h"
+#include "Identifier.h"
+#include "JSCell.h"
+#include "JSString.h"
+#include "ParserModes.h"
+#include "RegExp.h"
+#include "SpecialPointer.h"
+#include "VariableEnvironment.h"
+#include "VirtualRegister.h"
+#include <wtf/RefCountedArray.h>
+#include <wtf/Vector.h>
+
+namespace JSC {
+
+class FunctionMetadataNode;
+class FunctionExecutable;
+class ParserError;
+class SourceCode;
+class SourceProvider;
+class UnlinkedFunctionCodeBlock;
+
+enum UnlinkedFunctionKind {
+    UnlinkedNormalFunction,
+    UnlinkedBuiltinFunction,
+};
+
+class UnlinkedFunctionExecutable final : public JSCell {
+public:
+    friend class BuiltinExecutables;
+    friend class CodeCache;
+    friend class VM;
+
+    typedef JSCell Base;
+    static const unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
+
+    static UnlinkedFunctionExecutable* create(VM* vm, const SourceCode& source, FunctionMetadataNode* node, UnlinkedFunctionKind unlinkedFunctionKind, ConstructAbility constructAbility, VariableEnvironment& parentScopeTDZVariables, RefPtr<SourceProvider>&& sourceOverride = nullptr)
+    {
+        UnlinkedFunctionExecutable* instance = new (NotNull, allocateCell<UnlinkedFunctionExecutable>(vm->heap))
+            UnlinkedFunctionExecutable(vm, vm->unlinkedFunctionExecutableStructure.get(), source, WTF::move(sourceOverride), node, unlinkedFunctionKind, constructAbility, parentScopeTDZVariables);
+        instance->finishCreation(*vm);
+        return instance;
+    }
+
+    const Identifier& name() const { return m_name; }
+    const Identifier& inferredName() const { return m_inferredName; }
+    JSString* nameValue() const { return m_nameValue.get(); }
+    unsigned parameterCount() const { return m_parameterCount; };
+    FunctionParseMode parseMode() const { return m_parseMode; };
+    bool isInStrictContext() const { return m_isInStrictContext; }
+    FunctionMode functionMode() const { return static_cast<FunctionMode>(m_functionMode); }
+    ConstructorKind constructorKind() const { return static_cast<ConstructorKind>(m_constructorKind); }
+
+    unsigned unlinkedFunctionNameStart() const { return m_unlinkedFunctionNameStart; }
+    unsigned unlinkedBodyStartColumn() const { return m_unlinkedBodyStartColumn; }
+    unsigned unlinkedBodyEndColumn() const { return m_unlinkedBodyEndColumn; }
+    unsigned startOffset() const { return m_startOffset; }
+    unsigned sourceLength() { return m_sourceLength; }
+    unsigned parametersStartOffset() const { return m_parametersStartOffset; }
+    unsigned typeProfilingStartOffset() const { return m_typeProfilingStartOffset; }
+    unsigned typeProfilingEndOffset() const { return m_typeProfilingEndOffset; }
+
+    UnlinkedFunctionCodeBlock* codeBlockFor(
+        VM&, const SourceCode&, CodeSpecializationKind, DebuggerMode, ProfilerMode, 
+        ParserError&);
+
+    static UnlinkedFunctionExecutable* fromGlobalCode(
+        const Identifier&, ExecState&, const SourceCode&, JSObject*& exception, 
+        int overrideLineNumber);
+
+    FunctionExecutable* link(VM&, const SourceCode&, int overrideLineNumber = -1);
+
+    void clearCodeForRecompilation()
+    {
+        m_codeBlockForCall.clear();
+        m_codeBlockForConstruct.clear();
+    }
+
+    void recordParse(CodeFeatures features, bool hasCapturedVariables)
+    {
+        m_features = features;
+        m_hasCapturedVariables = hasCapturedVariables;
+    }
+
+    CodeFeatures features() const { return m_features; }
+    bool hasCapturedVariables() const { return m_hasCapturedVariables; }
+
+    static const bool needsDestruction = true;
+    static void destroy(JSCell*);
+
+    bool isBuiltinFunction() const { return m_isBuiltinFunction; }
+    ConstructAbility constructAbility() const { return static_cast<ConstructAbility>(m_constructAbility); }
+    bool isClassConstructorFunction() const { return constructorKind() != ConstructorKind::None; }
+    const VariableEnvironment* parentScopeTDZVariables() const { return &m_parentScopeTDZVariables; }
+
+private:
+    UnlinkedFunctionExecutable(VM*, Structure*, const SourceCode&, RefPtr<SourceProvider>&& sourceOverride, FunctionMetadataNode*, UnlinkedFunctionKind, ConstructAbility, VariableEnvironment&);
+    WriteBarrier<UnlinkedFunctionCodeBlock> m_codeBlockForCall;
+    WriteBarrier<UnlinkedFunctionCodeBlock> m_codeBlockForConstruct;
+
+    Identifier m_name;
+    Identifier m_inferredName;
+    WriteBarrier<JSString> m_nameValue;
+    RefPtr<SourceProvider> m_sourceOverride;
+    VariableEnvironment m_parentScopeTDZVariables;
+    unsigned m_firstLineOffset;
+    unsigned m_lineCount;
+    unsigned m_unlinkedFunctionNameStart;
+    unsigned m_unlinkedBodyStartColumn;
+    unsigned m_unlinkedBodyEndColumn;
+    unsigned m_startOffset;
+    unsigned m_sourceLength;
+    unsigned m_parametersStartOffset;
+    unsigned m_typeProfilingStartOffset;
+    unsigned m_typeProfilingEndOffset;
+    unsigned m_parameterCount;
+    FunctionParseMode m_parseMode;
+
+    CodeFeatures m_features;
+
+    unsigned m_isInStrictContext : 1;
+    unsigned m_hasCapturedVariables : 1;
+    unsigned m_isBuiltinFunction : 1;
+    unsigned m_constructAbility: 1;
+    unsigned m_constructorKind : 2;
+    unsigned m_functionMode : 1; // FunctionMode
+
+protected:
+    void finishCreation(VM& vm)
+    {
+        Base::finishCreation(vm);
+        m_nameValue.set(vm, this, jsString(&vm, name().string()));
+    }
+
+    static void visitChildren(JSCell*, SlotVisitor&);
+
+public:
+    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto)
+    {
+        return Structure::create(vm, globalObject, proto, TypeInfo(UnlinkedFunctionExecutableType, StructureFlags), info());
+    }
+
+    DECLARE_EXPORT_INFO;
+};
+
+} // namespace JSC
+
+#endif // UnlinkedFunctionExecutable_h

Modified: trunk/Source/_javascript_Core/runtime/Executable.h (188241 => 188242)


--- trunk/Source/_javascript_Core/runtime/Executable.h	2015-08-11 01:11:11 UTC (rev 188241)
+++ trunk/Source/_javascript_Core/runtime/Executable.h	2015-08-11 01:26:30 UTC (rev 188242)
@@ -32,6 +32,7 @@
 #include "CodeSpecializationKind.h"
 #include "CompilationResult.h"
 #include "DFGPlan.h"
+#include "ExecutableInfo.h"
 #include "HandlerInfo.h"
 #include "InferredValue.h"
 #include "JITCode.h"
@@ -41,6 +42,7 @@
 #include "SourceCode.h"
 #include "TypeSet.h"
 #include "UnlinkedCodeBlock.h"
+#include "UnlinkedFunctionExecutable.h"
 
 namespace JSC {
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to