Skip to content

Commit d707cee

Browse files
committed
JSC Sampling Profiler: Come up with a (program counter => CodeOrigin) mapping
https://bugs.webkit.org/show_bug.cgi?id=152629 Reviewed by Filip Pizlo. This patch implements a mapping from PC to CodeOrigin that lives off of JITed CodeBlocks. We build this mapping while JITing code, and then we compress it and store it on the CodeBlock. We only build the mapping if a debugger has ever been attached to any global object. CodeBlock consults this mapping when searching for a CodeOrigin for a given PC, but it also consults other code ranges off the main path that may own the PC. Specifically, it searches through inline caches, OSRExits, and LazySlowPaths. To find PC info for the LLInt, we also save the LLInt pc when taking a stack trace where the top frame is in LLInt code. This patch also cleans up code inside the SamplingProfier. I realized a bug in the SamplingProfiler's implementation. We used to walk the inline stack while gathering a stack trace. This is wrong. It's super dangerous to do this because we might pause the JSC process while it's modifying its CodeOrigin table. We used to walk the inline stack while taking a stack trace because doing so could save us from having to verify a particular stack trace. This patch changes that. We now have to verify all stack traces taken. This verification step includes walking the inline stack. Because we have a PC=>CodeOrigin map, we can now gather more detailed information about the top-frame we pause. This allows us to correctly observe inlining. It also allows us to observe expression-level line/column information for the top frame. The reason we don't consult this mapping for parent frames is that all parent frames should set the CallSiteIndex on the call frame header, which means we can consult that value to get inlining and expression-level line/column information. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::Label::Label): (JSC::AbstractMacroAssembler::Label::operator==): (JSC::AbstractMacroAssembler::Label::isSet): * assembler/AssemblerBuffer.h: (JSC::AssemblerLabel::labelAtOffset): (JSC::AssemblerLabel::operator==): * b3/B3Generate.cpp: * b3/B3Origin.h: (JSC::B3::Origin::data): (JSC::B3::Origin::operator==): * b3/B3PCToOriginMap.h: Added. (JSC::B3::PCToOriginMap::PCToOriginMap): (JSC::B3::PCToOriginMap::appendItem): (JSC::B3::PCToOriginMap::ranges): * b3/B3Procedure.h: (JSC::B3::Procedure::pcToOriginMap): (JSC::B3::Procedure::releasePCToOriginMap): * b3/air/AirGenerate.cpp: (JSC::B3::Air::generate): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler): (JSC::CodeBlock::setPCToCodeOriginMap): (JSC::CodeBlock::findPC): * bytecode/CodeBlock.h: (JSC::CodeBlock::jitCodeMap): (JSC::CodeBlock::bytecodeOffset): * bytecode/CodeOrigin.h: (JSC::CodeOrigin::operator==): (JSC::CodeOriginHash::hash): (JSC::CodeOriginHash::equal): * bytecode/InlineCallFrame.h: (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock): (JSC::CodeOrigin::walkUpInlineStack): * bytecode/PolymorphicAccess.h: (JSC::PolymorphicAccess::containsPC): * bytecode/StructureStubInfo.cpp: (JSC::StructureStubInfo::visitWeakReferences): (JSC::StructureStubInfo::containsPC): * bytecode/StructureStubInfo.h: * bytecode/UnlinkedCodeBlock.h: (JSC::UnlinkedCodeBlock::hasExpressionInfo): (JSC::UnlinkedCodeBlock::expressionInfo): (JSC::UnlinkedCodeBlock::setThisRegister): * debugger/Debugger.cpp: (JSC::Debugger::attach): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::validateReferences): (JSC::DFG::JITCode::findPC): * dfg/DFGJITCode.h: (JSC::DFG::JITCode::commonDataOffset): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::JITCompiler): (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): (JSC::DFG::JITCompiler::recordCallSiteAndGenerateExceptionHandlingOSRExitIfNeeded): (JSC::DFG::JITCompiler::setEndOfMainPath): (JSC::DFG::JITCompiler::setEndOfCode): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::setStartOfCode): (JSC::DFG::JITCompiler::setForNode): (JSC::DFG::JITCompiler::addCallSite): (JSC::DFG::JITCompiler::pcToCodeOriginMapBuilder): (JSC::DFG::JITCompiler::setEndOfMainPath): Deleted. (JSC::DFG::JITCompiler::setEndOfCode): Deleted. * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::call): (JSC::DFG::SlowPathGenerator::origin): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::addSlowPathGenerator): (JSC::DFG::SpeculativeJIT::runSlowPathGenerators): (JSC::DFG::SpeculativeJIT::compileCurrentBlock): * dfg/DFGSpeculativeJIT.h: * ftl/FTLB3Compile.cpp: (JSC::FTL::compile): * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite): (JSC::FTL::JITCode::findPC): * ftl/FTLJITCode.h: (JSC::FTL::JITCode::b3Code): * heap/MachineStackMarker.cpp: (JSC::MachineThreads::Thread::Registers::instructionPointer): (JSC::MachineThreads::Thread::Registers::llintPC): (JSC::MachineThreads::Thread::freeRegisters): * heap/MachineStackMarker.h: * inspector/agents/InspectorScriptProfilerAgent.cpp: (Inspector::InspectorScriptProfilerAgent::addEvent): (Inspector::buildSamples): (Inspector::InspectorScriptProfilerAgent::trackingComplete): * jit/JIT.cpp: (JSC::JIT::JIT): (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JIT.h: * jit/JITCode.h: (JSC::JITCode::findPC): * jit/PCToCodeOriginMap.cpp: Added. (JSC::PCToCodeOriginMapBuilder::PCToCodeOriginMapBuilder): (JSC::PCToCodeOriginMapBuilder::appendItem): (JSC::PCToCodeOriginMap::PCToCodeOriginMap): (JSC::PCToCodeOriginMap::~PCToCodeOriginMap): (JSC::PCToCodeOriginMap::memorySize): (JSC::PCToCodeOriginMap::findPC): * jit/PCToCodeOriginMap.h: Added. (JSC::PCToCodeOriginMapBuilder::defaultCodeOrigin): (JSC::PCToCodeOriginMapBuilder::didBuildMapping): * jsc.cpp: (functionSamplingProfilerStackTraces): * llint/LLIntPCRanges.h: (JSC::LLInt::isLLIntPC): * llint/LowLevelInterpreter.asm: * runtime/Options.h: * runtime/SamplingProfiler.cpp: (JSC::reportStats): (JSC::FrameWalker::FrameWalker): (JSC::FrameWalker::walk): (JSC::FrameWalker::resetAtMachineFrame): (JSC::FrameWalker::isValidFramePointer): (JSC::SamplingProfiler::SamplingProfiler): (JSC::SamplingProfiler::~SamplingProfiler): (JSC::tryGetBytecodeIndex): (JSC::SamplingProfiler::processUnverifiedStackTraces): (JSC::SamplingProfiler::visit): (JSC::SamplingProfiler::noticeVMEntry): (JSC::SamplingProfiler::clearData): (JSC::SamplingProfiler::StackFrame::displayName): (JSC::SamplingProfiler::StackFrame::displayNameForJSONTests): (JSC::SamplingProfiler::StackFrame::functionStartLine): (JSC::SamplingProfiler::StackFrame::functionStartColumn): (JSC::SamplingProfiler::StackFrame::sourceID): (JSC::SamplingProfiler::StackFrame::url): (JSC::SamplingProfiler::releaseStackTraces): (JSC::SamplingProfiler::stackTracesAsJSON): (WTF::printInternal): (JSC::SamplingProfiler::StackFrame::startLine): Deleted. (JSC::SamplingProfiler::StackFrame::startColumn): Deleted. (JSC::SamplingProfiler::stackTraces): Deleted. * runtime/SamplingProfiler.h: (JSC::SamplingProfiler::UnprocessedStackFrame::UnprocessedStackFrame): (JSC::SamplingProfiler::StackFrame::StackFrame): (JSC::SamplingProfiler::StackTrace::StackTrace): (JSC::SamplingProfiler::totalTime): (JSC::SamplingProfiler::setStopWatch): * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: (JSC::VM::setShouldBuildPCToCodeOriginMapping): (JSC::VM::shouldBuilderPCToCodeOriginMapping): * tests/stress/sampling-profiler-basic.js: (platformSupportsSamplingProfiler.top): (platformSupportsSamplingProfiler.jaz): (platformSupportsSamplingProfiler.kaz): Canonical link: https://commits.webkit.org/171746@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 2b50a58 commit d707cee

