@@ -62,10 +62,10 @@ class JITMathIC {
6262 {
6363 }
6464
65- CodeLocationLabel<JSInternalPtrTag> doneLocation () { return m_inlineStart. labelAtOffset (m_inlineSize) ; }
66- CodeLocationLabel <JSInternalPtrTag> slowPathStartLocation () { return m_inlineStart. labelAtOffset (m_deltaFromStartToSlowPathStart) ; }
67- CodeLocationCall <JSInternalPtrTag> slowPathCallLocation () { return m_inlineStart. callAtOffset (m_deltaFromStartToSlowPathCallLocation) ; }
68-
65+ CodeLocationLabel<JSInternalPtrTag> doneLocation () { return m_inlineEnd ; }
66+ CodeLocationCall <JSInternalPtrTag> slowPathCallLocation () { return m_slowPathCallLocation ; }
67+ CodeLocationLabel <JSInternalPtrTag> slowPathStartLocation () { return m_slowPathStartLocation ; }
68+
6969 bool generateInline (CCallHelpers& jit, MathICGenerationState& state, bool shouldEmitProfiling = true )
7070 {
7171#if CPU(ARM_TRADITIONAL)
@@ -136,7 +136,7 @@ class JITMathIC {
136136 auto jump = jit.jump ();
137137 // We don't need a nop sled here because nobody should be jumping into the middle of an IC.
138138 bool needsBranchCompaction = false ;
139- RELEASE_ASSERT (jit.m_assembler .buffer ().codeSize () <= static_cast <size_t >(m_inlineSize ));
139+ RELEASE_ASSERT (jit.m_assembler .buffer ().codeSize () <= static_cast <size_t >(MacroAssembler::differenceBetweenCodePtr (m_inlineStart, m_inlineEnd) ));
140140 LinkBuffer linkBuffer (jit, m_inlineStart, jit.m_assembler .buffer ().codeSize (), JITCompilationMustSucceed, needsBranchCompaction);
141141 RELEASE_ASSERT (linkBuffer.isValid ());
142142 linkBuffer.link (jump, CodeLocationLabel<JITStubRoutinePtrTag>(m_code.code ()));
@@ -224,14 +224,11 @@ class JITMathIC {
224224 CodeLocationLabel<JSInternalPtrTag> start = linkBuffer.locationOf <JSInternalPtrTag>(state.fastPathStart );
225225 m_inlineStart = start;
226226
227- m_inlineSize = MacroAssembler::differenceBetweenCodePtr (
228- start, linkBuffer.locationOf <NoPtrTag>(state.fastPathEnd ));
229- ASSERT (m_inlineSize > 0 );
227+ m_inlineEnd = linkBuffer.locationOf <JSInternalPtrTag>(state.fastPathEnd );
228+ ASSERT (m_inlineEnd.untaggedExecutableAddress () > m_inlineStart.untaggedExecutableAddress ());
230229
231- m_deltaFromStartToSlowPathCallLocation = MacroAssembler::differenceBetweenCodePtr (
232- start, linkBuffer.locationOf <NoPtrTag>(state.slowPathCall ));
233- m_deltaFromStartToSlowPathStart = MacroAssembler::differenceBetweenCodePtr (
234- start, linkBuffer.locationOf <NoPtrTag>(state.slowPathStart ));
230+ m_slowPathCallLocation = linkBuffer.locationOf <JSInternalPtrTag>(state.slowPathCall );
231+ m_slowPathStartLocation = linkBuffer.locationOf <JSInternalPtrTag>(state.slowPathStart );
235232 }
236233
237234 ArithProfile* arithProfile () const { return m_arithProfile; }
@@ -252,9 +249,9 @@ class JITMathIC {
252249 Instruction* m_instruction;
253250 MacroAssemblerCodeRef<JITStubRoutinePtrTag> m_code;
254251 CodeLocationLabel<JSInternalPtrTag> m_inlineStart;
255- int32_t m_inlineSize ;
256- int32_t m_deltaFromStartToSlowPathCallLocation ;
257- int32_t m_deltaFromStartToSlowPathStart ;
252+ CodeLocationLabel<JSInternalPtrTag> m_inlineEnd ;
253+ CodeLocationLabel<JSInternalPtrTag> m_slowPathCallLocation ;
254+ CodeLocationLabel<JSInternalPtrTag> m_slowPathStartLocation ;
258255 bool m_generateFastPathOnRepatch { false };
259256 GeneratorType m_generator;
260257};
0 commit comments