Split InlineCallFrame into its own file
https://bugs.webkit.org/show_bug.cgi?id=148131
Reviewed by Saam Barati.
* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CallLinkStatus.cpp:
* bytecode/CodeBlock.h:
(JSC::ExecState::r):
(JSC::baselineCodeBlockForInlineCallFrame): Deleted.
(JSC::baselineCodeBlockForOriginAndBaselineCodeBlock): Deleted.
* bytecode/CodeOrigin.cpp:
(JSC::CodeOrigin::inlineStack):
(JSC::CodeOrigin::codeOriginOwner):
(JSC::CodeOrigin::stackOffset):
(JSC::CodeOrigin::dump):
(JSC::CodeOrigin::dumpInContext):
(JSC::InlineCallFrame::calleeConstant): Deleted.
(JSC::InlineCallFrame::visitAggregate): Deleted.
(JSC::InlineCallFrame::calleeForCallFrame): Deleted.
(JSC::InlineCallFrame::hash): Deleted.
(JSC::InlineCallFrame::hashAsStringIfPossible): Deleted.
(JSC::InlineCallFrame::inferredName): Deleted.
(JSC::InlineCallFrame::baselineCodeBlock): Deleted.
(JSC::InlineCallFrame::dumpBriefFunctionInformation): Deleted.
(JSC::InlineCallFrame::dumpInContext): Deleted.
(JSC::InlineCallFrame::dump): Deleted.
(WTF::printInternal): Deleted.
* bytecode/CodeOrigin.h:
(JSC::CodeOrigin::deletedMarker):
(JSC::CodeOrigin::hash):
(JSC::CodeOrigin::operator==):
(JSC::CodeOriginHash::hash):
(JSC::CodeOriginHash::equal):
(JSC::InlineCallFrame::kindFor): Deleted.
(JSC::InlineCallFrame::varargsKindFor): Deleted.
(JSC::InlineCallFrame::specializationKindFor): Deleted.
(JSC::InlineCallFrame::isVarargs): Deleted.
(JSC::InlineCallFrame::InlineCallFrame): Deleted.
(JSC::InlineCallFrame::specializationKind): Deleted.
(JSC::InlineCallFrame::setStackOffset): Deleted.
(JSC::InlineCallFrame::callerFrameOffset): Deleted.
(JSC::InlineCallFrame::returnPCOffset): Deleted.
(JSC::CodeOrigin::stackOffset): Deleted.
(JSC::CodeOrigin::codeOriginOwner): Deleted.
* bytecode/InlineCallFrame.cpp: Copied from Source/JavaScriptCore/bytecode/CodeOrigin.cpp.
(JSC::InlineCallFrame::calleeConstant):
(JSC::CodeOrigin::inlineDepthForCallFrame): Deleted.
(JSC::CodeOrigin::inlineDepth): Deleted.
(JSC::CodeOrigin::isApproximatelyEqualTo): Deleted.
(JSC::CodeOrigin::approximateHash): Deleted.
(JSC::CodeOrigin::inlineStack): Deleted.
(JSC::CodeOrigin::dump): Deleted.
(JSC::CodeOrigin::dumpInContext): Deleted.
* bytecode/InlineCallFrame.h: Copied from Source/JavaScriptCore/bytecode/CodeOrigin.h.
(JSC::InlineCallFrame::isVarargs):
(JSC::InlineCallFrame::InlineCallFrame):
(JSC::InlineCallFrame::specializationKind):
(JSC::baselineCodeBlockForInlineCallFrame):
(JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):
(JSC::CodeOrigin::CodeOrigin): Deleted.
(JSC::CodeOrigin::isSet): Deleted.
(JSC::CodeOrigin::operator!): Deleted.
(JSC::CodeOrigin::isHashTableDeletedValue): Deleted.
(JSC::CodeOrigin::operator!=): Deleted.
(JSC::CodeOrigin::deletedMarker): Deleted.
(JSC::CodeOrigin::stackOffset): Deleted.
(JSC::CodeOrigin::hash): Deleted.
(JSC::CodeOrigin::operator==): Deleted.
(JSC::CodeOrigin::codeOriginOwner): Deleted.
(JSC::CodeOriginHash::hash): Deleted.
(JSC::CodeOriginHash::equal): Deleted.
(JSC::CodeOriginApproximateHash::hash): Deleted.
(JSC::CodeOriginApproximateHash::equal): Deleted.
* bytecode/InlineCallFrameSet.cpp:
* dfg/DFGCommonData.cpp:
* dfg/DFGOSRExitBase.cpp:
* dfg/DFGVariableEventStream.cpp:
* ftl/FTLOperations.cpp:
* interpreter/CallFrame.cpp:
* interpreter/StackVisitor.cpp:
* jit/AssemblyHelpers.h:
* profiler/ProfilerOriginStack.cpp:
* runtime/ClonedArguments.cpp:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@188585 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt
index ca9f09d..d225238 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
@@ -95,6 +95,7 @@
bytecode/ExitingJITType.cpp
bytecode/GetByIdStatus.cpp
bytecode/GetByIdVariant.cpp
+ bytecode/InlineCallFrame.cpp
bytecode/InlineCallFrameSet.cpp
bytecode/JumpTable.cpp
bytecode/LazyOperandValueProfile.cpp
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 97fe9fb..6ce5471 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,93 @@
+2015-08-18 Geoffrey Garen <ggaren@apple.com>
+
+ Split InlineCallFrame into its own file
+ https://bugs.webkit.org/show_bug.cgi?id=148131
+
+ Reviewed by Saam Barati.
+
+ * CMakeLists.txt:
+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * bytecode/CallLinkStatus.cpp:
+ * bytecode/CodeBlock.h:
+ (JSC::ExecState::r):
+ (JSC::baselineCodeBlockForInlineCallFrame): Deleted.
+ (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock): Deleted.
+ * bytecode/CodeOrigin.cpp:
+ (JSC::CodeOrigin::inlineStack):
+ (JSC::CodeOrigin::codeOriginOwner):
+ (JSC::CodeOrigin::stackOffset):
+ (JSC::CodeOrigin::dump):
+ (JSC::CodeOrigin::dumpInContext):
+ (JSC::InlineCallFrame::calleeConstant): Deleted.
+ (JSC::InlineCallFrame::visitAggregate): Deleted.
+ (JSC::InlineCallFrame::calleeForCallFrame): Deleted.
+ (JSC::InlineCallFrame::hash): Deleted.
+ (JSC::InlineCallFrame::hashAsStringIfPossible): Deleted.
+ (JSC::InlineCallFrame::inferredName): Deleted.
+ (JSC::InlineCallFrame::baselineCodeBlock): Deleted.
+ (JSC::InlineCallFrame::dumpBriefFunctionInformation): Deleted.
+ (JSC::InlineCallFrame::dumpInContext): Deleted.
+ (JSC::InlineCallFrame::dump): Deleted.
+ (WTF::printInternal): Deleted.
+ * bytecode/CodeOrigin.h:
+ (JSC::CodeOrigin::deletedMarker):
+ (JSC::CodeOrigin::hash):
+ (JSC::CodeOrigin::operator==):
+ (JSC::CodeOriginHash::hash):
+ (JSC::CodeOriginHash::equal):
+ (JSC::InlineCallFrame::kindFor): Deleted.
+ (JSC::InlineCallFrame::varargsKindFor): Deleted.
+ (JSC::InlineCallFrame::specializationKindFor): Deleted.
+ (JSC::InlineCallFrame::isVarargs): Deleted.
+ (JSC::InlineCallFrame::InlineCallFrame): Deleted.
+ (JSC::InlineCallFrame::specializationKind): Deleted.
+ (JSC::InlineCallFrame::setStackOffset): Deleted.
+ (JSC::InlineCallFrame::callerFrameOffset): Deleted.
+ (JSC::InlineCallFrame::returnPCOffset): Deleted.
+ (JSC::CodeOrigin::stackOffset): Deleted.
+ (JSC::CodeOrigin::codeOriginOwner): Deleted.
+ * bytecode/InlineCallFrame.cpp: Copied from Source/JavaScriptCore/bytecode/CodeOrigin.cpp.
+ (JSC::InlineCallFrame::calleeConstant):
+ (JSC::CodeOrigin::inlineDepthForCallFrame): Deleted.
+ (JSC::CodeOrigin::inlineDepth): Deleted.
+ (JSC::CodeOrigin::isApproximatelyEqualTo): Deleted.
+ (JSC::CodeOrigin::approximateHash): Deleted.
+ (JSC::CodeOrigin::inlineStack): Deleted.
+ (JSC::CodeOrigin::dump): Deleted.
+ (JSC::CodeOrigin::dumpInContext): Deleted.
+ * bytecode/InlineCallFrame.h: Copied from Source/JavaScriptCore/bytecode/CodeOrigin.h.
+ (JSC::InlineCallFrame::isVarargs):
+ (JSC::InlineCallFrame::InlineCallFrame):
+ (JSC::InlineCallFrame::specializationKind):
+ (JSC::baselineCodeBlockForInlineCallFrame):
+ (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):
+ (JSC::CodeOrigin::CodeOrigin): Deleted.
+ (JSC::CodeOrigin::isSet): Deleted.
+ (JSC::CodeOrigin::operator!): Deleted.
+ (JSC::CodeOrigin::isHashTableDeletedValue): Deleted.
+ (JSC::CodeOrigin::operator!=): Deleted.
+ (JSC::CodeOrigin::deletedMarker): Deleted.
+ (JSC::CodeOrigin::stackOffset): Deleted.
+ (JSC::CodeOrigin::hash): Deleted.
+ (JSC::CodeOrigin::operator==): Deleted.
+ (JSC::CodeOrigin::codeOriginOwner): Deleted.
+ (JSC::CodeOriginHash::hash): Deleted.
+ (JSC::CodeOriginHash::equal): Deleted.
+ (JSC::CodeOriginApproximateHash::hash): Deleted.
+ (JSC::CodeOriginApproximateHash::equal): Deleted.
+ * bytecode/InlineCallFrameSet.cpp:
+ * dfg/DFGCommonData.cpp:
+ * dfg/DFGOSRExitBase.cpp:
+ * dfg/DFGVariableEventStream.cpp:
+ * ftl/FTLOperations.cpp:
+ * interpreter/CallFrame.cpp:
+ * interpreter/StackVisitor.cpp:
+ * jit/AssemblyHelpers.h:
+ * profiler/ProfilerOriginStack.cpp:
+ * runtime/ClonedArguments.cpp:
+
2015-08-18 Mark Lam <mark.lam@apple.com>
Removed an unused param in Interpreter::initialize().
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
index ac39ea1..506247d 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
@@ -333,6 +333,7 @@
<ClCompile Include="..\bytecode\ExitingJITType.cpp" />
<ClCompile Include="..\bytecode\GetByIdStatus.cpp" />
<ClCompile Include="..\bytecode\GetByIdVariant.cpp" />
+ <ClCompile Include="..\bytecode\InlineCallFrame.cpp" />
<ClCompile Include="..\bytecode\InlineCallFrameSet.cpp" />
<ClCompile Include="..\bytecode\JumpTable.cpp" />
<ClCompile Include="..\bytecode\LazyOperandValueProfile.cpp" />
@@ -1015,6 +1016,7 @@
<ClInclude Include="..\bytecode\GetByIdVariant.h" />
<ClInclude Include="..\bytecode\HandlerInfo.h" />
<ClInclude Include="..\bytecode\InlineCallFrameSet.h" />
+ <ClInclude Include="..\bytecode\InlineCallFrame.h" />
<ClInclude Include="..\bytecode\Instruction.h" />
<ClInclude Include="..\bytecode\JumpTable.h" />
<ClInclude Include="..\bytecode\LazyOperandValueProfile.h" />
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
index 6d0fef8..0660f29 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
+++ b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
@@ -1398,6 +1398,9 @@
<ClCompile Include="..\jit\Repatch.cpp">
<Filter>jit</Filter>
</ClCompile>
+ <ClCompile Include="..\bytecode\InlineCallFrame.cpp">
+ <Filter>bytecode</Filter>
+ </ClCompile>
<ClCompile Include="..\bytecode\InlineCallFrameSet.cpp">
<Filter>bytecode</Filter>
</ClCompile>
@@ -3891,6 +3894,9 @@
<ClInclude Include="..\jit\RegisterSet.h">
<Filter>jit</Filter>
</ClInclude>
+ <ClInclude Include="..\bytecode\InlineCallFrame.h">
+ <Filter>bytecode</Filter>
+ </ClInclude>
<ClInclude Include="..\bytecode\InlineCallFrameSet.h">
<Filter>bytecode</Filter>
</ClInclude>
diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 33ca329..48ffcc6 100644
--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -881,6 +881,8 @@
1482B7E40A43076000517CFC /* JSObjectRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1482B7E20A43076000517CFC /* JSObjectRef.cpp */; };
14874AE515EBDE4A002E3587 /* JSScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14874AE115EBDE4A002E3587 /* JSScope.cpp */; };
14874AE615EBDE4A002E3587 /* JSScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 14874AE215EBDE4A002E3587 /* JSScope.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 148A7BEF1B82975A002D9157 /* InlineCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 148A7BED1B82975A002D9157 /* InlineCallFrame.cpp */; };
+ 148A7BF01B82975A002D9157 /* InlineCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 148A7BEE1B82975A002D9157 /* InlineCallFrame.h */; settings = {ATTRIBUTES = (Private, ); }; };
148CD1D8108CF902008163C6 /* JSContextRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 148CD1D7108CF902008163C6 /* JSContextRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
148F21AA107EC53A0042EC2C /* BytecodeGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07200ED1CE3300F1F681 /* BytecodeGenerator.cpp */; };
148F21B0107EC5410042EC2C /* Lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8650255597D01FF60F7 /* Lexer.cpp */; };
@@ -1696,13 +1698,13 @@
E33637A61B63220200EE0840 /* ReflectObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E33637A41B63220200EE0840 /* ReflectObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
E33B3E261B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = E33B3E251B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h */; };
E354622B1B6065D100545386 /* ConstructAbility.h in Headers */ = {isa = PBXBuildFile; fileRef = E354622A1B6065D100545386 /* ConstructAbility.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ E35E035F1B7AB43E0073AD2A /* InspectorInstrumentationObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E35E035D1B7AB43E0073AD2A /* InspectorInstrumentationObject.cpp */; };
+ E35E03601B7AB43E0073AD2A /* InspectorInstrumentationObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E35E035E1B7AB43E0073AD2A /* InspectorInstrumentationObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
E3794E751B77EB97005543AE /* ModuleAnalyzer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3794E731B77EB97005543AE /* ModuleAnalyzer.cpp */; };
E3794E761B77EB97005543AE /* ModuleAnalyzer.h in Headers */ = {isa = PBXBuildFile; fileRef = E3794E741B77EB97005543AE /* ModuleAnalyzer.h */; settings = {ATTRIBUTES = (Private, ); }; };
E3963CED1B73F75000EB4CE5 /* ModuleRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = E3963CEB1B73F75000EB4CE5 /* ModuleRecord.h */; settings = {ATTRIBUTES = (Private, ); }; };
E3963CEE1B73F75000EB4CE5 /* NodesAnalyzeModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3963CEC1B73F75000EB4CE5 /* NodesAnalyzeModule.cpp */; };
E3C09F551B79692A00EE36A2 /* ModuleRecord.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3C09F541B79692A00EE36A2 /* ModuleRecord.cpp */; };
- E35E035F1B7AB43E0073AD2A /* InspectorInstrumentationObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E35E035D1B7AB43E0073AD2A /* InspectorInstrumentationObject.cpp */; };
- E35E03601B7AB43E0073AD2A /* InspectorInstrumentationObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E35E035E1B7AB43E0073AD2A /* InspectorInstrumentationObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
E3EF88741B66DF23003F26CB /* JSPropertyNameIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3EF88721B66DF23003F26CB /* JSPropertyNameIterator.cpp */; };
E3EF88751B66DF23003F26CB /* JSPropertyNameIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E3EF88731B66DF23003F26CB /* JSPropertyNameIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
E49DC16B12EF293E00184A1F /* SourceProviderCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E49DC15512EF277200184A1F /* SourceProviderCache.cpp */; };
@@ -2629,6 +2631,8 @@
1482B7E20A43076000517CFC /* JSObjectRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSObjectRef.cpp; sourceTree = "<group>"; };
14874AE115EBDE4A002E3587 /* JSScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScope.cpp; sourceTree = "<group>"; };
14874AE215EBDE4A002E3587 /* JSScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScope.h; sourceTree = "<group>"; };
+ 148A7BED1B82975A002D9157 /* InlineCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineCallFrame.cpp; sourceTree = "<group>"; };
+ 148A7BEE1B82975A002D9157 /* InlineCallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineCallFrame.h; sourceTree = "<group>"; };
148CD1D7108CF902008163C6 /* JSContextRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSContextRefPrivate.h; sourceTree = "<group>"; };
149559ED0DDCDDF700648087 /* DebuggerCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DebuggerCallFrame.cpp; sourceTree = "<group>"; };
149B24FF0D8AF6D1009CB8C7 /* Register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Register.h; sourceTree = "<group>"; };
@@ -3528,16 +3532,16 @@
E18E3A570DF9278C00D90B34 /* VM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = VM.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
E33637A31B63220200EE0840 /* ReflectObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReflectObject.cpp; sourceTree = "<group>"; };
E33637A41B63220200EE0840 /* ReflectObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReflectObject.h; sourceTree = "<group>"; };
- E33B3E251B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InspectorInstrumentationObject.lut.h; path = InspectorInstrumentationObject.lut.h; sourceTree = "<group>"; };
+ E33B3E251B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentationObject.lut.h; sourceTree = "<group>"; };
E354622A1B6065D100545386 /* ConstructAbility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstructAbility.h; sourceTree = "<group>"; };
+ E35E035D1B7AB43E0073AD2A /* InspectorInstrumentationObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorInstrumentationObject.cpp; sourceTree = "<group>"; };
+ E35E035E1B7AB43E0073AD2A /* InspectorInstrumentationObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentationObject.h; sourceTree = "<group>"; };
+ E35E03611B7AB4850073AD2A /* InspectorInstrumentationObject.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = InspectorInstrumentationObject.js; sourceTree = "<group>"; };
E3794E731B77EB97005543AE /* ModuleAnalyzer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleAnalyzer.cpp; sourceTree = "<group>"; };
E3794E741B77EB97005543AE /* ModuleAnalyzer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleAnalyzer.h; sourceTree = "<group>"; };
E3963CEB1B73F75000EB4CE5 /* ModuleRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleRecord.h; sourceTree = "<group>"; };
E3963CEC1B73F75000EB4CE5 /* NodesAnalyzeModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NodesAnalyzeModule.cpp; sourceTree = "<group>"; };
E3C09F541B79692A00EE36A2 /* ModuleRecord.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleRecord.cpp; sourceTree = "<group>"; };
- E35E035D1B7AB43E0073AD2A /* InspectorInstrumentationObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorInstrumentationObject.cpp; sourceTree = "<group>"; };
- E35E035E1B7AB43E0073AD2A /* InspectorInstrumentationObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentationObject.h; sourceTree = "<group>"; };
- E35E03611B7AB4850073AD2A /* InspectorInstrumentationObject.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = InspectorInstrumentationObject.js; sourceTree = "<group>"; };
E3EF88721B66DF23003F26CB /* JSPropertyNameIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPropertyNameIterator.cpp; sourceTree = "<group>"; };
E3EF88731B66DF23003F26CB /* JSPropertyNameIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPropertyNameIterator.h; sourceTree = "<group>"; };
E49DC14912EF261A00184A1F /* SourceProviderCacheItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceProviderCacheItem.h; sourceTree = "<group>"; };
@@ -5476,6 +5480,8 @@
0F0332C118B01763005F979A /* GetByIdVariant.cpp */,
0F0332C218B01763005F979A /* GetByIdVariant.h */,
0F0B83A814BCF55E00885B4F /* HandlerInfo.h */,
+ 148A7BED1B82975A002D9157 /* InlineCallFrame.cpp */,
+ 148A7BEE1B82975A002D9157 /* InlineCallFrame.h */,
0F24E55317F0B71C00ABB217 /* InlineCallFrameSet.cpp */,
0F24E55417F0B71C00ABB217 /* InlineCallFrameSet.h */,
969A07930ED1D3AE00F1F681 /* Instruction.h */,
@@ -6088,6 +6094,7 @@
0FFFC95C14EF90AF00C72532 /* DFGPhase.h in Headers */,
A5EA70EE19F5B5C40098F5EC /* JSContextRefInspectorSupport.h in Headers */,
A78A977B179738B8009DF744 /* DFGPlan.h in Headers */,
+ 148A7BF01B82975A002D9157 /* InlineCallFrame.h in Headers */,
0FBE0F7516C1DB0B0082C5E8 /* DFGPredictionInjectionPhase.h in Headers */,
0FFFC95E14EF90B700C72532 /* DFGPredictionPropagationPhase.h in Headers */,
86EC9DD11328DF82002B2AD7 /* DFGRegisterBank.h in Headers */,
@@ -7608,6 +7615,7 @@
1421359B0A677F4F00A8195E /* JSBase.cpp in Sources */,
0F898F311B27689F0083A33C /* DFGIntegerRangeOptimizationPhase.cpp in Sources */,
86FA9E91142BBB2E001773B7 /* JSBoundFunction.cpp in Sources */,
+ 148A7BEF1B82975A002D9157 /* InlineCallFrame.cpp in Sources */,
1440F8AF0A508D200005F061 /* JSCallbackConstructor.cpp in Sources */,
1440F8920A508B100005F061 /* JSCallbackFunction.cpp in Sources */,
14ABDF600A437FEF00ECCA01 /* JSCallbackObject.cpp in Sources */,
diff --git a/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp b/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp
index 103a7f2..68eaff9 100644
--- a/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp
+++ b/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp
@@ -29,6 +29,7 @@
#include "CallLinkInfo.h"
#include "CodeBlock.h"
#include "DFGJITCode.h"
+#include "InlineCallFrame.h"
#include "LLIntCallLinkInfo.h"
#include "JSCInlines.h"
#include <wtf/CommaPrinter.h>
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h
index acf4321..381880d 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.h
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h
@@ -1136,21 +1136,6 @@
#endif
};
-inline CodeBlock* baselineCodeBlockForInlineCallFrame(InlineCallFrame* inlineCallFrame)
-{
- RELEASE_ASSERT(inlineCallFrame);
- ExecutableBase* executable = inlineCallFrame->executable.get();
- RELEASE_ASSERT(executable->structure()->classInfo() == FunctionExecutable::info());
- return static_cast<FunctionExecutable*>(executable)->baselineCodeBlockFor(inlineCallFrame->specializationKind());
-}
-
-inline CodeBlock* baselineCodeBlockForOriginAndBaselineCodeBlock(const CodeOrigin& codeOrigin, CodeBlock* baselineCodeBlock)
-{
- if (codeOrigin.inlineCallFrame)
- return baselineCodeBlockForInlineCallFrame(codeOrigin.inlineCallFrame);
- return baselineCodeBlock;
-}
-
inline Register& ExecState::r(int index)
{
CodeBlock* codeBlock = this->codeBlock();
diff --git a/Source/JavaScriptCore/bytecode/CodeOrigin.cpp b/Source/JavaScriptCore/bytecode/CodeOrigin.cpp
index 15f7591..6191b51 100644
--- a/Source/JavaScriptCore/bytecode/CodeOrigin.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeOrigin.cpp
@@ -29,6 +29,7 @@
#include "CallFrame.h"
#include "CodeBlock.h"
#include "Executable.h"
+#include "InlineCallFrame.h"
#include "JSCInlines.h"
namespace JSC {
@@ -114,6 +115,21 @@
return result;
}
+ScriptExecutable* CodeOrigin::codeOriginOwner() const
+{
+ if (!inlineCallFrame)
+ return 0;
+ return inlineCallFrame->executable.get();
+}
+
+int CodeOrigin::stackOffset() const
+{
+ if (!inlineCallFrame)
+ return 0;
+
+ return inlineCallFrame->stackOffset;
+}
+
void CodeOrigin::dump(PrintStream& out) const
{
if (!isSet()) {
@@ -141,107 +157,4 @@
dump(out);
}
-JSFunction* InlineCallFrame::calleeConstant() const
-{
- if (calleeRecovery.isConstant())
- return jsCast<JSFunction*>(calleeRecovery.constant());
- return nullptr;
-}
-
-void InlineCallFrame::visitAggregate(SlotVisitor& visitor)
-{
- // FIXME: This is an antipattern for two reasons. References introduced by the DFG
- // that aren't in the original CodeBlock being compiled should be weakly referenced.
- // Inline call frames aren't in the original CodeBlock, so they qualify as weak. Also,
- // those weak references should already be tracked in the DFG as weak FrozenValues. So,
- // there is probably no need for this. We already have assertions that this should be
- // unnecessary. Finally, just marking the executable and not anything else in the inline
- // call frame is almost certainly insufficient for what this method thought it was going
- // to accomplish.
- // https://bugs.webkit.org/show_bug.cgi?id=146613
- visitor.append(&executable);
-}
-
-JSFunction* InlineCallFrame::calleeForCallFrame(ExecState* exec) const
-{
- return jsCast<JSFunction*>(calleeRecovery.recover(exec));
-}
-
-CodeBlockHash InlineCallFrame::hash() const
-{
- return jsCast<FunctionExecutable*>(executable.get())->codeBlockFor(
- specializationKind())->hash();
-}
-
-CString InlineCallFrame::hashAsStringIfPossible() const
-{
- return jsCast<FunctionExecutable*>(executable.get())->codeBlockFor(
- specializationKind())->hashAsStringIfPossible();
-}
-
-CString InlineCallFrame::inferredName() const
-{
- return jsCast<FunctionExecutable*>(executable.get())->inferredName().utf8();
-}
-
-CodeBlock* InlineCallFrame::baselineCodeBlock() const
-{
- return jsCast<FunctionExecutable*>(executable.get())->baselineCodeBlockFor(specializationKind());
-}
-
-void InlineCallFrame::dumpBriefFunctionInformation(PrintStream& out) const
-{
- out.print(inferredName(), "#", hashAsStringIfPossible());
-}
-
-void InlineCallFrame::dumpInContext(PrintStream& out, DumpContext* context) const
-{
- out.print(briefFunctionInformation(), ":<", RawPointer(executable.get()));
- if (executable->isStrictMode())
- out.print(" (StrictMode)");
- out.print(", bc#", caller.bytecodeIndex, ", ", kind);
- if (isClosureCall)
- out.print(", closure call");
- else
- out.print(", known callee: ", inContext(calleeRecovery.constant(), context));
- out.print(", numArgs+this = ", arguments.size());
- out.print(", stackOffset = ", stackOffset);
- out.print(" (", virtualRegisterForLocal(0), " maps to ", virtualRegisterForLocal(0) + stackOffset, ")>");
-}
-
-void InlineCallFrame::dump(PrintStream& out) const
-{
- dumpInContext(out, 0);
-}
-
} // namespace JSC
-
-namespace WTF {
-
-void printInternal(PrintStream& out, JSC::InlineCallFrame::Kind kind)
-{
- switch (kind) {
- case JSC::InlineCallFrame::Call:
- out.print("Call");
- return;
- case JSC::InlineCallFrame::Construct:
- out.print("Construct");
- return;
- case JSC::InlineCallFrame::CallVarargs:
- out.print("CallVarargs");
- return;
- case JSC::InlineCallFrame::ConstructVarargs:
- out.print("ConstructVarargs");
- return;
- case JSC::InlineCallFrame::GetterCall:
- out.print("GetterCall");
- return;
- case JSC::InlineCallFrame::SetterCall:
- out.print("SetterCall");
- return;
- }
- RELEASE_ASSERT_NOT_REACHED();
-}
-
-} // namespace WTF
-
diff --git a/Source/JavaScriptCore/bytecode/CodeOrigin.h b/Source/JavaScriptCore/bytecode/CodeOrigin.h
index d1879a3..a454711 100644
--- a/Source/JavaScriptCore/bytecode/CodeOrigin.h
+++ b/Source/JavaScriptCore/bytecode/CodeOrigin.h
@@ -116,132 +116,6 @@
}
};
-struct InlineCallFrame {
- enum Kind {
- Call,
- Construct,
- CallVarargs,
- ConstructVarargs,
-
- // For these, the stackOffset incorporates the argument count plus the true return PC
- // slot.
- GetterCall,
- SetterCall
- };
-
- static Kind kindFor(CodeSpecializationKind kind)
- {
- switch (kind) {
- case CodeForCall:
- return Call;
- case CodeForConstruct:
- return Construct;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return Call;
- }
-
- static Kind varargsKindFor(CodeSpecializationKind kind)
- {
- switch (kind) {
- case CodeForCall:
- return CallVarargs;
- case CodeForConstruct:
- return ConstructVarargs;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return Call;
- }
-
- static CodeSpecializationKind specializationKindFor(Kind kind)
- {
- switch (kind) {
- case Call:
- case CallVarargs:
- case GetterCall:
- case SetterCall:
- return CodeForCall;
- case Construct:
- case ConstructVarargs:
- return CodeForConstruct;
- }
- RELEASE_ASSERT_NOT_REACHED();
- return CodeForCall;
- }
-
- static bool isVarargs(Kind kind)
- {
- switch (kind) {
- case CallVarargs:
- case ConstructVarargs:
- return true;
- default:
- return false;
- }
- }
- bool isVarargs() const
- {
- return isVarargs(static_cast<Kind>(kind));
- }
-
- Vector<ValueRecovery> arguments; // Includes 'this'.
- WriteBarrier<ScriptExecutable> executable;
- ValueRecovery calleeRecovery;
- CodeOrigin caller;
-
- signed stackOffset : 28;
- unsigned kind : 3; // real type is Kind
- bool isClosureCall : 1; // If false then we know that callee/scope are constants and the DFG won't treat them as variables, i.e. they have to be recovered manually.
- VirtualRegister argumentCountRegister; // Only set when we inline a varargs call.
-
- // There is really no good notion of a "default" set of values for
- // InlineCallFrame's fields. This constructor is here just to reduce confusion if
- // we forgot to initialize explicitly.
- InlineCallFrame()
- : stackOffset(0)
- , kind(Call)
- , isClosureCall(false)
- {
- }
-
- CodeSpecializationKind specializationKind() const { return specializationKindFor(static_cast<Kind>(kind)); }
-
- JSFunction* calleeConstant() const;
- void visitAggregate(SlotVisitor&);
-
- // Get the callee given a machine call frame to which this InlineCallFrame belongs.
- JSFunction* calleeForCallFrame(ExecState*) const;
-
- CString inferredName() const;
- CodeBlockHash hash() const;
- CString hashAsStringIfPossible() const;
-
- CodeBlock* baselineCodeBlock() const;
-
- void setStackOffset(signed offset)
- {
- stackOffset = offset;
- RELEASE_ASSERT(static_cast<signed>(stackOffset) == offset);
- }
-
- ptrdiff_t callerFrameOffset() const { return stackOffset * sizeof(Register) + CallFrame::callerFrameOffset(); }
- ptrdiff_t returnPCOffset() const { return stackOffset * sizeof(Register) + CallFrame::returnPCOffset(); }
-
- void dumpBriefFunctionInformation(PrintStream&) const;
- void dump(PrintStream&) const;
- void dumpInContext(PrintStream&, DumpContext*) const;
-
- MAKE_PRINT_METHOD(InlineCallFrame, dumpBriefFunctionInformation, briefFunctionInformation);
-};
-
-inline int CodeOrigin::stackOffset() const
-{
- if (!inlineCallFrame)
- return 0;
-
- return inlineCallFrame->stackOffset;
-}
-
inline unsigned CodeOrigin::hash() const
{
return WTF::IntHash<unsigned>::hash(bytecodeIndex) +
@@ -254,13 +128,6 @@
&& inlineCallFrame == other.inlineCallFrame;
}
-inline ScriptExecutable* CodeOrigin::codeOriginOwner() const
-{
- if (!inlineCallFrame)
- return 0;
- return inlineCallFrame->executable.get();
-}
-
struct CodeOriginHash {
static unsigned hash(const CodeOrigin& key) { return key.hash(); }
static bool equal(const CodeOrigin& a, const CodeOrigin& b) { return a == b; }
@@ -277,8 +144,6 @@
namespace WTF {
-void printInternal(PrintStream&, JSC::InlineCallFrame::Kind);
-
template<typename T> struct DefaultHash;
template<> struct DefaultHash<JSC::CodeOrigin> {
typedef JSC::CodeOriginHash Hash;
diff --git a/Source/JavaScriptCore/bytecode/InlineCallFrame.cpp b/Source/JavaScriptCore/bytecode/InlineCallFrame.cpp
new file mode 100644
index 0000000..9413165
--- /dev/null
+++ b/Source/JavaScriptCore/bytecode/InlineCallFrame.cpp
@@ -0,0 +1,139 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include "InlineCallFrame.h"
+
+#include "CallFrame.h"
+#include "CodeBlock.h"
+#include "Executable.h"
+#include "JSCInlines.h"
+
+namespace JSC {
+
+JSFunction* InlineCallFrame::calleeConstant() const
+{
+ if (calleeRecovery.isConstant())
+ return jsCast<JSFunction*>(calleeRecovery.constant());
+ return nullptr;
+}
+
+void InlineCallFrame::visitAggregate(SlotVisitor& visitor)
+{
+ // FIXME: This is an antipattern for two reasons. References introduced by the DFG
+ // that aren't in the original CodeBlock being compiled should be weakly referenced.
+ // Inline call frames aren't in the original CodeBlock, so they qualify as weak. Also,
+ // those weak references should already be tracked in the DFG as weak FrozenValues. So,
+ // there is probably no need for this. We already have assertions that this should be
+ // unnecessary. Finally, just marking the executable and not anything else in the inline
+ // call frame is almost certainly insufficient for what this method thought it was going
+ // to accomplish.
+ // https://bugs.webkit.org/show_bug.cgi?id=146613
+ visitor.append(&executable);
+}
+
+JSFunction* InlineCallFrame::calleeForCallFrame(ExecState* exec) const
+{
+ return jsCast<JSFunction*>(calleeRecovery.recover(exec));
+}
+
+CodeBlockHash InlineCallFrame::hash() const
+{
+ return jsCast<FunctionExecutable*>(executable.get())->codeBlockFor(
+ specializationKind())->hash();
+}
+
+CString InlineCallFrame::hashAsStringIfPossible() const
+{
+ return jsCast<FunctionExecutable*>(executable.get())->codeBlockFor(
+ specializationKind())->hashAsStringIfPossible();
+}
+
+CString InlineCallFrame::inferredName() const
+{
+ return jsCast<FunctionExecutable*>(executable.get())->inferredName().utf8();
+}
+
+CodeBlock* InlineCallFrame::baselineCodeBlock() const
+{
+ return jsCast<FunctionExecutable*>(executable.get())->baselineCodeBlockFor(specializationKind());
+}
+
+void InlineCallFrame::dumpBriefFunctionInformation(PrintStream& out) const
+{
+ out.print(inferredName(), "#", hashAsStringIfPossible());
+}
+
+void InlineCallFrame::dumpInContext(PrintStream& out, DumpContext* context) const
+{
+ out.print(briefFunctionInformation(), ":<", RawPointer(executable.get()));
+ if (executable->isStrictMode())
+ out.print(" (StrictMode)");
+ out.print(", bc#", caller.bytecodeIndex, ", ", kind);
+ if (isClosureCall)
+ out.print(", closure call");
+ else
+ out.print(", known callee: ", inContext(calleeRecovery.constant(), context));
+ out.print(", numArgs+this = ", arguments.size());
+ out.print(", stackOffset = ", stackOffset);
+ out.print(" (", virtualRegisterForLocal(0), " maps to ", virtualRegisterForLocal(0) + stackOffset, ")>");
+}
+
+void InlineCallFrame::dump(PrintStream& out) const
+{
+ dumpInContext(out, 0);
+}
+
+} // namespace JSC
+
+namespace WTF {
+
+void printInternal(PrintStream& out, JSC::InlineCallFrame::Kind kind)
+{
+ switch (kind) {
+ case JSC::InlineCallFrame::Call:
+ out.print("Call");
+ return;
+ case JSC::InlineCallFrame::Construct:
+ out.print("Construct");
+ return;
+ case JSC::InlineCallFrame::CallVarargs:
+ out.print("CallVarargs");
+ return;
+ case JSC::InlineCallFrame::ConstructVarargs:
+ out.print("ConstructVarargs");
+ return;
+ case JSC::InlineCallFrame::GetterCall:
+ out.print("GetterCall");
+ return;
+ case JSC::InlineCallFrame::SetterCall:
+ out.print("SetterCall");
+ return;
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+}
+
+} // namespace WTF
+
diff --git a/Source/JavaScriptCore/bytecode/InlineCallFrame.h b/Source/JavaScriptCore/bytecode/InlineCallFrame.h
new file mode 100644
index 0000000..e1b4809
--- /dev/null
+++ b/Source/JavaScriptCore/bytecode/InlineCallFrame.h
@@ -0,0 +1,191 @@
+/*
+ * Copyright (C) 2011-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 InlineCallFrame_h
+#define InlineCallFrame_h
+
+#include "CodeBlock.h"
+#include "CodeBlockHash.h"
+#include "CodeOrigin.h"
+#include "Executable.h"
+#include "ValueRecovery.h"
+#include "WriteBarrier.h"
+#include <wtf/BitVector.h>
+#include <wtf/HashMap.h>
+#include <wtf/PrintStream.h>
+#include <wtf/StdLibExtras.h>
+#include <wtf/Vector.h>
+
+namespace JSC {
+
+struct InlineCallFrame;
+class ExecState;
+class ScriptExecutable;
+class JSFunction;
+
+struct InlineCallFrame {
+ enum Kind {
+ Call,
+ Construct,
+ CallVarargs,
+ ConstructVarargs,
+
+ // For these, the stackOffset incorporates the argument count plus the true return PC
+ // slot.
+ GetterCall,
+ SetterCall
+ };
+
+ static Kind kindFor(CodeSpecializationKind kind)
+ {
+ switch (kind) {
+ case CodeForCall:
+ return Call;
+ case CodeForConstruct:
+ return Construct;
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+ return Call;
+ }
+
+ static Kind varargsKindFor(CodeSpecializationKind kind)
+ {
+ switch (kind) {
+ case CodeForCall:
+ return CallVarargs;
+ case CodeForConstruct:
+ return ConstructVarargs;
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+ return Call;
+ }
+
+ static CodeSpecializationKind specializationKindFor(Kind kind)
+ {
+ switch (kind) {
+ case Call:
+ case CallVarargs:
+ case GetterCall:
+ case SetterCall:
+ return CodeForCall;
+ case Construct:
+ case ConstructVarargs:
+ return CodeForConstruct;
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+ return CodeForCall;
+ }
+
+ static bool isVarargs(Kind kind)
+ {
+ switch (kind) {
+ case CallVarargs:
+ case ConstructVarargs:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ Vector<ValueRecovery> arguments; // Includes 'this'.
+ WriteBarrier<ScriptExecutable> executable;
+ ValueRecovery calleeRecovery;
+ CodeOrigin caller;
+
+ signed stackOffset : 28;
+ unsigned kind : 3; // real type is Kind
+ bool isClosureCall : 1; // If false then we know that callee/scope are constants and the DFG won't treat them as variables, i.e. they have to be recovered manually.
+ VirtualRegister argumentCountRegister; // Only set when we inline a varargs call.
+
+ // There is really no good notion of a "default" set of values for
+ // InlineCallFrame's fields. This constructor is here just to reduce confusion if
+ // we forgot to initialize explicitly.
+ InlineCallFrame()
+ : stackOffset(0)
+ , kind(Call)
+ , isClosureCall(false)
+ {
+ }
+
+ bool isVarargs() const
+ {
+ return isVarargs(static_cast<Kind>(kind));
+ }
+
+ CodeSpecializationKind specializationKind() const { return specializationKindFor(static_cast<Kind>(kind)); }
+
+ JSFunction* calleeConstant() const;
+ void visitAggregate(SlotVisitor&);
+
+ // Get the callee given a machine call frame to which this InlineCallFrame belongs.
+ JSFunction* calleeForCallFrame(ExecState*) const;
+
+ CString inferredName() const;
+ CodeBlockHash hash() const;
+ CString hashAsStringIfPossible() const;
+
+ CodeBlock* baselineCodeBlock() const;
+
+ void setStackOffset(signed offset)
+ {
+ stackOffset = offset;
+ RELEASE_ASSERT(static_cast<signed>(stackOffset) == offset);
+ }
+
+ ptrdiff_t callerFrameOffset() const { return stackOffset * sizeof(Register) + CallFrame::callerFrameOffset(); }
+ ptrdiff_t returnPCOffset() const { return stackOffset * sizeof(Register) + CallFrame::returnPCOffset(); }
+
+ void dumpBriefFunctionInformation(PrintStream&) const;
+ void dump(PrintStream&) const;
+ void dumpInContext(PrintStream&, DumpContext*) const;
+
+ MAKE_PRINT_METHOD(InlineCallFrame, dumpBriefFunctionInformation, briefFunctionInformation);
+
+};
+
+inline CodeBlock* baselineCodeBlockForInlineCallFrame(InlineCallFrame* inlineCallFrame)
+{
+ RELEASE_ASSERT(inlineCallFrame);
+ ScriptExecutable* executable = inlineCallFrame->executable.get();
+ RELEASE_ASSERT(executable->structure()->classInfo() == FunctionExecutable::info());
+ return static_cast<FunctionExecutable*>(executable)->baselineCodeBlockFor(inlineCallFrame->specializationKind());
+}
+
+inline CodeBlock* baselineCodeBlockForOriginAndBaselineCodeBlock(const CodeOrigin& codeOrigin, CodeBlock* baselineCodeBlock)
+{
+ if (codeOrigin.inlineCallFrame)
+ return baselineCodeBlockForInlineCallFrame(codeOrigin.inlineCallFrame);
+ return baselineCodeBlock;
+}
+
+} // namespace JSC
+
+namespace WTF {
+
+void printInternal(PrintStream&, JSC::InlineCallFrame::Kind);
+
+} // namespace WTF
+
+#endif // InlineCallFrame_h
diff --git a/Source/JavaScriptCore/bytecode/InlineCallFrameSet.cpp b/Source/JavaScriptCore/bytecode/InlineCallFrameSet.cpp
index 82e0f7f..e676f14 100644
--- a/Source/JavaScriptCore/bytecode/InlineCallFrameSet.cpp
+++ b/Source/JavaScriptCore/bytecode/InlineCallFrameSet.cpp
@@ -25,6 +25,8 @@
#include "config.h"
#include "InlineCallFrameSet.h"
+
+#include "InlineCallFrame.h"
#include "JSCInlines.h"
namespace JSC {
diff --git a/Source/JavaScriptCore/dfg/DFGCommonData.cpp b/Source/JavaScriptCore/dfg/DFGCommonData.cpp
index 881d19f..24d35e2 100644
--- a/Source/JavaScriptCore/dfg/DFGCommonData.cpp
+++ b/Source/JavaScriptCore/dfg/DFGCommonData.cpp
@@ -31,6 +31,7 @@
#include "CodeBlock.h"
#include "DFGNode.h"
#include "DFGPlan.h"
+#include "InlineCallFrame.h"
#include "JSCInlines.h"
#include "TrackedReferences.h"
#include "VM.h"
diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitBase.cpp b/Source/JavaScriptCore/dfg/DFGOSRExitBase.cpp
index afc50e8..0197f2c 100644
--- a/Source/JavaScriptCore/dfg/DFGOSRExitBase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOSRExitBase.cpp
@@ -31,6 +31,7 @@
#include "CodeBlock.h"
#include "DFGBasicBlock.h"
#include "DFGNode.h"
+#include "InlineCallFrame.h"
#include "JSCInlines.h"
namespace JSC { namespace DFG {
diff --git a/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp b/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp
index e3f413c..339ff09 100644
--- a/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp
+++ b/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp
@@ -31,6 +31,7 @@
#include "CodeBlock.h"
#include "DFGJITCode.h"
#include "DFGValueSource.h"
+#include "InlineCallFrame.h"
#include "JSCInlines.h"
#include <wtf/DataLog.h>
#include <wtf/HashMap.h>
diff --git a/Source/JavaScriptCore/ftl/FTLOperations.cpp b/Source/JavaScriptCore/ftl/FTLOperations.cpp
index a8bd57f..bbc4549 100644
--- a/Source/JavaScriptCore/ftl/FTLOperations.cpp
+++ b/Source/JavaScriptCore/ftl/FTLOperations.cpp
@@ -30,6 +30,7 @@
#include "ClonedArguments.h"
#include "DirectArguments.h"
+#include "InlineCallFrame.h"
#include "JSCInlines.h"
#include "JSLexicalEnvironment.h"
diff --git a/Source/JavaScriptCore/interpreter/CallFrame.cpp b/Source/JavaScriptCore/interpreter/CallFrame.cpp
index 259061d..f44e347 100644
--- a/Source/JavaScriptCore/interpreter/CallFrame.cpp
+++ b/Source/JavaScriptCore/interpreter/CallFrame.cpp
@@ -28,6 +28,7 @@
#include "CallFrameInlines.h"
#include "CodeBlock.h"
+#include "InlineCallFrame.h"
#include "Interpreter.h"
#include "JSLexicalEnvironment.h"
#include "JSCInlines.h"
diff --git a/Source/JavaScriptCore/interpreter/StackVisitor.cpp b/Source/JavaScriptCore/interpreter/StackVisitor.cpp
index 6fe792b..a1e9f12 100644
--- a/Source/JavaScriptCore/interpreter/StackVisitor.cpp
+++ b/Source/JavaScriptCore/interpreter/StackVisitor.cpp
@@ -29,6 +29,7 @@
#include "CallFrameInlines.h"
#include "ClonedArguments.h"
#include "Executable.h"
+#include "InlineCallFrame.h"
#include "Interpreter.h"
#include "JSCInlines.h"
#include <wtf/DataLog.h>
diff --git a/Source/JavaScriptCore/jit/AssemblyHelpers.h b/Source/JavaScriptCore/jit/AssemblyHelpers.h
index 0b7cc45..2557b44 100644
--- a/Source/JavaScriptCore/jit/AssemblyHelpers.h
+++ b/Source/JavaScriptCore/jit/AssemblyHelpers.h
@@ -31,6 +31,7 @@
#include "CodeBlock.h"
#include "FPRInfo.h"
#include "GPRInfo.h"
+#include "InlineCallFrame.h"
#include "JITCode.h"
#include "MacroAssembler.h"
#include "TypeofType.h"
diff --git a/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp b/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp
index 9b61dae..5c3242a 100644
--- a/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp
@@ -27,6 +27,7 @@
#include "ProfilerOriginStack.h"
#include "CodeOrigin.h"
+#include "InlineCallFrame.h"
#include "JSGlobalObject.h"
#include "JSCInlines.h"
#include "ProfilerDatabase.h"
diff --git a/Source/JavaScriptCore/runtime/ClonedArguments.cpp b/Source/JavaScriptCore/runtime/ClonedArguments.cpp
index 8a740db..fd8358a 100644
--- a/Source/JavaScriptCore/runtime/ClonedArguments.cpp
+++ b/Source/JavaScriptCore/runtime/ClonedArguments.cpp
@@ -27,6 +27,7 @@
#include "ClonedArguments.h"
#include "GetterSetter.h"
+#include "InlineCallFrame.h"
#include "JSCInlines.h"
namespace JSC {