Skip to content

Commit 66a57a8

Browse files
aamCommit Queue
authored andcommitted
[gardening] Fix trampoline near jump to far jump.
Fuchsia has slightly more code in FfiCallbackTrampoline, so near jump don't work, has to be far jump. Fixes #60682 TEST=ci Change-Id: Iaabdcfe59c821eeed00fff7faf1dbd661145922b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426905 Commit-Queue: Alexander Aprelev <[email protected]> Reviewed-by: Ryan Macnak <[email protected]>
1 parent 42c98bd commit 66a57a8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

runtime/vm/compiler/stub_code_compiler_x64.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,12 +536,12 @@ void StubCodeCompiler::GenerateFfiCallbackTrampolineStub() {
536536
// If GetFfiCallbackMetadata returned a null thread, it means that the
537537
// callback was invoked after it was deleted. In this case, do nothing.
538538
__ cmpq(THR, Immediate(0));
539-
__ j(EQUAL, &done, Assembler::kFarJump);
539+
__ j(EQUAL, &done);
540540

541541
// Check the trampoline type to see how the callback should be invoked.
542542
__ cmpq(RAX, Immediate(static_cast<uword>(
543543
FfiCallbackMetadata::TrampolineType::kAsync)));
544-
__ j(EQUAL, &async_callback, Assembler::kNearJump);
544+
__ j(EQUAL, &async_callback);
545545

546546
__ cmpq(RAX,
547547
Immediate(static_cast<uword>(

runtime/vm/ffi_callback_metadata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ class FfiCallbackMetadata {
291291

292292
#if defined(TARGET_ARCH_X64)
293293
static constexpr intptr_t kNativeCallbackTrampolineSize = 12;
294-
static constexpr intptr_t kNativeCallbackSharedStubSize = 338;
294+
static constexpr intptr_t kNativeCallbackSharedStubSize = 376;
295295
static constexpr intptr_t kNativeCallbackTrampolineStackDelta = 2;
296296
#elif defined(TARGET_ARCH_IA32)
297297
static constexpr intptr_t kNativeCallbackTrampolineSize = 10;

0 commit comments

Comments
 (0)