diff --git a/irtoc/backend/compiler/dangling_pointers_checker.h b/irtoc/backend/compiler/dangling_pointers_checker.h index dbaae2088028959671220f25ce00bd3d32e636b6..2660c18a6d500cc4ca812281157a90e4a04f4e3b 100644 --- a/irtoc/backend/compiler/dangling_pointers_checker.h +++ b/irtoc/backend/compiler/dangling_pointers_checker.h @@ -43,9 +43,8 @@ public: {Arch::X86_64, {{"thread", 15}, {"frame", 5}, {"acc", 11}, {"acc_tag", 3}}}}; // NOLINTNEXTLINE(fuchsia-statically-constructed-objects) inline static std::unordered_set target_funcs_ { - "CreateArrayByIdEntrypoint", "CreateObjectByClassInterpreter", "CreateMultiArrayRecEntrypoint", - "ResolveLiteralArrayByIdEntrypoint", "GetStaticFieldByIdEntrypoint", "GetCalleeMethodFromBytecodeId", - "ResolveTypeByIdEntrypoint", "CreateMultiDimensionalArrayById", "SafepointEntrypointInterp"}; + "CreateObjectByClassInterpreter", "CreateMultiArrayRecEntrypoint", "GetStaticFieldByIdEntrypoint", + "GetCalleeMethodFromBytecodeId", "ResolveTypeByIdEntrypoint", "CreateMultiDimensionalArrayById"}; private: ArenaVector objects_users_; diff --git a/irtoc/scripts/common.irt b/irtoc/scripts/common.irt index 46b82fb1d922b53dc252fe08c29dfa7642d8ea22..d42f5979180e0af6d1cc55a549d85c97de2f8136 100644 --- a/irtoc/scripts/common.irt +++ b/irtoc/scripts/common.irt @@ -36,7 +36,7 @@ $temps_regmap = Regmap.new(Options.arch_info.temp_regs.each_with_index.map { |x, direct: true) $callees_regmap = Regmap.new({ - arm64: (19..28).each_with_index.map { |x, i| ["callee#{i}".to_sym, x] }.to_h, + arm64: ((19..28).to_a - [21]).each_with_index.map { |x, i| ["callee#{i}".to_sym, x] }.to_h, arm32: (4..10).each_with_index.map { |x, i| ["callee#{i}".to_sym, x] }.to_h, x86_64: (11..15).each_with_index.map { |x, i| ["callee#{i}".to_sym, x] }.to_h, }) diff --git a/irtoc/scripts/interpreter.irt b/irtoc/scripts/interpreter.irt index 4c6d6709ecb66afd7efc39ec76a5100eced9a352..f4e549959c3e1ece27e43665def1ffad7190d7bb 100644 --- a/irtoc/scripts/interpreter.irt +++ b/irtoc/scripts/interpreter.irt @@ -557,9 +557,15 @@ macro(:safepoint) do |acc_type, is_save_acc| If(flags, 0).NE.Unlikely { save_acc_var(acc, acc_tag) if is_save_acc call_runtime("SafepointEntrypointInterp", %tr).void - restored_acc := restore_acc().send(acc_type) + if !Options.arm64? + restored_acc := restore_acc().send(acc_type) + end } - acc_ := Phi(acc, restored_acc).send(acc_type) + if Options.arm64? + acc_ := acc.send(acc_type) + else + acc_ := Phi(acc, restored_acc).send(acc_type) + end end macro(:verify) do |method, is_initobj| @@ -830,7 +836,9 @@ end macro(:handle_lda_const_v8_id16) do |v, id| save_acc() cnst := call_runtime("ResolveLiteralArrayByIdEntrypoint", %tr, get_method_ptr(), u16tou32(id)).ref - acc := restore_acc().send(acc.type) + if !Options.arm64? + acc := restore_acc().send(acc.type) + end If(cnst, 0).CC(:CC_EQ).b { move_to_exception } @@ -1070,7 +1078,9 @@ macro(:handle_newarr_v4_v4_id16) do |vd, vs, id| } save_acc() array := call_runtime("CreateArrayByIdEntrypoint", %tr, get_method_ptr(), u16tou32(id), vs).ref - acc := restore_acc().ptr + if !Options.arm64? + acc := restore_acc().ptr + end If(array, 0).CC(:CC_EQ).b { move_to_exception } diff --git a/runtime/mem/gc/gc.cpp b/runtime/mem/gc/gc.cpp index fa9a76147f68ebb576104a759aff77dd220277fa..c3dbfbbc15abcb784eba742a1896053327a386e2 100644 --- a/runtime/mem/gc/gc.cpp +++ b/runtime/mem/gc/gc.cpp @@ -885,6 +885,10 @@ void GC::UpdateRefsInVRegs(ManagedThread *thread) if (!pframe.IsCFrame() && reg_info.IsAccumulator()) { LOG_DEBUG_GC << "^ acc updated"; vreg.SetReference(reinterpret_cast(addr)); +#ifdef PANDA_TARGET_ARM64 + uint64_t acc = bit_cast(vreg.GetValue()); + asm volatile("mov x21, %0\n" : : "r"(acc)); +#endif } else { pframe.template SetVRegValue>( reg_info, reinterpret_cast(addr));