Skip to content

Commit ec8f330

Browse files
alexmarkovCommit Queue
authored andcommitted
[vm,dynamic_modules] Fix dynamic modules build for arm64 and arm
TEST=tools/build.py -a simarm64 -m debug --dart-dynamic-modules runtime runtime_precompiled TEST=tools/build.py -a simarm -m debug --dart-dynamic-modules runtime runtime_precompiled Fixes b/391269628 Change-Id: Ic352b967d887c7753d1664d2cd9b66ebc4205222 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405240 Reviewed-by: Slava Egorov <[email protected]> Commit-Queue: Alexander Markov <[email protected]>
1 parent 496749a commit ec8f330

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

runtime/vm/compiler/stub_code_compiler.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,14 +2388,15 @@ void StubCodeCompiler::GenerateResumeStub() {
23882388
}
23892389

23902390
#if defined(DART_DYNAMIC_MODULES)
2391-
__ Comment("Resume interpreter with exception");
2392-
__ Bind(&resume_interpreter);
2393-
23942391
#if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_ARM64)
23952392
// This case is used when Dart frame is still on the stack.
2396-
SPILLS_LR_TO_FRAME({});
2393+
if (FLAG_precompiled_mode) {
2394+
RESTORES_LR_FROM_FRAME({}); // Undo EnterStubFrame() from the case above.
2395+
}
2396+
SPILLS_RETURN_ADDRESS_FROM_LR_TO_REGISTER({}); // Undo SetReturnAddress().
23972397
#endif
2398-
2398+
__ Comment("Resume interpreter with exception");
2399+
__ Bind(&resume_interpreter);
23992400
__ PushObject(NullObject()); // Make room for result.
24002401
__ PushObject(NullObject()); // Return value.
24012402
__ PushRegistersInOrder({kException, kStackTrace});

runtime/vm/compiler/stub_code_compiler_arm.cc

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2790,7 +2790,7 @@ void StubCodeCompiler::GenerateInterpretCallStub() {
27902790
{
27912791
Label ok;
27922792
// Check that we are always entering from Dart code.
2793-
__ LoadFromOffset(kWord, R8, THR, target::Thread::vm_tag_offset());
2793+
__ LoadFromOffset(R8, THR, target::Thread::vm_tag_offset());
27942794
__ CompareImmediate(R8, VMTag::kDartTagId);
27952795
__ b(&ok, EQ);
27962796
__ Stop("Not coming from Dart code.");
@@ -2799,10 +2799,9 @@ void StubCodeCompiler::GenerateInterpretCallStub() {
27992799
#endif
28002800

28012801
// Adjust arguments count for type arguments vector.
2802-
__ LoadFieldFromOffset(kWord, R2, R4,
2803-
target::ArgumentsDescriptor::count_offset());
2802+
__ LoadFieldFromOffset(R2, R4, target::ArgumentsDescriptor::count_offset());
28042803
__ SmiUntag(R2);
2805-
__ LoadFieldFromOffset(kWord, R1, R4,
2804+
__ LoadFieldFromOffset(R1, R4,
28062805
target::ArgumentsDescriptor::type_args_len_offset());
28072806
__ cmp(R1, Operand(0));
28082807
__ AddImmediate(R2, R2, 1, NE); // Include the type arguments.
@@ -2828,31 +2827,29 @@ void StubCodeCompiler::GenerateInterpretCallStub() {
28282827

28292828
// Save exit frame information to enable stack walking as we are about
28302829
// to transition to Dart VM C++ code.
2831-
__ StoreToOffset(kWord, FP, THR,
2832-
target::Thread::top_exit_frame_info_offset());
2830+
__ StoreToOffset(FP, THR, target::Thread::top_exit_frame_info_offset());
28332831

28342832
// Mark that the thread exited generated code through a runtime call.
28352833
__ LoadImmediate(R5, target::Thread::exit_through_runtime_call());
2836-
__ StoreToOffset(kWord, R5, THR, target::Thread::exit_through_ffi_offset());
2834+
__ StoreToOffset(R5, THR, target::Thread::exit_through_ffi_offset());
28372835

28382836
// Mark that the thread is executing VM code.
2839-
__ LoadFromOffset(kWord, R5, THR,
2837+
__ LoadFromOffset(R5, THR,
28402838
target::Thread::interpret_call_entry_point_offset());
2841-
__ StoreToOffset(kWord, R5, THR, target::Thread::vm_tag_offset());
2839+
__ StoreToOffset(R5, THR, target::Thread::vm_tag_offset());
28422840

28432841
__ blx(R5);
28442842

28452843
// Mark that the thread is executing Dart code.
28462844
__ LoadImmediate(R2, VMTag::kDartTagId);
2847-
__ StoreToOffset(kWord, R2, THR, target::Thread::vm_tag_offset());
2845+
__ StoreToOffset(R2, THR, target::Thread::vm_tag_offset());
28482846

28492847
// Mark that the thread has not exited generated Dart code.
28502848
__ LoadImmediate(R2, 0);
2851-
__ StoreToOffset(kWord, R2, THR, target::Thread::exit_through_ffi_offset());
2849+
__ StoreToOffset(R2, THR, target::Thread::exit_through_ffi_offset());
28522850

28532851
// Reset exit frame information in Isolate's mutator thread structure.
2854-
__ StoreToOffset(kWord, R2, THR,
2855-
target::Thread::top_exit_frame_info_offset());
2852+
__ StoreToOffset(R2, THR, target::Thread::top_exit_frame_info_offset());
28562853

28572854
__ LeaveStubFrame();
28582855
__ Ret();

runtime/vm/native_arguments.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class NativeArguments {
196196
argc_tag_(ReverseArgOrderBit::update(true, argc_tag)),
197197
argv_(argv),
198198
retval_(retval) {}
199+
NativeArguments() = default;
199200
#endif // defined(DART_DYNAMIC_MODULES)
200201

201202
// Since this function is passed an ObjectPtr directly, we need to be

0 commit comments

Comments
 (0)