@@ -921,9 +921,7 @@ void* generateFailedDeferredCompileTrampoline() {
921921
922922 annot.add (" saveRegisters" , &a, annot_cursor);
923923
924- // r10 contains the function object from our stub
925- a.mov (x86::rdi, x86::r10);
926- a.mov (x86::rsi, x86::rsp);
924+ a.mov (x86::rdi, x86::rsp);
927925 a.call (reinterpret_cast <uint64_t >(JITRT_FailedDeferredCompileShim));
928926 a.leave ();
929927 a.ret ();
@@ -941,9 +939,7 @@ void* generateFailedDeferredCompileTrampoline() {
941939
942940 annot.add (" saveRegisters" , &a, annot_cursor);
943941
944- // x10 contains the function object from our stub
945- a.mov (a64::x0, a64::x10);
946- a.mov (a64::x1, a64::sp);
942+ a.mov (a64::x0, a64::sp);
947943 a.mov (arch::reg_scratch_br, JITRT_FailedDeferredCompileShim);
948944 a.blr (arch::reg_scratch_br);
949945 a.mov (a64::sp, arch::fp);
@@ -2076,17 +2072,6 @@ void NativeGenerator::generateEpilogue(BaseNode* epilogue_cursor) {
20762072 " Epilogue (restore regs; pop native frame; error exit)" ,
20772073 epilogue_error_cursor);
20782074 env_.addAnnotation (" Epilogue" , epilogue_cursor);
2079- if (env_.function_indirections .size ()) {
2080- auto jit_helpers = as_->cursor ();
2081- for (auto & x : env_.function_indirections ) {
2082- Label trampoline = as_->newLabel ();
2083- as_->bind (trampoline);
2084- as_->mov (x86::r10, reinterpret_cast <uint64_t >(x.first ));
2085- as_->jmp (reinterpret_cast <uint64_t >(failed_deferred_compile_trampoline_));
2086- x.second .trampoline = trampoline;
2087- }
2088- env_.addAnnotation (" JitHelpers" , jit_helpers);
2089- }
20902075#elif defined(CINDER_AARCH64)
20912076 bool is_gen = GetFunction ()->code ->co_flags & kCoFlagsAnyGenerator ;
20922077 if (is_gen) {
@@ -2172,18 +2157,6 @@ void NativeGenerator::generateEpilogue(BaseNode* epilogue_cursor) {
21722157 " Epilogue (restore regs; pop native frame; error exit)" ,
21732158 epilogue_error_cursor);
21742159 env_.addAnnotation (" Epilogue" , epilogue_cursor);
2175- if (env_.function_indirections .size ()) {
2176- auto jit_helpers = as_->cursor ();
2177- for (auto & x : env_.function_indirections ) {
2178- Label trampoline = as_->newLabel ();
2179- as_->bind (trampoline);
2180- as_->mov (a64::x10, reinterpret_cast <uint64_t >(x.first ));
2181- as_->mov (arch::reg_scratch_br, failed_deferred_compile_trampoline_);
2182- as_->br (arch::reg_scratch_br);
2183- x.second .trampoline = trampoline;
2184- }
2185- env_.addAnnotation (" JitHelpers" , jit_helpers);
2186- }
21872160#else
21882161 CINDER_UNSUPPORTED
21892162#endif
@@ -2956,10 +2929,7 @@ void NativeGenerator::generateCode(CodeHolder& codeholder) {
29562929 {
29572930 ThreadedCompileSerialize guard;
29582931 for (auto & x : env_.function_indirections ) {
2959- Label trampoline = x.second .trampoline ;
2960- *x.second .indirect = reinterpret_cast <void *>(
2961- codeholder.labelOffsetFromBase (trampoline) +
2962- codeholder.baseAddress ());
2932+ *x.second .indirect = failed_deferred_compile_trampoline_;
29632933 }
29642934 }
29652935
0 commit comments