diff --git a/runtime/vm/compiler/backend/inliner_test.cc b/runtime/vm/compiler/backend/inliner_test.cc index c6299d69238..97e4c9c8ac3 100644 --- a/runtime/vm/compiler/backend/inliner_test.cc +++ b/runtime/vm/compiler/backend/inliner_test.cc @@ -375,17 +375,20 @@ ISOLATE_UNIT_TEST_CASE(Inliner_List_of_inlined) { // by deopt_id and environment from the call itself. ISOLATE_UNIT_TEST_CASE(Inliner_InlineForceOptimized) { const char* kScript = R"( - import 'dart:ffi'; + @pragma('vm:force-optimize') + @pragma('vm:idempotent') + @pragma('vm:prefer-inline') + int newHash() => identityHashCode(Object()); @pragma('vm:never-inline') - int foo(int x) { - dynamic ptr = Pointer.fromAddress(x); - return x + ptr.hashCode; + int foo() { + int x = newHash(); + return x + 1; } main() { int r = 0; for (int i = 0; i < 1000; i++) { - r += foo(r); + r += foo(); } return r; } @@ -414,8 +417,8 @@ ISOLATE_UNIT_TEST_CASE(Inliner_InlineForceOptimized) { {kMoveGlob}, {kMatchAndMoveStaticCall, &call_instr}, })); - EXPECT(strcmp(call_instr->function().UserVisibleNameCString(), - "Pointer.fromAddress") == 0); + EXPECT(strcmp(call_instr->function().UserVisibleNameCString(), "newHash") == + 0); } pipeline.RunAdditionalPasses({ @@ -438,8 +441,6 @@ ISOLATE_UNIT_TEST_CASE(Inliner_InlineForceOptimized) { auto allocate_object_instr_env = allocate_object_instr->env(); EXPECT(allocate_object_instr_env->LazyDeoptToBeforeDeoptId()); - EXPECT(allocate_object_instr_env->Outermost()->GetDeoptId() == - call_instr->deopt_id()); const auto call_instr_env = call_instr->env(); const intptr_t call_first_index = call_instr_env->Length() - call_instr->InputCount(); diff --git a/runtime/vm/compiler/recognized_methods_list.h b/runtime/vm/compiler/recognized_methods_list.h index 7e0e86116f3..bbcf6452795 100644 --- a/runtime/vm/compiler/recognized_methods_list.h +++ b/runtime/vm/compiler/recognized_methods_list.h @@ -164,7 +164,7 @@ namespace dart { V(FfiLibrary, ::, _storeDoubleUnaligned, FfiStoreDoubleUnaligned, \ 0x49ce5c4f) \ V(FfiLibrary, ::, _storePointer, FfiStorePointer, 0xa08098b2) \ - V(FfiLibrary, ::, _fromAddress, FfiFromAddress, 0x941575ee) \ + V(FfiLibrary, ::, _fromAddress, FfiFromAddress, 0x9415722d) \ V(FfiLibrary, Pointer, get:address, FfiGetAddress, 0x7cc16ffe) \ V(FfiLibrary, Native, _addressOf, FfiNativeAddressOf, 0x7f8597d3) \ V(FfiLibrary, ::, _asExternalTypedDataInt8, FfiAsExternalTypedDataInt8, \ diff --git a/sdk/lib/_internal/vm/lib/ffi_patch.dart b/sdk/lib/_internal/vm/lib/ffi_patch.dart index a46067ec83f..d6da8e45fd2 100644 --- a/sdk/lib/_internal/vm/lib/ffi_patch.dart +++ b/sdk/lib/_internal/vm/lib/ffi_patch.dart @@ -81,7 +81,6 @@ int sizeOf() { throw UnimplementedError("$T"); } -@pragma("vm:idempotent") @pragma("vm:recognized", "other") @pragma("vm:idempotent") external Pointer _fromAddress(int ptr);