48 files changed

Lines changed: 1199 additions & 168 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Source/JavaScriptCore/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ set(JavaScriptCore_SOURCES
511511
jit/JITSubGenerator.cpp
512512
jit/JITThunks.cpp
513513
jit/JITToDFGDeferredCompilationCallback.cpp
514+
jit/PCToCodeOriginMap.cpp
514515
jit/PolymorphicCallStubRoutine.cpp
515516
jit/Reg.cpp
516517
jit/RegisterAtOffset.cpp

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,203 @@
1+
2016-01-29 Saam barati <sbarati@apple.com>
2+
3+
JSC Sampling Profiler: Come up with a (program counter => CodeOrigin) mapping
4+
https://bugs.webkit.org/show_bug.cgi?id=152629
5+
6+
Reviewed by Filip Pizlo.
7+
8+
This patch implements a mapping from PC to CodeOrigin
9+
that lives off of JITed CodeBlocks. We build this mapping
10+
while JITing code, and then we compress it and store
11+
it on the CodeBlock. We only build the mapping if a debugger
12+
has ever been attached to any global object.
13+
14+
CodeBlock consults this mapping when searching for a CodeOrigin
15+
for a given PC, but it also consults other code ranges
16+
off the main path that may own the PC. Specifically, it searches
17+
through inline caches, OSRExits, and LazySlowPaths.
18+
19+
To find PC info for the LLInt, we also save the LLInt pc when
20+
taking a stack trace where the top frame is in LLInt code.
21+
22+
This patch also cleans up code inside the SamplingProfier.
23+
I realized a bug in the SamplingProfiler's implementation.
24+
We used to walk the inline stack while gathering a stack
25+
trace. This is wrong. It's super dangerous to do this because
26+
we might pause the JSC process while it's modifying its
27+
CodeOrigin table. We used to walk the inline stack while
28+
taking a stack trace because doing so could save us from
29+
having to verify a particular stack trace. This patch changes that.
30+
We now have to verify all stack traces taken. This verification step
31+
includes walking the inline stack.
32+
33+
Because we have a PC=>CodeOrigin map, we can now gather more
34+
detailed information about the top-frame we pause. This allows
35+
us to correctly observe inlining. It also allows us to observe
36+
expression-level line/column information for the top frame.
37+
The reason we don't consult this mapping for parent frames is
38+
that all parent frames should set the CallSiteIndex on the call
39+
frame header, which means we can consult that value to get inlining
40+
and expression-level line/column information.
41+
42+
* CMakeLists.txt:
43+
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
44+
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
45+
* JavaScriptCore.xcodeproj/project.pbxproj:
46+
* assembler/AbstractMacroAssembler.h:
47+
(JSC::AbstractMacroAssembler::Label::Label):
48+
(JSC::AbstractMacroAssembler::Label::operator==):
49+
(JSC::AbstractMacroAssembler::Label::isSet):
50+
* assembler/AssemblerBuffer.h:
51+
(JSC::AssemblerLabel::labelAtOffset):
52+
(JSC::AssemblerLabel::operator==):
53+
* b3/B3Generate.cpp:
54+
* b3/B3Origin.h:
55+
(JSC::B3::Origin::data):
56+
(JSC::B3::Origin::operator==):
57+
* b3/B3PCToOriginMap.h: Added.
58+
(JSC::B3::PCToOriginMap::PCToOriginMap):
59+
(JSC::B3::PCToOriginMap::appendItem):
60+
(JSC::B3::PCToOriginMap::ranges):
61+
* b3/B3Procedure.h:
62+
(JSC::B3::Procedure::pcToOriginMap):
63+
(JSC::B3::Procedure::releasePCToOriginMap):
64+
* b3/air/AirGenerate.cpp:
65+
(JSC::B3::Air::generate):
66+
* bytecode/CodeBlock.cpp:
67+
(JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler):
68+
(JSC::CodeBlock::setPCToCodeOriginMap):
69+
(JSC::CodeBlock::findPC):
70+
* bytecode/CodeBlock.h:
71+
(JSC::CodeBlock::jitCodeMap):
72+
(JSC::CodeBlock::bytecodeOffset):
73+
* bytecode/CodeOrigin.h:
74+
(JSC::CodeOrigin::operator==):
75+
(JSC::CodeOriginHash::hash):
76+
(JSC::CodeOriginHash::equal):
77+
* bytecode/InlineCallFrame.h:
78+
(JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):
79+
(JSC::CodeOrigin::walkUpInlineStack):
80+
* bytecode/PolymorphicAccess.h:
81+
(JSC::PolymorphicAccess::containsPC):
82+
* bytecode/StructureStubInfo.cpp:
83+
(JSC::StructureStubInfo::visitWeakReferences):
84+
(JSC::StructureStubInfo::containsPC):
85+
* bytecode/StructureStubInfo.h:
86+
* bytecode/UnlinkedCodeBlock.h:
87+
(JSC::UnlinkedCodeBlock::hasExpressionInfo):
88+
(JSC::UnlinkedCodeBlock::expressionInfo):
89+
(JSC::UnlinkedCodeBlock::setThisRegister):
90+
* debugger/Debugger.cpp:
91+
(JSC::Debugger::attach):
92+
* dfg/DFGJITCode.cpp:
93+
(JSC::DFG::JITCode::validateReferences):
94+
(JSC::DFG::JITCode::findPC):
95+
* dfg/DFGJITCode.h:
96+
(JSC::DFG::JITCode::commonDataOffset):
97+
* dfg/DFGJITCompiler.cpp:
98+
(JSC::DFG::JITCompiler::JITCompiler):
99+
(JSC::DFG::JITCompiler::link):
100+
(JSC::DFG::JITCompiler::compile):
101+
(JSC::DFG::JITCompiler::compileFunction):
102+
(JSC::DFG::JITCompiler::recordCallSiteAndGenerateExceptionHandlingOSRExitIfNeeded):
103+
(JSC::DFG::JITCompiler::setEndOfMainPath):
104+
(JSC::DFG::JITCompiler::setEndOfCode):
105+
* dfg/DFGJITCompiler.h:
106+
(JSC::DFG::JITCompiler::setStartOfCode):
107+
(JSC::DFG::JITCompiler::setForNode):
108+
(JSC::DFG::JITCompiler::addCallSite):
109+
(JSC::DFG::JITCompiler::pcToCodeOriginMapBuilder):
110+
(JSC::DFG::JITCompiler::setEndOfMainPath): Deleted.
111+
(JSC::DFG::JITCompiler::setEndOfCode): Deleted.
112+
* dfg/DFGSlowPathGenerator.h:
113+
(JSC::DFG::SlowPathGenerator::call):
114+
(JSC::DFG::SlowPathGenerator::origin):
115+
* dfg/DFGSpeculativeJIT.cpp:
116+
(JSC::DFG::SpeculativeJIT::addSlowPathGenerator):
117+
(JSC::DFG::SpeculativeJIT::runSlowPathGenerators):
118+
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
119+
* dfg/DFGSpeculativeJIT.h:
120+
* ftl/FTLB3Compile.cpp:
121+
(JSC::FTL::compile):
122+
* ftl/FTLJITCode.cpp:
123+
(JSC::FTL::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite):
124+
(JSC::FTL::JITCode::findPC):
125+
* ftl/FTLJITCode.h:
126+
(JSC::FTL::JITCode::b3Code):
127+
* heap/MachineStackMarker.cpp:
128+
(JSC::MachineThreads::Thread::Registers::instructionPointer):
129+
(JSC::MachineThreads::Thread::Registers::llintPC):
130+
(JSC::MachineThreads::Thread::freeRegisters):
131+
* heap/MachineStackMarker.h:
132+
* inspector/agents/InspectorScriptProfilerAgent.cpp:
133+
(Inspector::InspectorScriptProfilerAgent::addEvent):
134+
(Inspector::buildSamples):
135+
(Inspector::InspectorScriptProfilerAgent::trackingComplete):
136+
* jit/JIT.cpp:
137+
(JSC::JIT::JIT):
138+
(JSC::JIT::privateCompileMainPass):
139+
(JSC::JIT::privateCompileSlowCases):
140+
(JSC::JIT::privateCompile):
141+
* jit/JIT.h:
142+
* jit/JITCode.h:
143+
(JSC::JITCode::findPC):
144+
* jit/PCToCodeOriginMap.cpp: Added.
145+
(JSC::PCToCodeOriginMapBuilder::PCToCodeOriginMapBuilder):
146+
(JSC::PCToCodeOriginMapBuilder::appendItem):
147+
(JSC::PCToCodeOriginMap::PCToCodeOriginMap):
148+
(JSC::PCToCodeOriginMap::~PCToCodeOriginMap):
149+
(JSC::PCToCodeOriginMap::memorySize):
150+
(JSC::PCToCodeOriginMap::findPC):
151+
* jit/PCToCodeOriginMap.h: Added.
152+
(JSC::PCToCodeOriginMapBuilder::defaultCodeOrigin):
153+
(JSC::PCToCodeOriginMapBuilder::didBuildMapping):
154+
* jsc.cpp:
155+
(functionSamplingProfilerStackTraces):
156+
* llint/LLIntPCRanges.h:
157+
(JSC::LLInt::isLLIntPC):
158+
* llint/LowLevelInterpreter.asm:
159+
* runtime/Options.h:
160+
* runtime/SamplingProfiler.cpp:
161+
(JSC::reportStats):
162+
(JSC::FrameWalker::FrameWalker):
163+
(JSC::FrameWalker::walk):
164+
(JSC::FrameWalker::resetAtMachineFrame):
165+
(JSC::FrameWalker::isValidFramePointer):
166+
(JSC::SamplingProfiler::SamplingProfiler):
167+
(JSC::SamplingProfiler::~SamplingProfiler):
168+
(JSC::tryGetBytecodeIndex):
169+
(JSC::SamplingProfiler::processUnverifiedStackTraces):
170+
(JSC::SamplingProfiler::visit):
171+
(JSC::SamplingProfiler::noticeVMEntry):
172+
(JSC::SamplingProfiler::clearData):
173+
(JSC::SamplingProfiler::StackFrame::displayName):
174+
(JSC::SamplingProfiler::StackFrame::displayNameForJSONTests):
175+
(JSC::SamplingProfiler::StackFrame::functionStartLine):
176+
(JSC::SamplingProfiler::StackFrame::functionStartColumn):
177+
(JSC::SamplingProfiler::StackFrame::sourceID):
178+
(JSC::SamplingProfiler::StackFrame::url):
179+
(JSC::SamplingProfiler::releaseStackTraces):
180+
(JSC::SamplingProfiler::stackTracesAsJSON):
181+
(WTF::printInternal):
182+
(JSC::SamplingProfiler::StackFrame::startLine): Deleted.
183+
(JSC::SamplingProfiler::StackFrame::startColumn): Deleted.
184+
(JSC::SamplingProfiler::stackTraces): Deleted.
185+
* runtime/SamplingProfiler.h:
186+
(JSC::SamplingProfiler::UnprocessedStackFrame::UnprocessedStackFrame):
187+
(JSC::SamplingProfiler::StackFrame::StackFrame):
188+
(JSC::SamplingProfiler::StackTrace::StackTrace):
189+
(JSC::SamplingProfiler::totalTime):
190+
(JSC::SamplingProfiler::setStopWatch):
191+
* runtime/VM.cpp:
192+
(JSC::VM::VM):
193+
* runtime/VM.h:
194+
(JSC::VM::setShouldBuildPCToCodeOriginMapping):
195+
(JSC::VM::shouldBuilderPCToCodeOriginMapping):
196+
* tests/stress/sampling-profiler-basic.js:
197+
(platformSupportsSamplingProfiler.top):
198+
(platformSupportsSamplingProfiler.jaz):
199+
(platformSupportsSamplingProfiler.kaz):
200+
1201
2016-01-29 Saam barati <sbarati@apple.com>
2202

3203
Remove our notion of having a single activation register

‎Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@
670670
<ClCompile Include="..\jit\JITThunks.cpp" />
671671
<ClCompile Include="..\jit\JITToDFGDeferredCompilationCallback.cpp" />
672672
<ClCompile Include="..\jit\SetupVarargsFrame.cpp" />
673+
<ClCompile Include="..\jit\PCToCodeOriginMap.cpp" />
673674
<ClCompile Include="..\jit\PolymorphicCallStubRoutine.cpp" />
674675
<ClCompile Include="..\jit\Reg.cpp" />
675676
<ClCompile Include="..\jit\RegisterAtOffset.cpp" />
@@ -1502,7 +1503,7 @@
15021503
<ClInclude Include="..\jit\JITToDFGDeferredCompilationCallback.h" />
15031504
<ClInclude Include="..\jit\JITWriteBarrier.h" />
15041505
<ClInclude Include="..\jit\JSInterfaceJIT.h" />
1505-
<ClInclude Include="..\jit\SetupVarargsFrame.h" />
1506+
<ClInclude Include="..\jit\PCToCodeOriginMap.h" />
15061507
<ClInclude Include="..\jit\PolymorphicCallStubRoutine.h" />
15071508
<ClInclude Include="..\jit\Reg.h" />
15081509
<ClInclude Include="..\jit\RegisterAtOffset.h" />
@@ -1511,6 +1512,7 @@
15111512
<ClInclude Include="..\jit\RegisterSet.h" />
15121513
<ClInclude Include="..\jit\Repatch.h" />
15131514
<ClInclude Include="..\jit\ScratchRegisterAllocator.h" />
1515+
<ClInclude Include="..\jit\SetupVarargsFrame.h" />
15141516
<ClInclude Include="..\jit\SnippetOperand.h" />
15151517
<ClInclude Include="..\jit\SpecializedThunkJIT.h" />
15161518
<ClInclude Include="..\jit\TempRegisterSet.h" />

‎Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,6 +1911,9 @@
19111911
<ClCompile Include="..\jit\BinarySwitch.cpp">
19121912
<Filter>jit</Filter>
19131913
</ClCompile>
1914+
<ClCompile Include="..\jit\PCToCodeOriginMap.cpp">
1915+
<Filter>jit</Filter>
1916+
</ClCompile>
19141917
<ClCompile Include="..\jit\PolymorphicCallStubRoutine.cpp">
19151918
<Filter>jit</Filter>
19161919
</ClCompile>
@@ -4596,6 +4599,9 @@
45964599
<ClInclude Include="..\dfg\DFGPreciseLocalClobberize.h">
45974600
<Filter>dfg</Filter>
45984601
</ClInclude>
4602+
<ClInclude Include="..\jit\PCToCodeOriginMap.h">
4603+
<Filter>jit</Filter>
4604+
</ClInclude>
45994605
<ClInclude Include="..\jit\PolymorphicCallStubRoutine.h">
46004606
<Filter>jit</Filter>
46014607
</ClInclude>

‎Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,9 +1305,12 @@
13051305
70ECA6071AFDBEA200449739 /* TemplateRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70ECA6021AFDBEA200449739 /* TemplateRegistry.cpp */; };
13061306
70ECA6081AFDBEA200449739 /* TemplateRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 70ECA6031AFDBEA200449739 /* TemplateRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
13071307
70ECA6091AFDBEA200449739 /* TemplateRegistryKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 70ECA6041AFDBEA200449739 /* TemplateRegistryKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
1308+
792CB3491C4EED5C00D13AF3 /* PCToCodeOriginMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 792CB3471C4EED5C00D13AF3 /* PCToCodeOriginMap.cpp */; };
1309+
792CB34A1C4EED5C00D13AF3 /* PCToCodeOriginMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 792CB3481C4EED5C00D13AF3 /* PCToCodeOriginMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
13081310
7964656A1B952FF0003059EE /* GetPutInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 796465681B952FF0003059EE /* GetPutInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
13091311
797E07A91B8FCFB9008400BA /* JSGlobalLexicalEnvironment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 797E07A71B8FCFB9008400BA /* JSGlobalLexicalEnvironment.cpp */; };
13101312
797E07AA1B8FCFB9008400BA /* JSGlobalLexicalEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = 797E07A81B8FCFB9008400BA /* JSGlobalLexicalEnvironment.h */; settings = {ATTRIBUTES = (Private, ); }; };
1313+
799EF7C41C56ED96002B0534 /* B3PCToOriginMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 799EF7C31C56ED96002B0534 /* B3PCToOriginMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
13111314
79C4B15D1BA2158F00FD592E /* DFGLiveCatchVariablePreservationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 79C4B15B1BA2158F00FD592E /* DFGLiveCatchVariablePreservationPhase.cpp */; };
13121315
79C4B15E1BA2158F00FD592E /* DFGLiveCatchVariablePreservationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 79C4B15C1BA2158F00FD592E /* DFGLiveCatchVariablePreservationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
13131316
79CFC6F01C33B10000C768EA /* LLIntPCRanges.h in Headers */ = {isa = PBXBuildFile; fileRef = 79CFC6EF1C33B10000C768EA /* LLIntPCRanges.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3502,9 +3505,12 @@
35023505
70ECA6021AFDBEA200449739 /* TemplateRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TemplateRegistry.cpp; sourceTree = "<group>"; };
35033506
70ECA6031AFDBEA200449739 /* TemplateRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateRegistry.h; sourceTree = "<group>"; };
35043507
70ECA6041AFDBEA200449739 /* TemplateRegistryKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateRegistryKey.h; sourceTree = "<group>"; };
3508+
792CB3471C4EED5C00D13AF3 /* PCToCodeOriginMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PCToCodeOriginMap.cpp; sourceTree = "<group>"; };
3509+
792CB3481C4EED5C00D13AF3 /* PCToCodeOriginMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PCToCodeOriginMap.h; sourceTree = "<group>"; };
35053510
796465681B952FF0003059EE /* GetPutInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetPutInfo.h; sourceTree = "<group>"; };
35063511
797E07A71B8FCFB9008400BA /* JSGlobalLexicalEnvironment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalLexicalEnvironment.cpp; sourceTree = "<group>"; };
35073512
797E07A81B8FCFB9008400BA /* JSGlobalLexicalEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalLexicalEnvironment.h; sourceTree = "<group>"; };
3513+
799EF7C31C56ED96002B0534 /* B3PCToOriginMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3PCToOriginMap.h; path = b3/B3PCToOriginMap.h; sourceTree = "<group>"; };
35083514
79C4B15B1BA2158F00FD592E /* DFGLiveCatchVariablePreservationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGLiveCatchVariablePreservationPhase.cpp; path = dfg/DFGLiveCatchVariablePreservationPhase.cpp; sourceTree = "<group>"; };
35093515
79C4B15C1BA2158F00FD592E /* DFGLiveCatchVariablePreservationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGLiveCatchVariablePreservationPhase.h; path = dfg/DFGLiveCatchVariablePreservationPhase.h; sourceTree = "<group>"; };
35103516
79CFC6EF1C33B10000C768EA /* LLIntPCRanges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntPCRanges.h; path = llint/LLIntPCRanges.h; sourceTree = "<group>"; };
@@ -4844,6 +4850,7 @@
48444850
0FEC84DC1BDACDAC0080FF74 /* B3PatchpointSpecial.h */,
48454851
0FEC84DD1BDACDAC0080FF74 /* B3PatchpointValue.cpp */,
48464852
0FEC84DE1BDACDAC0080FF74 /* B3PatchpointValue.h */,
4853+
799EF7C31C56ED96002B0534 /* B3PCToOriginMap.h */,
48474854
0FEC84DF1BDACDAC0080FF74 /* B3PhaseScope.cpp */,
48484855
0FEC84E01BDACDAC0080FF74 /* B3PhaseScope.h */,
48494856
0F37308A1C0BD29100052BFA /* B3PhiChildren.cpp */,
@@ -5155,6 +5162,8 @@
51555162
0FC712E117CD878F008CC93C /* JITToDFGDeferredCompilationCallback.h */,
51565163
A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */,
51575164
A76C51741182748D00715B05 /* JSInterfaceJIT.h */,
5165+
792CB3471C4EED5C00D13AF3 /* PCToCodeOriginMap.cpp */,
5166+
792CB3481C4EED5C00D13AF3 /* PCToCodeOriginMap.h */,
51585167
0FE834151A6EF97B00D04847 /* PolymorphicCallStubRoutine.cpp */,
51595168
0FE834161A6EF97B00D04847 /* PolymorphicCallStubRoutine.h */,
51605169
0FA7A8E918B413C80052371D /* Reg.cpp */,
@@ -7031,6 +7040,8 @@
70317040
0FEC85761BDACDC70080FF74 /* AirCode.h in Headers */,
70327041
0F3730931C0D67EE00052BFA /* AirUseCounts.h in Headers */,
70337042
0F4570391BE44C910062A629 /* AirEliminateDeadCode.h in Headers */,
7043+
799EF7C41C56ED96002B0534 /* B3PCToOriginMap.h in Headers */,
7044+
792CB34A1C4EED5C00D13AF3 /* PCToCodeOriginMap.h in Headers */,
70347045
79CFC6F01C33B10000C768EA /* LLIntPCRanges.h in Headers */,
70357046
79D5CD5B1C1106A900CECA07 /* SamplingProfiler.h in Headers */,
70367047
0F6183311C45BF070072450B /* AirLowerMacros.h in Headers */,
@@ -8978,6 +8989,7 @@
89788989
0F8F14351ADF090100ED792C /* DFGMovHintRemovalPhase.cpp in Sources */,
89798990
0FF2CD5B1B61A4F8004955A8 /* DFGMultiGetByOffsetData.cpp in Sources */,
89808991
A737810D1799EA2E00817533 /* DFGNaturalLoops.cpp in Sources */,
8992+
792CB3491C4EED5C00D13AF3 /* PCToCodeOriginMap.cpp in Sources */,
89818993
0FF0F19C16B72A03005DF95B /* DFGNode.cpp in Sources */,
89828994
0FB3878F1BFBC44D00E3AB1E /* AirOptimizeBlockOrder.cpp in Sources */,
89838995
0FA581BA150E952C00B9A2D9 /* DFGNodeFlags.cpp in Sources */,

‎Source/JavaScriptCore/assembler/AbstractMacroAssembler.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ class AbstractMacroAssembler {
396396
masm->invalidateAllTempRegisters();
397397
}
398398

399+
bool operator==(const Label& other) const { return m_label == other.m_label; }
400+
399401
bool isSet() const { return m_label.isSet(); }
400402
private:
401403
AssemblerLabel m_label;

‎Source/JavaScriptCore/assembler/AssemblerBuffer.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ namespace JSC {
5656
return AssemblerLabel(m_offset + offset);
5757
}
5858

59+
bool operator==(const AssemblerLabel& other) const { return m_offset == other.m_offset; }
60+
5961
uint32_t m_offset;
6062
};
6163

‎Source/JavaScriptCore/b3/B3Generate.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include "B3ReduceStrength.h"
4747
#include "B3TimingScope.h"
4848
#include "B3Validate.h"
49+
#include "PCToCodeOriginMap.h"
4950

5051
namespace JSC { namespace B3 {
5152

‎Source/JavaScriptCore/b3/B3Origin.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class Origin {
4747

4848
const void* data() const { return m_data; }
4949

50+
bool operator==(const Origin& other) const { return m_data == other.m_data; }
51+
5052
// You should avoid using this. Use OriginDump instead.
5153
void dump(PrintStream&) const;
5254

0 commit comments

Comments
 (0)