From 61caeca47aabb8a767f51ac58ff4f2e757450ffd Mon Sep 17 00:00:00 2001 From: Alexander Markov Date: Tue, 12 Jul 2022 19:25:32 +0000 Subject: [PATCH] Reland "[vm] Cleanup old async/async*/sync* implementation from the VM" This is a reland of commit bc8afad8559941981eef095a9a680416e2a6dfa8 On top of the original commit, this change fixes incorrect propagation of async/async*/sync* modifiers from a function to its dynamic invocation forwarder. TEST=ci, runtime/tests/vm/dart/regress_b_238653741_test.dart Fixes b/238653741 Issue: https://github.com/dart-lang/sdk/issues/48378 Original change's description: > [vm] Cleanup old async/async*/sync* implementation from the VM > > TEST=ci > > Issue: https://github.com/dart-lang/sdk/issues/48378 > Change-Id: I089ba4ed5613f30eec29f0db4ac6d5d8fbffd185 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249980 > Reviewed-by: Martin Kustermann > Reviewed-by: Slava Egorov > Commit-Queue: Alexander Markov Change-Id: Iaad033d974a23fc6c5880a3d7f41818eb117f839 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251300 Commit-Queue: Alexander Markov Reviewed-by: Slava Egorov --- .../vm/dart/regress_b_238653741_test.dart | 25 + .../vm/dart/regress_flutter51298_test.dart | 2 +- .../vm/dart_2/regress_b_238653741_test.dart | 27 + .../vm/dart_2/regress_flutter51298_test.dart | 2 +- runtime/vm/code_descriptors.h | 4 +- runtime/vm/compiler/aot/precompiler.cc | 17 - runtime/vm/compiler/backend/il.cc | 6 +- .../frontend/kernel_binary_flowgraph.cc | 272 ++------ .../frontend/kernel_binary_flowgraph.h | 2 - runtime/vm/compiler/frontend/kernel_to_il.h | 12 - runtime/vm/compiler/frontend/scope_builder.cc | 24 +- runtime/vm/compiler/recognized_methods_list.h | 1 - .../vm/compiler/runtime_offsets_extracted.h | 660 +++++++++--------- runtime/vm/debugger.cc | 352 +--------- runtime/vm/debugger.h | 17 +- runtime/vm/flag_list.h | 3 - runtime/vm/kernel_loader.cc | 39 +- runtime/vm/object.cc | 19 +- runtime/vm/object.h | 92 +-- runtime/vm/object_store.cc | 32 - runtime/vm/object_store.h | 4 - runtime/vm/scopes.cc | 60 +- runtime/vm/source_report.cc | 49 +- runtime/vm/stack_trace.cc | 148 +--- runtime/vm/stack_trace.h | 10 - runtime/vm/symbols.h | 11 - sdk/lib/_internal/vm/lib/async_patch.dart | 113 +-- sdk/lib/_internal/vm/lib/core_patch.dart | 128 ---- 28 files changed, 517 insertions(+), 1614 deletions(-) create mode 100644 runtime/tests/vm/dart/regress_b_238653741_test.dart create mode 100644 runtime/tests/vm/dart_2/regress_b_238653741_test.dart diff --git a/runtime/tests/vm/dart/regress_b_238653741_test.dart b/runtime/tests/vm/dart/regress_b_238653741_test.dart new file mode 100644 index 00000000000..b6c5b4f7899 --- /dev/null +++ b/runtime/tests/vm/dart/regress_b_238653741_test.dart @@ -0,0 +1,25 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Regression test for b/238653741. +// +// Verifies that calling async function through dynamic invocation forwarder +// does not result in a runtime error. + +import "package:expect/expect.dart"; + +class A { + Future foo(int arg) async => arg + 3; +} + +class B { + Future foo(String arg) async => int.parse(arg); +} + +List objects = [A(), B(), 42]; + +void main() async { + Expect.equals(7, await objects[0].foo(4)); + Expect.equals(8, await objects[1].foo("8")); +} diff --git a/runtime/tests/vm/dart/regress_flutter51298_test.dart b/runtime/tests/vm/dart/regress_flutter51298_test.dart index 9e7bb8cb378..68cddd9a0cb 100644 --- a/runtime/tests/vm/dart/regress_flutter51298_test.dart +++ b/runtime/tests/vm/dart/regress_flutter51298_test.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// VMOptions=--async_igoto_threshold=0 --optimization_counter_threshold=10 --deterministic +// VMOptions=--optimization_counter_threshold=10 --deterministic // Regression test for https://github.com/flutter/flutter/issues/51298. // This would cause a crash due to bad offsets causing entry to hit the pre-code diff --git a/runtime/tests/vm/dart_2/regress_b_238653741_test.dart b/runtime/tests/vm/dart_2/regress_b_238653741_test.dart new file mode 100644 index 00000000000..6ae85d268b7 --- /dev/null +++ b/runtime/tests/vm/dart_2/regress_b_238653741_test.dart @@ -0,0 +1,27 @@ +// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Regression test for b/238653741. +// +// Verifies that calling async function through dynamic invocation forwarder +// does not result in a runtime error. + +// @dart=2.9 + +import "package:expect/expect.dart"; + +class A { + Future foo(int arg) async => arg + 3; +} + +class B { + Future foo(String arg) async => int.parse(arg); +} + +List objects = [A(), B(), 42]; + +void main() async { + Expect.equals(7, await objects[0].foo(4)); + Expect.equals(8, await objects[1].foo("8")); +} diff --git a/runtime/tests/vm/dart_2/regress_flutter51298_test.dart b/runtime/tests/vm/dart_2/regress_flutter51298_test.dart index 6056dea65ef..28f8bc12db2 100644 --- a/runtime/tests/vm/dart_2/regress_flutter51298_test.dart +++ b/runtime/tests/vm/dart_2/regress_flutter51298_test.dart @@ -4,7 +4,7 @@ // @dart = 2.9 -// VMOptions=--async_igoto_threshold=0 --optimization_counter_threshold=10 --deterministic +// VMOptions=--optimization_counter_threshold=10 --deterministic // Regression test for https://github.com/flutter/flutter/issues/51298. // This would cause a crash due to bad offsets causing entry to hit the pre-code diff --git a/runtime/vm/code_descriptors.h b/runtime/vm/code_descriptors.h index e268ff03c7e..47ced6ff031 100644 --- a/runtime/vm/code_descriptors.h +++ b/runtime/vm/code_descriptors.h @@ -78,8 +78,8 @@ class ExceptionHandlerList : public ZoneAllocated { explicit ExceptionHandlerList(const Function& function) : list_(), - has_async_handler_(function.IsCompactAsyncFunction() || - function.IsCompactAsyncStarFunction()) {} + has_async_handler_(function.IsAsyncFunction() || + function.IsAsyncGenerator()) {} intptr_t Length() const { return list_.length(); } diff --git a/runtime/vm/compiler/aot/precompiler.cc b/runtime/vm/compiler/aot/precompiler.cc index 6c6a0239d1c..f243e829a90 100644 --- a/runtime/vm/compiler/aot/precompiler.cc +++ b/runtime/vm/compiler/aot/precompiler.cc @@ -629,8 +629,6 @@ void Precompiler::DoCompileAll() { IG->object_store()->set_simple_instance_of_true_function(null_function); IG->object_store()->set_simple_instance_of_false_function( null_function); - IG->object_store()->set_async_star_move_next_helper(null_function); - IG->object_store()->set_complete_on_async_return(null_function); IG->object_store()->set_async_star_stream_controller(null_class); DropMetadata(); DropLibraryEntries(); @@ -1136,14 +1134,6 @@ void Precompiler::AddTypesOf(const Function& function) { return; } - // Preserve parents for generated bodies in async/async*/sync* functions, - // since predicates like Function::IsAsyncClosure(), etc. need that info. - if (function.is_generated_body()) { - AddRetainReason(parent_function, RetainReasons::kIsSyncAsyncFunction); - AddTypesOf(parent_function); - return; - } - // We're not retaining the parent due to this function, so wrap it with // a weak serialization reference. const auto& data = ClosureData::CheckedHandle(Z, function.data()); @@ -2983,10 +2973,6 @@ void Precompiler::DiscardCodeObjects() { ++codes_with_native_function_; return; } - if (function_.IsAsyncClosure() || function_.IsAsyncGenClosure()) { - ++codes_with_async_closure_function_; - return; - } // Retain Code objects corresponding to dynamically // called functions. @@ -3040,8 +3026,6 @@ void Precompiler::DiscardCodeObjects() { codes_with_pc_descriptors_); THR_Print(" %8" Pd " Codes with native functions\n", codes_with_native_function_); - THR_Print(" %8" Pd " Codes with async closure functions\n", - codes_with_async_closure_function_); THR_Print(" %8" Pd " Codes with dynamically called functions\n", codes_with_dynamically_called_function_); THR_Print(" %8" Pd " Codes with deferred functions\n", @@ -3073,7 +3057,6 @@ void Precompiler::DiscardCodeObjects() { intptr_t codes_with_exception_handlers_ = 0; intptr_t codes_with_pc_descriptors_ = 0; intptr_t codes_with_native_function_ = 0; - intptr_t codes_with_async_closure_function_ = 0; intptr_t codes_with_dynamically_called_function_ = 0; intptr_t codes_with_deferred_function_ = 0; intptr_t codes_with_ffi_trampoline_function_ = 0; diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc index 11ceae87151..098bb2eafd1 100644 --- a/runtime/vm/compiler/backend/il.cc +++ b/runtime/vm/compiler/backend/il.cc @@ -6837,7 +6837,7 @@ void RawStoreFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { const Code& ReturnInstr::GetReturnStub(FlowGraphCompiler* compiler) const { const Function& function = compiler->parsed_function().function(); ASSERT(function.IsSuspendableFunction()); - if (function.IsCompactAsyncFunction()) { + if (function.IsAsyncFunction()) { if (!value()->Type()->CanBeFuture()) { return Code::ZoneHandle(compiler->zone(), compiler->isolate_group() @@ -6847,11 +6847,11 @@ const Code& ReturnInstr::GetReturnStub(FlowGraphCompiler* compiler) const { return Code::ZoneHandle( compiler->zone(), compiler->isolate_group()->object_store()->return_async_stub()); - } else if (function.IsCompactAsyncStarFunction()) { + } else if (function.IsAsyncGenerator()) { return Code::ZoneHandle( compiler->zone(), compiler->isolate_group()->object_store()->return_async_star_stub()); - } else if (function.IsCompactSyncStarFunction()) { + } else if (function.IsSyncGenerator()) { return Code::ZoneHandle( compiler->zone(), compiler->isolate_group()->object_store()->return_sync_star_stub()); diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc index db660b585d9..0fe87f595cd 100644 --- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc +++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc @@ -482,11 +482,6 @@ Fragment StreamingFlowGraphBuilder::TypeArgumentsHandling( if (dart_function.IsClosureFunction() && dart_function.NumParentTypeArguments() > 0) { LocalVariable* closure = parsed_function()->ParameterVariable(0); - - // Function with yield points can not be generic itself but the outer - // function can be. - ASSERT(yield_continuations().is_empty() || !dart_function.IsGeneric()); - LocalVariable* fn_type_args = parsed_function()->function_type_arguments(); ASSERT(fn_type_args != nullptr && closure != nullptr); @@ -518,111 +513,6 @@ Fragment StreamingFlowGraphBuilder::TypeArgumentsHandling( return prologue; } -Fragment StreamingFlowGraphBuilder::CompleteBodyWithYieldContinuations( - Fragment body) { - // The code we are building will be executed right after we enter - // the function and before any nested contexts are allocated. - // Reset current context_depth_ to match this. - const intptr_t current_context_depth = B->context_depth_; - B->context_depth_ = scopes()->yield_jump_variable->owner()->context_level(); - - // Prepend an entry corresponding to normal entry to the function. - yield_continuations().InsertAt( - 0, - YieldContinuation(new (Z) DropTempsInstr(0, nullptr), kInvalidTryIndex)); - yield_continuations()[0].entry->LinkTo(body.entry); - - // Load :await_jump_var into a temporary. - Fragment dispatch; - dispatch += LoadLocal(scopes()->yield_jump_variable); - dispatch += StoreLocal(TokenPosition::kNoSource, scopes()->switch_variable); - dispatch += Drop(); - - const intptr_t continuation_count = yield_continuations().length(); - - IndirectGotoInstr* indirect_goto; - if (FLAG_async_igoto_threshold >= 0 && - continuation_count >= FLAG_async_igoto_threshold) { - dispatch += LoadLocal(scopes()->switch_variable); - dispatch += IndirectGoto(continuation_count); - indirect_goto = dispatch.current->AsIndirectGoto(); - - for (intptr_t i = 0; i < continuation_count; i++) { - if (i >= 1) { - Fragment resumption; - // Every continuation after the first is not a normal entry but a - // resumption. - // Restore :current_context_var from :await_ctx_var. - // Note: after this point context_depth_ does not match current context - // depth so we should not access any local variables anymore. - resumption += LoadLocal(scopes()->yield_context_variable); - resumption += StoreLocal(TokenPosition::kNoSource, - parsed_function()->current_context_var()); - resumption += Drop(); - - Instruction* next = yield_continuations()[i].entry->next(); - yield_continuations()[i].entry->LinkTo(resumption.entry); - resumption <<= next; - } - - IndirectEntryInstr* indirect_entry = B->BuildIndirectEntry( - /*indirect_id=*/i, yield_continuations()[i].try_index); - indirect_entry->LinkTo(yield_continuations()[i].entry->next()); - - TargetEntryInstr* target = B->BuildTargetEntry(); - Fragment(target) + Goto(indirect_entry); - - indirect_goto->AddSuccessor(target); - } - } else { - BlockEntryInstr* block = nullptr; - for (intptr_t i = 0; i < continuation_count; i++) { - if (i == 1) { - // This is not a normal entry but a resumption. Restore - // :current_context_var from :await_ctx_var. - // Note: after this point context_depth_ does not match current context - // depth so we should not access any local variables anymore. - dispatch += LoadLocal(scopes()->yield_context_variable); - dispatch += StoreLocal(TokenPosition::kNoSource, - parsed_function()->current_context_var()); - dispatch += Drop(); - } - if (i == (continuation_count - 1)) { - // We reached the last possibility, no need to build more ifs. - // Continue to the last continuation. - // Note: continuations start with nop DropTemps instruction - // which acts like an anchor, so we need to skip it. - block->set_try_index(yield_continuations()[i].try_index); - dispatch <<= yield_continuations()[i].entry->next(); - break; - } - - // Build comparison: - // - // if (:await_jump_var == i) { - // -> yield_continuations()[i] - // } else ... - // - TargetEntryInstr* then; - TargetEntryInstr* otherwise; - dispatch += LoadLocal(scopes()->switch_variable); - dispatch += IntConstant(i); - dispatch += B->BranchIfStrictEqual(&then, &otherwise); - - // True branch is linked to appropriate continuation point. - // Note: continuations start with nop DropTemps instruction - // which acts like an anchor, so we need to skip it. - then->LinkTo(yield_continuations()[i].entry->next()); - then->set_try_index(yield_continuations()[i].try_index); - // False branch will contain the next comparison. - dispatch = Fragment(dispatch.entry, otherwise); - block = otherwise; - } - } - B->context_depth_ = current_context_depth; - return dispatch; -} - Fragment StreamingFlowGraphBuilder::CheckStackOverflowInPrologue( const Function& dart_function) { if (dart_function.is_native()) return {}; @@ -669,7 +559,7 @@ Fragment StreamingFlowGraphBuilder::SetupCapturedParameters( Fragment StreamingFlowGraphBuilder::InitSuspendableFunction( const Function& dart_function) { Fragment body; - if (dart_function.IsCompactAsyncFunction()) { + if (dart_function.IsAsyncFunction()) { const auto& result_type = AbstractType::Handle(Z, dart_function.result_type()); auto& type_args = TypeArguments::ZoneHandle(Z); @@ -684,7 +574,7 @@ Fragment StreamingFlowGraphBuilder::InitSuspendableFunction( body += B->Call1ArgStub(TokenPosition::kNoSource, Call1ArgStubInstr::StubId::kInitAsync); body += Drop(); - } else if (dart_function.IsCompactAsyncStarFunction()) { + } else if (dart_function.IsAsyncGenerator()) { const auto& result_type = AbstractType::Handle(Z, dart_function.result_type()); auto& type_args = TypeArguments::ZoneHandle(Z); @@ -702,7 +592,7 @@ Fragment StreamingFlowGraphBuilder::InitSuspendableFunction( body += B->Suspend(TokenPosition::kNoSource, SuspendInstr::StubId::kYieldAsyncStar); body += Drop(); - } else if (dart_function.IsCompactSyncStarFunction()) { + } else if (dart_function.IsSyncGenerator()) { const auto& result_type = AbstractType::Handle(Z, dart_function.result_type()); auto& type_args = TypeArguments::ZoneHandle(Z); @@ -957,63 +847,46 @@ FlowGraph* StreamingFlowGraphBuilder::BuildGraphOfFunction( every_time_prologue, type_args_handling); Fragment function(instruction_cursor); - if (yield_continuations().is_empty()) { - FunctionEntryInstr* extra_entry = nullptr; - switch (extra_entry_point_style) { - case UncheckedEntryPointStyle::kNone: { - function += every_time_prologue + first_time_prologue + - type_args_handling + implicit_type_checks + - explicit_type_checks + body; - break; - } - case UncheckedEntryPointStyle::kSeparate: { - ASSERT(instruction_cursor == normal_entry); - ASSERT(first_time_prologue.is_empty()); - ASSERT(type_args_handling.is_empty()); - - const Fragment prologue_copy = BuildEveryTimePrologue( - dart_function, token_position, type_parameters_offset); - - extra_entry = B->BuildSeparateUncheckedEntryPoint( - normal_entry, - /*normal_prologue=*/every_time_prologue + implicit_type_checks, - /*extra_prologue=*/prologue_copy, - /*shared_prologue=*/explicit_type_checks, - /*body=*/body); - break; - } - case UncheckedEntryPointStyle::kSharedWithVariable: { - Fragment prologue(normal_entry, instruction_cursor); - prologue += every_time_prologue; - prologue += first_time_prologue; - prologue += type_args_handling; - prologue += explicit_type_checks; - extra_entry = B->BuildSharedUncheckedEntryPoint( - /*shared_prologue_linked_in=*/prologue, - /*skippable_checks=*/implicit_type_checks, - /*redefinitions_if_skipped=*/implicit_redefinitions, - /*body=*/body); - break; - } + FunctionEntryInstr* extra_entry = nullptr; + switch (extra_entry_point_style) { + case UncheckedEntryPointStyle::kNone: { + function += every_time_prologue + first_time_prologue + + type_args_handling + implicit_type_checks + + explicit_type_checks + body; + break; } - if (extra_entry != nullptr) { - B->RecordUncheckedEntryPoint(graph_entry, extra_entry); + case UncheckedEntryPointStyle::kSeparate: { + ASSERT(instruction_cursor == normal_entry); + ASSERT(first_time_prologue.is_empty()); + ASSERT(type_args_handling.is_empty()); + + const Fragment prologue_copy = BuildEveryTimePrologue( + dart_function, token_position, type_parameters_offset); + + extra_entry = B->BuildSeparateUncheckedEntryPoint( + normal_entry, + /*normal_prologue=*/every_time_prologue + implicit_type_checks, + /*extra_prologue=*/prologue_copy, + /*shared_prologue=*/explicit_type_checks, + /*body=*/body); + break; } - } else { - // If the function's body contains any yield points, build switch statement - // that selects a continuation point based on the value of :await_jump_var. - ASSERT(explicit_type_checks.is_empty()); - - // If the function is generic, type_args_handling might require access to - // (possibly captured) 'this' for preparing default type arguments, in which - // case we can't run it before the 'first_time_prologue'. - ASSERT(!dart_function.IsGeneric()); - - // TODO(#34162): We can probably ignore the implicit checks - // here as well since the arguments are passed from generated code. - function += every_time_prologue + type_args_handling + - CompleteBodyWithYieldContinuations(first_time_prologue + - implicit_type_checks + body); + case UncheckedEntryPointStyle::kSharedWithVariable: { + Fragment prologue(normal_entry, instruction_cursor); + prologue += every_time_prologue; + prologue += first_time_prologue; + prologue += type_args_handling; + prologue += explicit_type_checks; + extra_entry = B->BuildSharedUncheckedEntryPoint( + /*shared_prologue_linked_in=*/prologue, + /*skippable_checks=*/implicit_type_checks, + /*redefinitions_if_skipped=*/implicit_redefinitions, + /*body=*/body); + break; + } + } + if (extra_entry != nullptr) { + B->RecordUncheckedEntryPoint(graph_entry, extra_entry); } // When compiling for OSR, use a depth first search to find the OSR @@ -1517,11 +1390,6 @@ BreakableBlock* StreamingFlowGraphBuilder::breakable_block() { return flow_graph_builder_->breakable_block_; } -GrowableArray& -StreamingFlowGraphBuilder::yield_continuations() { - return flow_graph_builder_->yield_continuations_; -} - Value* StreamingFlowGraphBuilder::stack() { return flow_graph_builder_->stack_; } @@ -4390,8 +4258,8 @@ Fragment StreamingFlowGraphBuilder::BuildLibraryPrefixAction( Fragment StreamingFlowGraphBuilder::BuildAwaitExpression( TokenPosition* position) { - ASSERT(parsed_function()->function().IsCompactAsyncFunction() || - parsed_function()->function().IsCompactAsyncStarFunction()); + ASSERT(parsed_function()->function().IsAsyncFunction() || + parsed_function()->function().IsAsyncGenerator()); Fragment instructions; const TokenPosition pos = ReadPosition(); // read file offset. @@ -5323,7 +5191,7 @@ Fragment StreamingFlowGraphBuilder::BuildYieldStatement( instructions += DebugStepCheck(pos); } - if (parsed_function()->function().IsCompactAsyncStarFunction()) { + if (parsed_function()->function().IsAsyncGenerator()) { // In the async* functions, generate the following code for yield : // // _AsyncStarStreamController controller = :suspend_state._functionData; @@ -5377,7 +5245,7 @@ Fragment StreamingFlowGraphBuilder::BuildYieldStatement( instructions += Drop(); } - } else if (parsed_function()->function().IsCompactSyncStarFunction()) { + } else if (parsed_function()->function().IsSyncGenerator()) { // In the sync* functions, generate the following code for yield : // // _SyncStarIterator iterator = :suspend_state._functionData; @@ -5568,62 +5436,24 @@ Fragment StreamingFlowGraphBuilder::BuildFunctionNode( if (function_node_helper.async_marker_ == FunctionNodeHelper::kAsync) { function.set_modifier(UntaggedFunction::kAsync); - function.set_is_debuggable(true); function.set_is_inlinable(false); - function.set_is_visible(true); - ASSERT(function.IsCompactAsyncFunction()); + ASSERT(function.IsAsyncFunction()); } else if (function_node_helper.async_marker_ == FunctionNodeHelper::kAsyncStar) { function.set_modifier(UntaggedFunction::kAsyncGen); - function.set_is_debuggable(true); function.set_is_inlinable(false); - function.set_is_visible(true); - ASSERT(function.IsCompactAsyncStarFunction()); + ASSERT(function.IsAsyncGenerator()); } else if (function_node_helper.async_marker_ == FunctionNodeHelper::kSyncStar) { function.set_modifier(UntaggedFunction::kSyncGen); - function.set_is_debuggable(true); function.set_is_inlinable(false); - function.set_is_visible(true); - ASSERT(function.IsCompactSyncStarFunction()); + ASSERT(function.IsSyncGenerator()); } else { ASSERT(function_node_helper.async_marker_ == FunctionNodeHelper::kSync); - function.set_is_debuggable(function_node_helper.dart_async_marker_ == - FunctionNodeHelper::kSync); - switch (function_node_helper.dart_async_marker_) { - case FunctionNodeHelper::kSyncStar: - function.set_modifier(UntaggedFunction::kSyncGen); - break; - case FunctionNodeHelper::kAsync: - function.set_modifier(UntaggedFunction::kAsync); - break; - case FunctionNodeHelper::kAsyncStar: - function.set_modifier(UntaggedFunction::kAsyncGen); - break; - default: - // no special modifier - break; - } - function.set_is_generated_body(false); - // sync* functions contain two nested synthetic functions, - // the first of which (sync_op_gen) is a regular sync function so we - // need to manually label it generated: - if (function.parent_function() != Function::null()) { - const auto& parent = Function::Handle(function.parent_function()); - if (parent.IsSyncGenerator() && - !parent.IsCompactSyncStarFunction()) { - function.set_is_generated_body(true); - } - } - // Note: Is..() methods use the modifiers set above, so order - // matters. - if (function.IsAsyncClosure() || function.IsAsyncGenClosure()) { - function.set_is_inlinable(false); - } - ASSERT(!function.IsCompactAsyncFunction()); - ASSERT(!function.IsCompactAsyncStarFunction()); - ASSERT(!function.IsCompactSyncStarFunction()); + ASSERT(!function.IsAsyncFunction()); + ASSERT(!function.IsAsyncGenerator()); + ASSERT(!function.IsSyncGenerator()); } // If the start token position is synthetic, the end token position diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h index feb6d488850..bf95ac23017 100644 --- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h +++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h @@ -98,7 +98,6 @@ class StreamingFlowGraphBuilder : public KernelReaderHelper { Fragment ShortcutForUserDefinedEquals(const Function& dart_function, LocalVariable* first_parameter); Fragment TypeArgumentsHandling(const Function& dart_function); - Fragment CompleteBodyWithYieldContinuations(Fragment body); static UncheckedEntryPointStyle ChooseEntryPointStyle( const Function& dart_function, @@ -131,7 +130,6 @@ class StreamingFlowGraphBuilder : public KernelReaderHelper { TryFinallyBlock* try_finally_block(); SwitchBlock* switch_block(); BreakableBlock* breakable_block(); - GrowableArray& yield_continuations(); Value* stack(); void set_stack(Value* top); void Push(Definition* definition); diff --git a/runtime/vm/compiler/frontend/kernel_to_il.h b/runtime/vm/compiler/frontend/kernel_to_il.h index fcb4245a8e5..b1845038c8d 100644 --- a/runtime/vm/compiler/frontend/kernel_to_il.h +++ b/runtime/vm/compiler/frontend/kernel_to_il.h @@ -35,16 +35,6 @@ class SwitchBlock; class TryCatchBlock; class TryFinallyBlock; -struct YieldContinuation { - Instruction* entry; - intptr_t try_index; - - YieldContinuation(Instruction* entry, intptr_t try_index) - : entry(entry), try_index(try_index) {} - - YieldContinuation() : entry(NULL), try_index(kInvalidTryIndex) {} -}; - enum class TypeChecksToBuild { kCheckAllTypeParameterBounds, kCheckNonCovariantTypeParameterBounds, @@ -604,8 +594,6 @@ class FlowGraphBuilder : public BaseFlowGraphBuilder { ScopeBuildingResult* scopes_; - GrowableArray yield_continuations_; - LocalVariable* CurrentException() { return scopes_->exception_variables[catch_depth_ - 1]; } diff --git a/runtime/vm/compiler/frontend/scope_builder.cc b/runtime/vm/compiler/frontend/scope_builder.cc index 3e7f2f836b4..7844ac4e553 100644 --- a/runtime/vm/compiler/frontend/scope_builder.cc +++ b/runtime/vm/compiler/frontend/scope_builder.cc @@ -206,17 +206,7 @@ ScopeBuildingResult* ScopeBuilder::BuildScopes() { ParameterTypeCheckMode type_check_mode = kTypeCheckForNonDynamicallyInvokedMethod; - if (function.IsSyncGenClosure()) { - // Don't type check the parameter of sync-yielding since these calls are - // all synthetic and types should always match. - ASSERT_EQUAL( - function.NumParameters() - function.NumImplicitParameters(), 3); - ASSERT( - Class::Handle( - AbstractType::Handle(function.ParameterTypeAt(1)).type_class()) - .ScrubbedName() == Symbols::_SyncIterator().ptr()); - type_check_mode = kTypeCheckForStaticFunction; - } else if (function.is_static()) { + if (function.is_static()) { // In static functions we don't check anything. type_check_mode = kTypeCheckForStaticFunction; } else if (function.IsImplicitClosureFunction()) { @@ -1325,17 +1315,7 @@ void ScopeBuilder::VisitVariableDeclaration() { variable->set_late_init_offset(initializer_offset); } - // Lift the special async vars out of the function body scope, into the - // outer function declaration scope. - // This way we can allocate them in the outermost context at fixed indices, - // allowing support for async stack traces implementation to find awaiters. - if (name.Equals(Symbols::AwaitJumpVar()) || - name.Equals(Symbols::AsyncFuture()) || name.Equals(Symbols::is_sync()) || - name.Equals(Symbols::Controller())) { - scope_->parent()->AddVariable(variable); - } else { - scope_->AddVariable(variable); - } + scope_->AddVariable(variable); result_->locals.Insert(helper_.data_program_offset_ + kernel_offset_no_tag, variable); } diff --git a/runtime/vm/compiler/recognized_methods_list.h b/runtime/vm/compiler/recognized_methods_list.h index 726488fae8c..9fab3a3125e 100644 --- a/runtime/vm/compiler/recognized_methods_list.h +++ b/runtime/vm/compiler/recognized_methods_list.h @@ -280,7 +280,6 @@ namespace dart { V(::, _asExternalTypedDataDouble, FfiAsExternalTypedDataDouble, 0x40cdd9e1) \ V(::, _getNativeField, GetNativeField, 0xa0139b85) \ V(::, reachabilityFence, ReachabilityFence, 0x730f2b7f) \ - V(::, _asyncThenWrapperHelper, AsyncThenWrapperHelper, 0x0c17f838) \ V(_Utf8Decoder, _scan, Utf8DecoderScan, 0xf296c901) \ V(_Future, timeout, FutureTimeout, 0xa7cb3294) \ V(Future, wait, FutureWait, 0xb0b596bd) \ diff --git a/runtime/vm/compiler/runtime_offsets_extracted.h b/runtime/vm/compiler/runtime_offsets_extracted.h index fe183dac09a..fa105e6f1c0 100644 --- a/runtime/vm/compiler/runtime_offsets_extracted.h +++ b/runtime/vm/compiler/runtime_offsets_extracted.h @@ -230,27 +230,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 112; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 508; + ObjectStore_suspend_state_await_offset = 492; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 544; + ObjectStore_suspend_state_handle_exception_offset = 528; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 504; + ObjectStore_suspend_state_init_async_offset = 488; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 520; + ObjectStore_suspend_state_init_async_star_offset = 504; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 532; + ObjectStore_suspend_state_init_sync_star_offset = 516; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 512; + ObjectStore_suspend_state_return_async_offset = 496; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 516; + ObjectStore_suspend_state_return_async_not_future_offset = 500; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 528; + ObjectStore_suspend_state_return_async_star_offset = 512; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 540; + ObjectStore_suspend_state_return_sync_star_offset = 524; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 524; + ObjectStore_suspend_state_yield_async_star_offset = 508; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 536; + ObjectStore_suspend_state_yield_sync_star_offset = 520; static constexpr dart::compiler::target::word OneByteString_data_offset = 12; static constexpr dart::compiler::target::word PointerBase_data_offset = 4; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = 8; @@ -896,27 +896,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 1016; + ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 1088; + ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 1008; + ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 1040; + ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 1064; + ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 1024; + ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 1032; + ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 1056; + ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 1080; + ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 1048; + ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 1072; + ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word OneByteString_data_offset = 16; static constexpr dart::compiler::target::word PointerBase_data_offset = 8; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = @@ -1567,27 +1567,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 112; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 508; + ObjectStore_suspend_state_await_offset = 492; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 544; + ObjectStore_suspend_state_handle_exception_offset = 528; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 504; + ObjectStore_suspend_state_init_async_offset = 488; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 520; + ObjectStore_suspend_state_init_async_star_offset = 504; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 532; + ObjectStore_suspend_state_init_sync_star_offset = 516; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 512; + ObjectStore_suspend_state_return_async_offset = 496; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 516; + ObjectStore_suspend_state_return_async_not_future_offset = 500; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 528; + ObjectStore_suspend_state_return_async_star_offset = 512; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 540; + ObjectStore_suspend_state_return_sync_star_offset = 524; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 524; + ObjectStore_suspend_state_yield_async_star_offset = 508; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 536; + ObjectStore_suspend_state_yield_sync_star_offset = 520; static constexpr dart::compiler::target::word OneByteString_data_offset = 12; static constexpr dart::compiler::target::word PointerBase_data_offset = 4; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = 8; @@ -2230,27 +2230,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 1016; + ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 1088; + ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 1008; + ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 1040; + ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 1064; + ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 1024; + ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 1032; + ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 1056; + ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 1080; + ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 1048; + ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 1072; + ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word OneByteString_data_offset = 16; static constexpr dart::compiler::target::word PointerBase_data_offset = 8; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = @@ -2902,27 +2902,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 1016; + ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 1088; + ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 1008; + ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 1040; + ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 1064; + ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 1024; + ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 1032; + ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 1056; + ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 1080; + ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 1048; + ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 1072; + ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word OneByteString_data_offset = 16; static constexpr dart::compiler::target::word PointerBase_data_offset = 8; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = @@ -3573,27 +3573,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 1016; + ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 1088; + ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 1008; + ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 1040; + ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 1064; + ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 1024; + ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 1032; + ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 1056; + ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 1080; + ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 1048; + ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 1072; + ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word OneByteString_data_offset = 16; static constexpr dart::compiler::target::word PointerBase_data_offset = 8; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = @@ -4245,27 +4245,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 112; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 508; + ObjectStore_suspend_state_await_offset = 492; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 544; + ObjectStore_suspend_state_handle_exception_offset = 528; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 504; + ObjectStore_suspend_state_init_async_offset = 488; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 520; + ObjectStore_suspend_state_init_async_star_offset = 504; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 532; + ObjectStore_suspend_state_init_sync_star_offset = 516; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 512; + ObjectStore_suspend_state_return_async_offset = 496; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 516; + ObjectStore_suspend_state_return_async_not_future_offset = 500; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 528; + ObjectStore_suspend_state_return_async_star_offset = 512; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 540; + ObjectStore_suspend_state_return_sync_star_offset = 524; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 524; + ObjectStore_suspend_state_yield_async_star_offset = 508; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 536; + ObjectStore_suspend_state_yield_sync_star_offset = 520; static constexpr dart::compiler::target::word OneByteString_data_offset = 12; static constexpr dart::compiler::target::word PointerBase_data_offset = 4; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = 8; @@ -4913,27 +4913,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 1016; + ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 1088; + ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 1008; + ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 1040; + ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 1064; + ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 1024; + ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 1032; + ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 1056; + ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 1080; + ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 1048; + ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 1072; + ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word OneByteString_data_offset = 16; static constexpr dart::compiler::target::word PointerBase_data_offset = 8; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = @@ -5579,27 +5579,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 112; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 508; + ObjectStore_suspend_state_await_offset = 492; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 544; + ObjectStore_suspend_state_handle_exception_offset = 528; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 504; + ObjectStore_suspend_state_init_async_offset = 488; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 520; + ObjectStore_suspend_state_init_async_star_offset = 504; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 532; + ObjectStore_suspend_state_init_sync_star_offset = 516; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 512; + ObjectStore_suspend_state_return_async_offset = 496; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 516; + ObjectStore_suspend_state_return_async_not_future_offset = 500; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 528; + ObjectStore_suspend_state_return_async_star_offset = 512; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 540; + ObjectStore_suspend_state_return_sync_star_offset = 524; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 524; + ObjectStore_suspend_state_yield_async_star_offset = 508; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 536; + ObjectStore_suspend_state_yield_sync_star_offset = 520; static constexpr dart::compiler::target::word OneByteString_data_offset = 12; static constexpr dart::compiler::target::word PointerBase_data_offset = 4; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = 8; @@ -6237,27 +6237,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 1016; + ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 1088; + ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 1008; + ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 1040; + ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 1064; + ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 1024; + ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 1032; + ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 1056; + ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 1080; + ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 1048; + ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 1072; + ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word OneByteString_data_offset = 16; static constexpr dart::compiler::target::word PointerBase_data_offset = 8; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = @@ -6900,27 +6900,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 112; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 508; + ObjectStore_suspend_state_await_offset = 492; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 544; + ObjectStore_suspend_state_handle_exception_offset = 528; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 504; + ObjectStore_suspend_state_init_async_offset = 488; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 520; + ObjectStore_suspend_state_init_async_star_offset = 504; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 532; + ObjectStore_suspend_state_init_sync_star_offset = 516; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 512; + ObjectStore_suspend_state_return_async_offset = 496; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 516; + ObjectStore_suspend_state_return_async_not_future_offset = 500; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 528; + ObjectStore_suspend_state_return_async_star_offset = 512; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 540; + ObjectStore_suspend_state_return_sync_star_offset = 524; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 524; + ObjectStore_suspend_state_yield_async_star_offset = 508; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 536; + ObjectStore_suspend_state_yield_sync_star_offset = 520; static constexpr dart::compiler::target::word OneByteString_data_offset = 12; static constexpr dart::compiler::target::word PointerBase_data_offset = 4; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = 8; @@ -7555,27 +7555,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 1016; + ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 1088; + ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 1008; + ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 1040; + ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 1064; + ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 1024; + ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 1032; + ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 1056; + ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 1080; + ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 1048; + ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 1072; + ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word OneByteString_data_offset = 16; static constexpr dart::compiler::target::word PointerBase_data_offset = 8; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = @@ -8219,27 +8219,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 1016; + ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 1088; + ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 1008; + ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 1040; + ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 1064; + ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 1024; + ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 1032; + ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 1056; + ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 1080; + ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 1048; + ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 1072; + ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word OneByteString_data_offset = 16; static constexpr dart::compiler::target::word PointerBase_data_offset = 8; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = @@ -8882,27 +8882,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 1016; + ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 1088; + ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 1008; + ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 1040; + ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 1064; + ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 1024; + ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 1032; + ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 1056; + ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 1080; + ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 1048; + ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 1072; + ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word OneByteString_data_offset = 16; static constexpr dart::compiler::target::word PointerBase_data_offset = 8; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = @@ -9546,27 +9546,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 112; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 508; + ObjectStore_suspend_state_await_offset = 492; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 544; + ObjectStore_suspend_state_handle_exception_offset = 528; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 504; + ObjectStore_suspend_state_init_async_offset = 488; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 520; + ObjectStore_suspend_state_init_async_star_offset = 504; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 532; + ObjectStore_suspend_state_init_sync_star_offset = 516; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 512; + ObjectStore_suspend_state_return_async_offset = 496; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 516; + ObjectStore_suspend_state_return_async_not_future_offset = 500; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 528; + ObjectStore_suspend_state_return_async_star_offset = 512; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 540; + ObjectStore_suspend_state_return_sync_star_offset = 524; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 524; + ObjectStore_suspend_state_yield_async_star_offset = 508; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 536; + ObjectStore_suspend_state_yield_sync_star_offset = 520; static constexpr dart::compiler::target::word OneByteString_data_offset = 12; static constexpr dart::compiler::target::word PointerBase_data_offset = 4; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = 8; @@ -10206,27 +10206,27 @@ static constexpr dart::compiler::target::word ObjectStore_string_type_offset = static constexpr dart::compiler::target::word ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_await_offset = 1016; + ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_handle_exception_offset = 1088; + ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_offset = 1008; + ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_async_star_offset = 1040; + ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_init_sync_star_offset = 1064; + ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_offset = 1024; + ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_not_future_offset = 1032; + ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_async_star_offset = 1056; + ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_return_sync_star_offset = 1080; + ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_async_star_offset = 1048; + ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - ObjectStore_suspend_state_yield_sync_star_offset = 1072; + ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word OneByteString_data_offset = 16; static constexpr dart::compiler::target::word PointerBase_data_offset = 8; static constexpr dart::compiler::target::word Pointer_type_arguments_offset = @@ -10902,27 +10902,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 112; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 508; + AOT_ObjectStore_suspend_state_await_offset = 492; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 544; + AOT_ObjectStore_suspend_state_handle_exception_offset = 528; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 504; + AOT_ObjectStore_suspend_state_init_async_offset = 488; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 520; + AOT_ObjectStore_suspend_state_init_async_star_offset = 504; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 532; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 516; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 512; + AOT_ObjectStore_suspend_state_return_async_offset = 496; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 516; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 500; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 528; + AOT_ObjectStore_suspend_state_return_async_star_offset = 512; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 540; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 524; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 524; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 508; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 536; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 520; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 12; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 4; @@ -11641,27 +11641,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 1016; + AOT_ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 1088; + AOT_ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 1008; + AOT_ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 1040; + AOT_ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 1064; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 1024; + AOT_ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1032; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 1056; + AOT_ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 1080; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 1048; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1072; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 16; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8; @@ -12386,27 +12386,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 1016; + AOT_ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 1088; + AOT_ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 1008; + AOT_ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 1040; + AOT_ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 1064; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 1024; + AOT_ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1032; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 1056; + AOT_ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 1080; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 1048; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1072; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 16; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8; @@ -13128,27 +13128,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 1016; + AOT_ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 1088; + AOT_ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 1008; + AOT_ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 1040; + AOT_ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 1064; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 1024; + AOT_ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1032; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 1056; + AOT_ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 1080; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 1048; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1072; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 16; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8; @@ -13869,27 +13869,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 1016; + AOT_ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 1088; + AOT_ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 1008; + AOT_ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 1040; + AOT_ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 1064; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 1024; + AOT_ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1032; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 1056; + AOT_ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 1080; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 1048; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1072; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 16; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8; @@ -14611,27 +14611,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 112; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 508; + AOT_ObjectStore_suspend_state_await_offset = 492; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 544; + AOT_ObjectStore_suspend_state_handle_exception_offset = 528; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 504; + AOT_ObjectStore_suspend_state_init_async_offset = 488; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 520; + AOT_ObjectStore_suspend_state_init_async_star_offset = 504; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 532; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 516; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 512; + AOT_ObjectStore_suspend_state_return_async_offset = 496; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 516; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 500; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 528; + AOT_ObjectStore_suspend_state_return_async_star_offset = 512; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 540; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 524; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 524; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 508; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 536; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 520; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 12; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 4; @@ -15352,27 +15352,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 1016; + AOT_ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 1088; + AOT_ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 1008; + AOT_ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 1040; + AOT_ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 1064; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 1024; + AOT_ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1032; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 1056; + AOT_ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 1080; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 1048; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1072; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 16; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8; @@ -16087,27 +16087,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 112; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 508; + AOT_ObjectStore_suspend_state_await_offset = 492; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 544; + AOT_ObjectStore_suspend_state_handle_exception_offset = 528; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 504; + AOT_ObjectStore_suspend_state_init_async_offset = 488; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 520; + AOT_ObjectStore_suspend_state_init_async_star_offset = 504; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 532; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 516; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 512; + AOT_ObjectStore_suspend_state_return_async_offset = 496; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 516; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 500; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 528; + AOT_ObjectStore_suspend_state_return_async_star_offset = 512; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 540; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 524; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 524; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 508; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 536; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 520; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 12; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 4; @@ -16817,27 +16817,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 1016; + AOT_ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 1088; + AOT_ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 1008; + AOT_ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 1040; + AOT_ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 1064; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 1024; + AOT_ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1032; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 1056; + AOT_ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 1080; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 1048; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1072; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 16; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8; @@ -17553,27 +17553,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 1016; + AOT_ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 1088; + AOT_ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 1008; + AOT_ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 1040; + AOT_ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 1064; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 1024; + AOT_ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1032; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 1056; + AOT_ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 1080; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 1048; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1072; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 16; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8; @@ -18286,27 +18286,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 1016; + AOT_ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 1088; + AOT_ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 1008; + AOT_ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 1040; + AOT_ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 1064; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 1024; + AOT_ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1032; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 1056; + AOT_ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 1080; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 1048; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1072; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 16; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8; @@ -19018,27 +19018,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 1016; + AOT_ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 1088; + AOT_ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 1008; + AOT_ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 1040; + AOT_ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 1064; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 1024; + AOT_ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1032; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 1056; + AOT_ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 1080; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 1048; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1072; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 16; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8; @@ -19751,27 +19751,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 112; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 508; + AOT_ObjectStore_suspend_state_await_offset = 492; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 544; + AOT_ObjectStore_suspend_state_handle_exception_offset = 528; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 504; + AOT_ObjectStore_suspend_state_init_async_offset = 488; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 520; + AOT_ObjectStore_suspend_state_init_async_star_offset = 504; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 532; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 516; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 512; + AOT_ObjectStore_suspend_state_return_async_offset = 496; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 516; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 500; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 528; + AOT_ObjectStore_suspend_state_return_async_star_offset = 512; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 540; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 524; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 524; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 508; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 536; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 520; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 12; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 4; @@ -20483,27 +20483,27 @@ static constexpr dart::compiler::target::word static constexpr dart::compiler::target::word AOT_ObjectStore_type_type_offset = 224; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_await_offset = 1016; + AOT_ObjectStore_suspend_state_await_offset = 984; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_handle_exception_offset = 1088; + AOT_ObjectStore_suspend_state_handle_exception_offset = 1056; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_offset = 1008; + AOT_ObjectStore_suspend_state_init_async_offset = 976; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_async_star_offset = 1040; + AOT_ObjectStore_suspend_state_init_async_star_offset = 1008; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_init_sync_star_offset = 1064; + AOT_ObjectStore_suspend_state_init_sync_star_offset = 1032; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_offset = 1024; + AOT_ObjectStore_suspend_state_return_async_offset = 992; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1032; + AOT_ObjectStore_suspend_state_return_async_not_future_offset = 1000; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_async_star_offset = 1056; + AOT_ObjectStore_suspend_state_return_async_star_offset = 1024; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_return_sync_star_offset = 1080; + AOT_ObjectStore_suspend_state_return_sync_star_offset = 1048; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_async_star_offset = 1048; + AOT_ObjectStore_suspend_state_yield_async_star_offset = 1016; static constexpr dart::compiler::target::word - AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1072; + AOT_ObjectStore_suspend_state_yield_sync_star_offset = 1040; static constexpr dart::compiler::target::word AOT_OneByteString_data_offset = 16; static constexpr dart::compiler::target::word AOT_PointerBase_data_offset = 8; diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc index ec145d7b3e6..e2259d3c849 100644 --- a/runtime/vm/debugger.cc +++ b/runtime/vm/debugger.cc @@ -132,8 +132,7 @@ void BreakpointLocation::SetResolved(const Function& func, ASSERT(script_url.Equals(func_url)); #endif // defined(DEBUG) ASSERT(!IsLatent()); - ASSERT(func.is_generated_body() || - token_pos.IsWithin(func.token_pos(), func.end_token_pos())); + ASSERT(token_pos.IsWithin(func.token_pos(), func.end_token_pos())); ASSERT(func.is_debuggable()); token_pos_.store(token_pos); end_token_pos_.store(token_pos); @@ -722,67 +721,16 @@ intptr_t ActivationFrame::ContextLevel() { return context_level_; } -ObjectPtr ActivationFrame::GetAsyncContextVariable(const String& name) { - if (!function_.IsAsyncClosure() && !function_.IsAsyncGenClosure()) { - return Object::null(); - } - GetVarDescriptors(); - intptr_t var_ctxt_level = -1; - intptr_t ctxt_slot = -1; - intptr_t var_desc_len = var_descriptors_.Length(); - for (intptr_t i = 0; i < var_desc_len; i++) { - UntaggedLocalVarDescriptors::VarInfo var_info; - var_descriptors_.GetInfo(i, &var_info); - if (var_descriptors_.GetName(i) == name.ptr()) { - const int8_t kind = var_info.kind(); - if (!live_frame_) { - ASSERT(kind == UntaggedLocalVarDescriptors::kContextVar); - } - const auto variable_index = VariableIndex(var_info.index()); - if (kind == UntaggedLocalVarDescriptors::kStackVar) { - return GetStackVar(variable_index); - } else { - ASSERT(kind == UntaggedLocalVarDescriptors::kContextVar); - var_ctxt_level = var_info.scope_id; - ctxt_slot = variable_index.value(); - break; - } - } - } - if (var_ctxt_level >= 0) { - if (!live_frame_) { - ASSERT(!ctx_.IsNull()); - // Compiled code uses relative context levels, i.e. the frame context - // level is always 0 on entry. - const intptr_t frame_ctx_level = 0; - return GetRelativeContextVar(var_ctxt_level, ctxt_slot, frame_ctx_level); - } - return GetContextVar(var_ctxt_level, ctxt_slot); - } - return Object::null(); -} - ObjectPtr ActivationFrame::GetAsyncAwaiter( CallerClosureFinder* caller_closure_finder) { if (fp() != 0 && !function_.IsNull()) { - if (function_.IsCompactAsyncFunction() || - function_.IsCompactAsyncStarFunction()) { + if (function_.IsAsyncFunction() || function_.IsAsyncGenerator()) { const auto& suspend_state = Object::Handle(GetSuspendStateVar()); if (caller_closure_finder->WasPreviouslySuspended(function_, suspend_state)) { return caller_closure_finder->FindCallerFromSuspendState( SuspendState::Cast(suspend_state)); } - } else if (function_.IsAsyncClosure() || function_.IsAsyncGenClosure()) { - // Look up caller's closure on the stack. - ObjectPtr* last_caller_obj = reinterpret_cast(GetCallerSp()); - Closure& closure = Closure::Handle(); - closure = StackTraceUtils::FindClosureInFrame(last_caller_obj, function_); - - if (!closure.IsNull() && caller_closure_finder->IsRunningAsync(closure)) { - closure = caller_closure_finder->FindCaller(closure); - return closure.ptr(); - } } } @@ -829,22 +777,8 @@ bool ActivationFrame::HandlesException(const Instance& exc_obj) { try_index = handlers.OuterTryIndex(try_index); } // Async functions might have indirect exception handlers in the form of - // `Future.catchError`. Check the Closure's _FutureListeners. - if ((fp() != 0) && - (function().IsAsyncClosure() || function().IsAsyncGenClosure())) { - CallerClosureFinder caller_closure_finder(Thread::Current()->zone()); - ObjectPtr* last_caller_obj = reinterpret_cast(GetCallerSp()); - Closure& closure = Closure::Handle( - StackTraceUtils::FindClosureInFrame(last_caller_obj, function())); - if (!caller_closure_finder.IsRunningAsync(closure)) { - return false; - } - Object& futureOrListener = - Object::Handle(caller_closure_finder.GetAsyncFuture(closure)); - futureOrListener = - caller_closure_finder.GetFutureFutureListener(futureOrListener); - return caller_closure_finder.HasCatchError(futureOrListener); - } else if ((fp() != 0) && function().IsCompactAsyncFunction()) { + // `Future.catchError`. Check _FutureListeners. + if ((fp() != 0) && function().IsAsyncFunction()) { CallerClosureFinder caller_closure_finder(Thread::Current()->zone()); auto& suspend_state = Object::Handle(GetSuspendStateVar()); if (!caller_closure_finder.WasPreviouslySuspended(function(), @@ -861,70 +795,9 @@ bool ActivationFrame::HandlesException(const Instance& exc_obj) { return false; } -intptr_t ActivationFrame::GetAwaitJumpVariable() { - GetVarDescriptors(); - intptr_t var_ctxt_level = -1; - intptr_t ctxt_slot = -1; - intptr_t var_desc_len = var_descriptors_.Length(); - intptr_t await_jump_var = -1; - for (intptr_t i = 0; i < var_desc_len; i++) { - UntaggedLocalVarDescriptors::VarInfo var_info; - var_descriptors_.GetInfo(i, &var_info); - const int8_t kind = var_info.kind(); - if (var_descriptors_.GetName(i) == Symbols::AwaitJumpVar().ptr()) { - ASSERT(kind == UntaggedLocalVarDescriptors::kContextVar); - ASSERT(!ctx_.IsNull()); - var_ctxt_level = var_info.scope_id; - ctxt_slot = var_info.index(); - break; - } - } - if (var_ctxt_level >= 0) { - Object& await_jump_index = Object::Handle(ctx_.At(ctxt_slot)); - ASSERT(await_jump_index.IsSmi()); - await_jump_var = Smi::Cast(await_jump_index).Value(); - } - return await_jump_var; -} - -void ActivationFrame::ExtractTokenPositionFromAsyncClosure() { - // Attempt to determine the token pos and try index from the async closure. - Thread* thread = Thread::Current(); - Zone* zone = thread->zone(); - - ASSERT(function_.IsAsyncGenClosure() || function_.IsAsyncClosure()); - // This should only be called on frames that aren't active on the stack. - ASSERT(fp() == 0); - - const intptr_t await_jump_var = GetAwaitJumpVariable(); - if (await_jump_var < 0) { - return; - } - - const auto& pc_descriptors = - PcDescriptors::Handle(zone, code().pc_descriptors()); - ASSERT(!pc_descriptors.IsNull()); - PcDescriptors::Iterator it(pc_descriptors, UntaggedPcDescriptors::kOther); - while (it.MoveNext()) { - if (it.YieldIndex() == await_jump_var) { - try_index_ = it.TryIndex(); - token_pos_ = it.TokenPos(); - token_pos_initialized_ = true; - return; - } - } -} - bool ActivationFrame::IsAsyncMachinery() const { ASSERT(!function_.IsNull()); auto isolate_group = IsolateGroup::Current(); - if (function_.ptr() == - isolate_group->object_store()->complete_on_async_return() || - function_.ptr() == isolate_group->object_store() - ->complete_with_no_future_on_async_return()) { - // We are completing an async function's completer. - return true; - } if (function_.Owner() == isolate_group->object_store()->async_star_stream_controller()) { // We are inside the async* stream controller code. @@ -967,13 +840,6 @@ const Context& ActivationFrame::GetSavedCurrentContext() { return ctx_; } -ObjectPtr ActivationFrame::GetAsyncOperation() { - if (function().name() == Symbols::AsyncOperation().ptr()) { - return GetParameter(0); - } - return Object::null(); -} - ActivationFrame* DebuggerStackTrace::GetHandlerFrame( const Instance& exc_obj) const { for (intptr_t frame_index = 0; frame_index < Length(); frame_index++) { @@ -1647,8 +1513,6 @@ Debugger::Debugger(Isolate* isolate) stepping_fp_(0), last_stepping_fp_(0), last_stepping_pos_(TokenPosition::kNoSource), - async_stepping_fp_(0), - top_frame_awaiter_(Object::null()), skip_next_step_(false), synthetic_async_breakpoint_(NULL), exc_pause_info_(kNoPauseOnExceptions) {} @@ -1704,25 +1568,11 @@ bool Debugger::SetupStepOverAsyncSuspension(const char** error) { } return false; } - if (top_frame->function().IsCompactAsyncFunction() || - top_frame->function().IsCompactAsyncStarFunction()) { - const auto& function_data = - Object::Handle(top_frame->GetSuspendableFunctionData()); - SetBreakpointAtResumption(function_data); - return true; - } - Object& closure = Object::Handle(top_frame->GetAsyncOperation()); - ASSERT(!closure.IsNull()); - ASSERT(closure.IsInstance()); - ASSERT(Instance::Cast(closure).IsClosure()); - Breakpoint* bpt = SetBreakpointAtActivation(Instance::Cast(closure), true); - if (bpt == NULL) { - // Unable to set the breakpoint. - if (error != nullptr) { - *error = "Unable to set breakpoint at async suspension point"; - } - return false; - } + ASSERT(top_frame->function().IsAsyncFunction() || + top_frame->function().IsAsyncGenerator()); + const auto& function_data = + Object::Handle(top_frame->GetSuspendableFunctionData()); + SetBreakpointAtResumption(function_data); return true; } @@ -2062,7 +1912,6 @@ DebuggerStackTrace* DebuggerStackTrace::CollectAwaiterReturn() { Closure& async_activation = Closure::Handle(zone); Array& deopt_frame = Array::Handle(zone); bool stack_has_async_function = false; - Closure& closure = Closure::Handle(); CallerClosureFinder caller_closure_finder(zone); @@ -2083,25 +1932,7 @@ DebuggerStackTrace* DebuggerStackTrace::CollectAwaiterReturn() { // Simple frame. Just add the one. if (!code.is_optimized()) { function = code.function(); - if (function.IsAsyncClosure() || function.IsAsyncGenClosure()) { - ActivationFrame* activation = CollectDartFrame( - isolate, frame->pc(), frame, code, Object::null_array(), 0, - ActivationFrame::kAsyncActivation); - ASSERT(activation != nullptr); - stack_trace->AddActivation(activation); - stack_has_async_function = true; - // Grab the awaiter. - async_activation ^= activation->GetAsyncAwaiter(&caller_closure_finder); - // Bail if we've reach the end of sync execution stack. - ObjectPtr* last_caller_obj = - reinterpret_cast(frame->GetCallerSp()); - closure = - StackTraceUtils::FindClosureInFrame(last_caller_obj, function); - if (caller_closure_finder.IsRunningAsync(closure)) { - break; - } - } else if (function.IsCompactAsyncFunction() || - function.IsCompactAsyncStarFunction()) { + if (function.IsAsyncFunction() || function.IsAsyncGenerator()) { ActivationFrame* activation = CollectDartFrame( isolate, frame->pc(), frame, code, Object::null_array(), 0, ActivationFrame::kAsyncActivation); @@ -2152,9 +1983,7 @@ DebuggerStackTrace* DebuggerStackTrace::CollectAwaiterReturn() { } intptr_t deopt_frame_offset = it.GetDeoptFpOffset(); - if (function.IsAsyncClosure() || function.IsAsyncGenClosure() || - function.IsCompactAsyncFunction() || - function.IsCompactAsyncStarFunction()) { + if (function.IsAsyncFunction() || function.IsAsyncGenerator()) { ActivationFrame* activation = CollectDartFrame( isolate, it.pc(), frame, inlined_code, deopt_frame, deopt_frame_offset, ActivationFrame::kAsyncActivation); @@ -2187,10 +2016,6 @@ DebuggerStackTrace* DebuggerStackTrace::CollectAwaiterReturn() { async_activation.context() != Object::null()) { ActivationFrame* activation = new (zone) ActivationFrame(async_activation, &caller_closure_finder); - if (activation->function().IsAsyncClosure() || - activation->function().IsAsyncGenClosure()) { - activation->ExtractTokenPositionFromAsyncClosure(); - } stack_trace->AddActivation(activation); if (FLAG_trace_debugger_stacktrace) { OS::PrintErr( @@ -2327,19 +2152,6 @@ bool Debugger::ShouldPauseOnException(DebuggerStackTrace* stack_trace, } auto& handler_function = Function::Handle(handler_frame->function().ptr()); - // If the handler function is an synthetic inner function, we need to look for - // the annotations on the outer function. - if (handler_function.IsAsyncClosure()) { - // async :async_op - handler_function = handler_function.parent_function(); - } else if (handler_frame->function().IsAsyncGenClosure()) { - // async* :async_op - handler_function = handler_function.parent_function(); - } else if (handler_frame->function().IsSyncGenClosure()) { - // sync* :sync_op + :sync_op_gen - handler_function = handler_function.parent_function(); - handler_function = handler_function.parent_function(); - } // If handler_frame's function is annotated with // @pragma('vm:notify-debugger-on-exception'), we specifically want to notify @@ -3101,11 +2913,7 @@ void GroupDebugger::SyncBreakpointLocation(BreakpointLocation* loc) { Breakpoint* Debugger::SetBreakpointAtEntry(const Function& target_function, bool single_shot) { ASSERT(!target_function.IsNull()); - // AsyncFunction is marked not debuggable. When target_function is an async - // function, it is actually referring the inner async_op. Allow the - // breakpoint to be set, it will get resolved correctly when inner async_op - // gets compiled. - if (!target_function.is_debuggable() && !target_function.IsAsyncFunction()) { + if (!target_function.is_debuggable()) { return NULL; } const Script& script = Script::Handle(target_function.script()); @@ -3374,26 +3182,6 @@ void GroupDebugger::NotifyCompilation(const Function& function) { return; } Function& resolved_function = Function::Handle(function.ptr()); - // Synchronous generators have the form: - // - // user_func sync* { - // :sync_op_gen() { - // :sync_op(..) yielding { - // // ... - // } - // } - // } - // - // Setting a breakpoint in a sync* function should result in a code - // breakpoint being inserted into the synthetic :sync_op(..) function node. - // In order to ensure we're setting the breakpoint in the right function, - // we need to be able to check against the token positions of the - // non-synthetic function. Note, we only check for the innermost synthetic - // method as this is where the user's code will execute. - if (function.IsSyncGenClosure()) { - resolved_function ^= function.parent_function(); - resolved_function ^= resolved_function.parent_function(); - } auto thread = Thread::Current(); auto zone = thread->zone(); @@ -3445,7 +3233,6 @@ void Debugger::VisitObjectPointers(ObjectPointerVisitor* visitor) { loc->VisitObjectPointers(visitor); loc = loc->next(); } - visitor->VisitPointer(reinterpret_cast(&top_frame_awaiter_)); for (intptr_t i = 0, n = breakpoints_at_resumption_.length(); i < n; ++i) { visitor->VisitPointer(&breakpoints_at_resumption_[i]); } @@ -3500,14 +3287,13 @@ void GroupDebugger::Pause() { } void Debugger::EnterSingleStepMode() { - ResetSteppingFramePointers(); + ResetSteppingFramePointer(); DeoptimizeWorld(); NotifySingleStepping(true); } -void Debugger::ResetSteppingFramePointers() { +void Debugger::ResetSteppingFramePointer() { stepping_fp_ = 0; - async_stepping_fp_ = 0; } bool Debugger::SteppedForSyntheticAsyncBreakpoint() const { @@ -3521,32 +3307,6 @@ void Debugger::CleanupSyntheticAsyncBreakpoint() { } } -void Debugger::RememberTopFrameAwaiter() { - if (!FLAG_async_debugger) { - return; - } - if (stack_trace_->Length() > 0) { - CallerClosureFinder caller_closure_finder(Thread::Current()->zone()); - top_frame_awaiter_ = - stack_trace_->FrameAt(0)->GetAsyncAwaiter(&caller_closure_finder); - } else { - top_frame_awaiter_ = Object::null(); - } -} - -void Debugger::SetAsyncSteppingFramePointer(DebuggerStackTrace* stack_trace) { - if (!FLAG_async_debugger) { - return; - } - if ((stack_trace->Length()) > 0 && - (stack_trace->FrameAt(0)->function().IsAsyncClosure() || - stack_trace->FrameAt(0)->function().IsAsyncGenClosure())) { - async_stepping_fp_ = stack_trace->FrameAt(0)->fp(); - } else { - async_stepping_fp_ = 0; - } -} - void Debugger::SetSyncSteppingFramePointer(DebuggerStackTrace* stack_trace) { if (stack_trace->Length() > 0) { stepping_fp_ = stack_trace->FrameAt(0)->fp(); @@ -3557,8 +3317,7 @@ void Debugger::SetSyncSteppingFramePointer(DebuggerStackTrace* stack_trace) { void Debugger::HandleSteppingRequest(DebuggerStackTrace* stack_trace, bool skip_next_step) { - ResetSteppingFramePointers(); - RememberTopFrameAwaiter(); + ResetSteppingFramePointer(); if (resume_action_ == kStepInto) { // When single stepping, we need to deoptimize because we might be // stepping into optimized code. This happens in particular if @@ -3568,7 +3327,6 @@ void Debugger::HandleSteppingRequest(DebuggerStackTrace* stack_trace, DeoptimizeWorld(); NotifySingleStepping(true); skip_next_step_ = skip_next_step; - SetAsyncSteppingFramePointer(stack_trace); if (FLAG_verbose_debug) { OS::PrintErr("HandleSteppingRequest- kStepInto\n"); } @@ -3577,16 +3335,13 @@ void Debugger::HandleSteppingRequest(DebuggerStackTrace* stack_trace, NotifySingleStepping(true); skip_next_step_ = skip_next_step; SetSyncSteppingFramePointer(stack_trace); - SetAsyncSteppingFramePointer(stack_trace); if (FLAG_verbose_debug) { OS::PrintErr("HandleSteppingRequest- kStepOver %" Px "\n", stepping_fp_); } } else if (resume_action_ == kStepOut) { if (FLAG_async_debugger) { - if (stack_trace->FrameAt(0)->function().IsAsyncClosure() || - stack_trace->FrameAt(0)->function().IsAsyncGenClosure() || - stack_trace->FrameAt(0)->function().IsCompactAsyncFunction() || - stack_trace->FrameAt(0)->function().IsCompactAsyncStarFunction()) { + if (stack_trace->FrameAt(0)->function().IsAsyncFunction() || + stack_trace->FrameAt(0)->function().IsAsyncGenerator()) { CallerClosureFinder caller_closure_finder(Thread::Current()->zone()); // Request to step out of an async/async* closure. const Object& async_op = Object::Handle( @@ -3962,7 +3717,7 @@ void Debugger::set_resume_action(ResumeAction resume_action) { void Debugger::SignalPausedEvent(ActivationFrame* top_frame, Breakpoint* bpt) { set_resume_action(kContinue); - ResetSteppingFramePointers(); + ResetSteppingFramePointer(); NotifySingleStepping(false); ASSERT(!IsPaused()); if ((bpt != NULL) && bpt->IsSingleShot()) { @@ -3979,17 +3734,9 @@ void Debugger::SignalPausedEvent(ActivationFrame* top_frame, Breakpoint* bpt) { static bool IsAtAsyncJump(ActivationFrame* top_frame) { Zone* zone = Thread::Current()->zone(); - if (!top_frame->function().IsCompactAsyncFunction() && - !top_frame->function().IsCompactAsyncStarFunction()) { - Object& closure_or_null = - Object::Handle(zone, top_frame->GetAsyncOperation()); - if (closure_or_null.IsNull()) { - return false; - } - ASSERT(top_frame->function().IsAsyncClosure() || - top_frame->function().IsAsyncGenClosure()); - ASSERT(closure_or_null.IsInstance()); - ASSERT(Instance::Cast(closure_or_null).IsClosure()); + if (!top_frame->function().IsAsyncFunction() && + !top_frame->function().IsAsyncGenerator()) { + return false; } const auto& pc_descriptors = PcDescriptors::Handle(zone, top_frame->code().pc_descriptors()); @@ -4026,27 +3773,6 @@ ErrorPtr Debugger::PauseStepping() { ActivationFrame* frame = TopDartFrame(); ASSERT(frame != NULL); - if (FLAG_async_debugger) { - if ((async_stepping_fp_ != 0) && (top_frame_awaiter_ != Object::null())) { - // Check if the user has single stepped out of an async function with - // an awaiter. The first check handles the case of calling into the - // async machinery as we finish the async function. The second check - // handles the case of returning from an async function. - const ActivationFrame::Relation relation = - frame->CompareTo(async_stepping_fp_); - const bool exited_async_function = - (relation == ActivationFrame::kCallee && frame->IsAsyncMachinery()) || - relation == ActivationFrame::kCaller; - if (exited_async_function) { - // Step to the top frame awaiter. - const Object& async_op = Object::Handle(top_frame_awaiter_); - top_frame_awaiter_ = Object::null(); - AsyncStepInto(Closure::Cast(async_op)); - return Error::null(); - } - } - } - if (stepping_fp_ != 0) { // There is an "interesting frame" set. Only pause at appropriate // locations in this frame. @@ -4059,35 +3785,7 @@ ErrorPtr Debugger::PauseStepping() { // We returned from the "interesting frame", there can be no more // stepping breaks for it. Pause at the next appropriate location // and let the user set the "interesting" frame again. - ResetSteppingFramePointers(); - } - } - - // We need to manually set a synthetic breakpoint for async_op before entry. - // async and async* functions always contain synthetic async_ops. - if ((frame->function().IsAsyncFunction() || - frame->function().IsAsyncGenerator()) && - !frame->function().IsSuspendableFunction()) { - ASSERT(!frame->GetSavedCurrentContext().IsNull()); - ASSERT(frame->GetSavedCurrentContext().num_variables() > - Context::kAsyncFutureIndex); - - const Object& async_future = Object::Handle( - frame->GetSavedCurrentContext().At(Context::kAsyncFutureIndex)); - - // Only set breakpoint when entering async_op the first time. - // :async_future should be uninitialised at this point: - if (async_future.IsNull()) { - const Function& async_op = Function::Handle( - ClosureFunctionsCache::GetUniqueInnerClosure(frame->function())); - if (!async_op.IsNull()) { - SetBreakpointAtAsyncOp(async_op); - // After setting the breakpoint we stop stepping and continue the - // debugger until the next breakpoint, to step over all the - // synthetic code. - Continue(); - return Error::null(); - } + ResetSteppingFramePointer(); } } @@ -4107,8 +3805,8 @@ ErrorPtr Debugger::PauseStepping() { // TODO(dartbug.com/48378): Consider aligning async/async* functions // with regular function wrt the first stop in the function prologue. - if ((frame->function().IsCompactAsyncFunction() || - frame->function().IsCompactAsyncStarFunction()) && + if ((frame->function().IsAsyncFunction() || + frame->function().IsAsyncGenerator()) && frame->GetSuspendStateVar() == Object::null()) { return Error::null(); } @@ -4739,7 +4437,7 @@ void Debugger::AsyncStepInto(const Closure& async_op) { void Debugger::Continue() { SetResumeAction(kContinue); - ResetSteppingFramePointers(); + ResetSteppingFramePointer(); NotifySingleStepping(false); } diff --git a/runtime/vm/debugger.h b/runtime/vm/debugger.h index 56dfd6d7fe2..625d1486647 100644 --- a/runtime/vm/debugger.h +++ b/runtime/vm/debugger.h @@ -388,7 +388,6 @@ class ActivationFrame : public ZoneAllocated { ObjectPtr GetReceiver(); const Context& GetSavedCurrentContext(); - ObjectPtr GetAsyncOperation(); ObjectPtr GetSuspendStateVar(); ObjectPtr GetSuspendableFunctionData(); @@ -426,14 +425,6 @@ class ActivationFrame : public ZoneAllocated { void GetVarDescriptors(); void GetDescIndices(); - ObjectPtr GetAsyncContextVariable(const String& name); - - // Get the current continuation index in the :await_jump_var pulled from the - // context. - intptr_t GetAwaitJumpVariable(); - - void ExtractTokenPositionFromAsyncClosure(); - bool IsAsyncMachinery() const; static const char* KindToCString(Kind kind) { @@ -912,11 +903,9 @@ class Debugger { const Code& code, intptr_t post_deopt_frame_index); - void ResetSteppingFramePointers(); + void ResetSteppingFramePointer(); bool SteppedForSyntheticAsyncBreakpoint() const; void CleanupSyntheticAsyncBreakpoint(); - void RememberTopFrameAwaiter(); - void SetAsyncSteppingFramePointer(DebuggerStackTrace* stack_trace); void SetSyncSteppingFramePointer(DebuggerStackTrace* stack_trace); GroupDebugger* group_debugger() { return isolate_->group()->debugger(); } @@ -961,10 +950,6 @@ class Debugger { uword last_stepping_fp_; TokenPosition last_stepping_pos_; - // Used to track the current async/async* function. - uword async_stepping_fp_; - ObjectPtr top_frame_awaiter_; - // If we step while at a breakpoint, we would hit the same pc twice. // We use this field to let us skip the next single-step after a // breakpoint. diff --git a/runtime/vm/flag_list.h b/runtime/vm/flag_list.h index 46a7bd5f32c..fa58e0206e3 100644 --- a/runtime/vm/flag_list.h +++ b/runtime/vm/flag_list.h @@ -90,9 +90,6 @@ constexpr bool FLAG_support_il_printer = false; "Abort if memory allocation fails - use only with --old-gen-heap-size") \ C(async_debugger, false, false, bool, true, \ "Debugger support async functions.") \ - P(async_igoto_threshold, int, 5, \ - "Number of continuations after which igoto-based async is used." \ - "-1 means never.") \ P(background_compilation, bool, kDartUseBackgroundCompilation, \ "Run optimizing compilation in background") \ P(check_token_positions, bool, false, \ diff --git a/runtime/vm/kernel_loader.cc b/runtime/vm/kernel_loader.cc index 54dc5d93c20..a7407c5f9b7 100644 --- a/runtime/vm/kernel_loader.cc +++ b/runtime/vm/kernel_loader.cc @@ -2038,50 +2038,23 @@ void KernelLoader::LoadProcedure(const Library& library, function_node_helper.ReadUntilIncluding(FunctionNodeHelper::kDartAsyncMarker); if (function_node_helper.async_marker_ == FunctionNodeHelper::kAsync) { function.set_modifier(UntaggedFunction::kAsync); - function.set_is_debuggable(true); function.set_is_inlinable(false); - function.set_is_visible(true); - ASSERT(function.IsCompactAsyncFunction()); + ASSERT(function.IsAsyncFunction()); } else if (function_node_helper.async_marker_ == FunctionNodeHelper::kAsyncStar) { function.set_modifier(UntaggedFunction::kAsyncGen); - function.set_is_debuggable(true); function.set_is_inlinable(false); - function.set_is_visible(true); - ASSERT(function.IsCompactAsyncStarFunction()); + ASSERT(function.IsAsyncGenerator()); } else if (function_node_helper.async_marker_ == FunctionNodeHelper::kSyncStar) { function.set_modifier(UntaggedFunction::kSyncGen); - function.set_is_debuggable(true); function.set_is_inlinable(false); - function.set_is_visible(true); - ASSERT(function.IsCompactSyncStarFunction()); + ASSERT(function.IsSyncGenerator()); } else { ASSERT(function_node_helper.async_marker_ == FunctionNodeHelper::kSync); - function.set_is_debuggable(function_node_helper.dart_async_marker_ == - FunctionNodeHelper::kSync); - switch (function_node_helper.dart_async_marker_) { - case FunctionNodeHelper::kSyncStar: - function.set_modifier(UntaggedFunction::kSyncGen); - function.set_is_visible(false); - break; - case FunctionNodeHelper::kAsync: - function.set_modifier(UntaggedFunction::kAsync); - function.set_is_inlinable(false); - function.set_is_visible(false); - break; - case FunctionNodeHelper::kAsyncStar: - function.set_modifier(UntaggedFunction::kAsyncGen); - function.set_is_inlinable(false); - function.set_is_visible(false); - break; - default: - // no special modifier - break; - } - ASSERT(!function.IsCompactAsyncFunction()); - ASSERT(!function.IsCompactAsyncStarFunction()); - ASSERT(!function.IsCompactSyncStarFunction()); + ASSERT(!function.IsAsyncFunction()); + ASSERT(!function.IsAsyncGenerator()); + ASSERT(!function.IsSyncGenerator()); } if (!native_name.IsNull()) { diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index bdd1af2bf72..fa75c093537 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -3984,6 +3984,7 @@ FunctionPtr Function::CreateDynamicInvocationForwarder( // TODO(dartbug.com/37737): Currently, we intentionally keep the recognized // kind when creating the dynamic invocation forwarder. forwarder.set_kind(UntaggedFunction::kDynamicInvocationForwarder); + forwarder.set_modifier(UntaggedFunction::kNoModifier); forwarder.set_is_debuggable(false); // TODO(vegorov) for error reporting reasons it is better to make this @@ -8203,7 +8204,7 @@ bool Function::CanBeInlined() const { return false; } - return is_inlinable() && !is_generated_body(); + return is_inlinable(); } #endif // !defined(DART_PRECOMPILED_RUNTIME) @@ -9120,7 +9121,6 @@ FunctionPtr Function::New(const FunctionType& signature, result.set_is_visible(true); // Will be computed later. result.set_is_debuggable(true); // Will be computed later. result.set_is_intrinsic(false); - result.set_is_generated_body(false); result.set_has_pragma(false); result.set_is_polymorphic_target(false); result.set_is_synthetic(false); @@ -9905,22 +9905,7 @@ void Function::PrintName(const NameFormattingParams& params, return; } auto& fun = Function::Handle(ptr()); - intptr_t fun_depth = 0; - // If |this| is a generated body closure, start with the closest - // non-generated parent function. - while (fun.is_generated_body()) { - fun = fun.parent_function(); - fun_depth++; - } FunctionPrintNameHelper(fun, params, printer); - // If we skipped generated bodies then append a suffix to the end. - if (fun_depth > 0 && params.disambiguate_names) { - printer->AddString("{body"); - if (fun_depth > 1) { - printer->Printf(" depth %" Pd "", fun_depth); - } - printer->AddString("}"); - } } StringPtr Function::GetSource() const { diff --git a/runtime/vm/object.h b/runtime/vm/object.h index ab528c39754..2c34da3a977 100644 --- a/runtime/vm/object.h +++ b/runtime/vm/object.h @@ -3576,106 +3576,28 @@ class Function : public Object { UntaggedFunction::kFfiTrampoline; } - // Recognise async functions like: - // user_func async { - // // ... - // } - bool IsAsyncFunction() const { - return modifier() == UntaggedFunction::kAsync; - } - - // TODO(dartbug.com/48378): replace this predicate with IsAsyncFunction() - // after old async functions are removed. - bool IsCompactAsyncFunction() const { - return IsAsyncFunction() && is_debuggable(); - } - - // TODO(dartbug.com/48378): replace this predicate with IsAsyncGenerator() - // after old async* functions are removed. - bool IsCompactAsyncStarFunction() const { - return IsAsyncGenerator() && is_debuggable(); - } - - // TODO(dartbug.com/48378): replace this predicate with IsSyncGenerator() - // after old sync* functions are removed. - bool IsCompactSyncStarFunction() const { - return IsSyncGenerator() && is_debuggable(); - } - // Returns true for functions which execution can be suspended // using Suspend/Resume stubs. Such functions have an artificial // :suspend_state local variable at the fixed location of the frame. bool IsSuspendableFunction() const { - return IsCompactAsyncFunction() || IsCompactAsyncStarFunction() || - IsCompactSyncStarFunction(); + return modifier() != UntaggedFunction::kNoModifier; } - // Recognise synthetic sync-yielding functions like the inner-most: - // user_func /* was async */ { - // :async_op(..) yielding { - // // ... - // } - // } - bool IsAsyncClosure() const { - return is_generated_body() && - Function::Handle(parent_function()).IsAsyncFunction(); + // Returns true if this function is marked with 'async' modifier. + bool IsAsyncFunction() const { + return modifier() == UntaggedFunction::kAsync; } - // Recognise sync* functions like: - // user_func sync* { - // // ... - // } + // Returns true if this function is marked with 'sync*' modifier. bool IsSyncGenerator() const { return modifier() == UntaggedFunction::kSyncGen; } - // Recognise synthetic :sync_op_gen()s like: - // user_func /* was sync* */ { - // :sync_op_gen() { - // // ... - // } - // } - bool IsSyncGenClosureMaker() const { - return is_generated_body() && - Function::Handle(parent_function()).IsSyncGenerator(); - } - - // Recognise async* functions like: - // user_func async* { - // // ... - // } + // Returns true if this function is marked with 'async*' modifier. bool IsAsyncGenerator() const { return modifier() == UntaggedFunction::kAsyncGen; } - // Recognise synthetic sync-yielding functions like the inner-most: - // user_func /* originally async* */ { - // :async_op(..) yielding { - // // ... - // } - // } - bool IsAsyncGenClosure() const { - return is_generated_body() && - Function::Handle(parent_function()).IsAsyncGenerator(); - } - - bool IsAsyncOrGenerator() const { - return modifier() != UntaggedFunction::kNoModifier; - } - - // Recognise synthetic sync-yielding functions like the inner-most: - // user_func /* was sync* */ { - // :sync_op_gen() { - // :sync_op(..) yielding { - // // ... - // } - // } - // } - bool IsSyncGenClosure() const { - return is_generated_body() && - Function::Handle(parent_function()).IsSyncGenClosureMaker(); - } - bool IsTypedDataViewFactory() const { if (is_native() && kind() == UntaggedFunction::kConstructor) { // This is a native factory constructor. @@ -3855,7 +3777,6 @@ class Function : public Object { // native: Bridge to C/C++ code. // external: Just a declaration that expects to be defined in another patch // file. - // generated_body: Has a generated body. // polymorphic_target: A polymorphic method. // has_pragma: Has a @pragma decoration. // no_such_method_forwarder: A stub method that just calls noSuchMethod. @@ -3872,7 +3793,6 @@ class Function : public Object { V(Intrinsic, is_intrinsic) \ V(Native, is_native) \ V(External, is_external) \ - V(GeneratedBody, is_generated_body) \ V(PolymorphicTarget, is_polymorphic_target) \ V(HasPragma, has_pragma) \ V(IsSynthetic, is_synthetic) \ diff --git a/runtime/vm/object_store.cc b/runtime/vm/object_store.cc index 8bdf2695b73..9dad446f1fe 100644 --- a/runtime/vm/object_store.cc +++ b/runtime/vm/object_store.cc @@ -252,38 +252,6 @@ void ObjectStore::InitKnownObjects() { Function& function = Function::Handle(zone); Field& field = Field::Handle(zone); - function_name = async_lib.PrivateName(Symbols::AsyncStarMoveNextHelper()); - ASSERT(!function_name.IsNull()); - function = Resolver::ResolveStatic(async_lib, Object::null_string(), - function_name, 0, 1, Object::null_array()); - ASSERT(!function.IsNull()); - set_async_star_move_next_helper(function); - - function_name = async_lib.PrivateName(Symbols::_CompleteOnAsyncReturn()); - ASSERT(!function_name.IsNull()); - function = Resolver::ResolveStatic(async_lib, Object::null_string(), - function_name, 0, 3, Object::null_array()); - ASSERT(!function.IsNull()); - set_complete_on_async_return(function); - DisableDebuggingAndInlining(function); - - function_name = - async_lib.PrivateName(Symbols::_CompleteWithNoFutureOnAsyncReturn()); - ASSERT(!function_name.IsNull()); - function = Resolver::ResolveStatic(async_lib, Object::null_string(), - function_name, 0, 3, Object::null_array()); - ASSERT(!function.IsNull()); - set_complete_with_no_future_on_async_return(function); - DisableDebuggingAndInlining(function); - - function_name = async_lib.PrivateName(Symbols::_CompleteOnAsyncError()); - ASSERT(!function_name.IsNull()); - function = Resolver::ResolveStatic(async_lib, Object::null_string(), - function_name, 0, 4, Object::null_array()); - ASSERT(!function.IsNull()); - set_complete_on_async_error(function); - DisableDebuggingAndInlining(function); - cls = async_lib.LookupClassAllowPrivate(Symbols::_AsyncStarStreamController()); ASSERT(!cls.IsNull()); diff --git a/runtime/vm/object_store.h b/runtime/vm/object_store.h index 02a3f48061e..22702c751f1 100644 --- a/runtime/vm/object_store.h +++ b/runtime/vm/object_store.h @@ -165,12 +165,8 @@ class ObjectPointerVisitor; RW(Function, simple_instance_of_function) \ RW(Function, simple_instance_of_true_function) \ RW(Function, simple_instance_of_false_function) \ - RW(Function, async_star_move_next_helper) \ RW(Function, async_star_stream_controller_add) \ RW(Function, async_star_stream_controller_add_stream) \ - RW(Function, complete_on_async_return) \ - RW(Function, complete_with_no_future_on_async_return) \ - RW(Function, complete_on_async_error) \ RW(Function, suspend_state_init_async) \ RW(Function, suspend_state_await) \ RW(Function, suspend_state_return_async) \ diff --git a/runtime/vm/scopes.cc b/runtime/vm/scopes.cc index 412c3b31ea9..4dacf03b86d 100644 --- a/runtime/vm/scopes.cc +++ b/runtime/vm/scopes.cc @@ -144,26 +144,14 @@ VariableIndex LocalScope::AllocateVariables(const Function& function, VariableIndex next_index = first_parameter_index; // Current free frame index. - LocalVariable* await_jump_var = nullptr; - LocalVariable* async_future = nullptr; - LocalVariable* controller = nullptr; LocalVariable* chained_future = nullptr; - LocalVariable* is_sync = nullptr; LocalVariable* suspend_state_var = nullptr; for (intptr_t i = 0; i < num_variables(); i++) { LocalVariable* variable = VariableAt(i); if (variable->owner() == this) { if (variable->is_captured()) { - if (variable->name().Equals(Symbols::AwaitJumpVar())) { - await_jump_var = variable; - } else if (variable->name().Equals(Symbols::AsyncFuture())) { - async_future = variable; - } else if (variable->name().Equals(Symbols::Controller())) { - controller = variable; - } else if (variable->is_chained_future()) { + if (variable->is_chained_future()) { chained_future = variable; - } else if (variable->name().Equals(Symbols::is_sync())) { - is_sync = variable; } } else { if (variable->name().Equals(Symbols::SuspendStateVar())) { @@ -172,23 +160,6 @@ VariableIndex LocalScope::AllocateVariables(const Function& function, } } } - // If we are in an async/async* function, force :await_jump_var and - // :async_future to be at fixed locations in the slot. - if (await_jump_var != nullptr) { - AllocateContextVariable(await_jump_var, &context_owner); - *found_captured_variables = true; - ASSERT(await_jump_var->index().value() == Context::kAwaitJumpVarIndex); - } - if (async_future != nullptr) { - AllocateContextVariable(async_future, &context_owner); - *found_captured_variables = true; - ASSERT(async_future->index().value() == Context::kAsyncFutureIndex); - } - if (controller != nullptr) { - AllocateContextVariable(controller, &context_owner); - *found_captured_variables = true; - ASSERT(controller->index().value() == Context::kControllerIndex); - } if (chained_future != nullptr) { AllocateContextVariable(chained_future, &context_owner); *found_captured_variables = true; @@ -217,11 +188,6 @@ VariableIndex LocalScope::AllocateVariables(const Function& function, UNREACHABLE(); } } - if (is_sync != nullptr) { - AllocateContextVariable(is_sync, &context_owner); - *found_captured_variables = true; - ASSERT(is_sync->index().value() == Context::kIsSyncIndex); - } if (suspend_state_var != nullptr) { suspend_state_var->set_index( @@ -257,9 +223,7 @@ VariableIndex LocalScope::AllocateVariables(const Function& function, if (variable->owner() == this) { if (variable->is_captured()) { // Skip the variables already pre-allocated above. - if (variable != await_jump_var && variable != async_future && - variable != controller && variable != chained_future && - variable != is_sync) { + if (variable != chained_future) { AllocateContextVariable(variable, &context_owner); *found_captured_variables = true; } @@ -295,26 +259,6 @@ VariableIndex LocalScope::AllocateVariables(const Function& function, // The parser creates internal variables that start with ":" static bool IsFilteredIdentifier(const String& str) { ASSERT(str.Length() > 0); - if (str.ptr() == Symbols::AsyncOperation().ptr()) { - // Keep :async_op for asynchronous debugging. - return false; - } - if (str.ptr() == Symbols::AsyncFuture().ptr()) { - // Keep :async_future for asynchronous debugging. - return false; - } - if (str.ptr() == Symbols::ControllerStream().ptr()) { - // Keep :controller_stream for asynchronous debugging. - return false; - } - if (str.ptr() == Symbols::AwaitJumpVar().ptr()) { - // Keep :await_jump_var for asynchronous debugging. - return false; - } - if (str.ptr() == Symbols::is_sync().ptr()) { - // Keep :is_sync for asynchronous debugging. - return false; - } if (str.ptr() == Symbols::FunctionTypeArgumentsVar().ptr()) { // Keep :function_type_arguments for accessing type variables in debugging. return false; diff --git a/runtime/vm/source_report.cc b/runtime/vm/source_report.cc index 9a75218d890..b78960acab9 100644 --- a/runtime/vm/source_report.cc +++ b/runtime/vm/source_report.cc @@ -553,34 +553,29 @@ void SourceReport::VisitFunction(JSONArray* jsarr, const Function& func) { } ASSERT(!code.IsNull()); - // We skip compiled sync generators. Once a sync generator has been compiled, - // there is another function with the same range which actually contains the - // user code. - if (!func.IsSyncGenerator() || func.IsSuspendableFunction()) { - JSONObject range(jsarr); - range.AddProperty("scriptIndex", script_index); - range.AddProperty("startPos", begin_pos); - range.AddProperty("endPos", end_pos); - range.AddProperty("compiled", true); + JSONObject range(jsarr); + range.AddProperty("scriptIndex", script_index); + range.AddProperty("startPos", begin_pos); + range.AddProperty("endPos", end_pos); + range.AddProperty("compiled", true); - if (IsReportRequested(kCallSites)) { - PrintCallSitesData(&range, func, code); - } - if (IsReportRequested(kCoverage)) { - PrintCoverageData(&range, func, code, /* report_branch_coverage */ false); - } - if (IsReportRequested(kBranchCoverage)) { - PrintCoverageData(&range, func, code, /* report_branch_coverage */ true); - } - if (IsReportRequested(kPossibleBreakpoints)) { - PrintPossibleBreakpointsData(&range, func, code); - } - if (IsReportRequested(kProfile)) { - ProfileFunction* profile_function = profile_.FindFunction(func); - if ((profile_function != NULL) && - (profile_function->NumSourcePositions() > 0)) { - PrintProfileData(&range, profile_function); - } + if (IsReportRequested(kCallSites)) { + PrintCallSitesData(&range, func, code); + } + if (IsReportRequested(kCoverage)) { + PrintCoverageData(&range, func, code, /* report_branch_coverage */ false); + } + if (IsReportRequested(kBranchCoverage)) { + PrintCoverageData(&range, func, code, /* report_branch_coverage */ true); + } + if (IsReportRequested(kPossibleBreakpoints)) { + PrintPossibleBreakpointsData(&range, func, code); + } + if (IsReportRequested(kProfile)) { + ProfileFunction* profile_function = profile_.FindFunction(func); + if ((profile_function != NULL) && + (profile_function->NumSourcePositions() > 0)) { + PrintProfileData(&range, profile_function); } } } diff --git a/runtime/vm/stack_trace.cc b/runtime/vm/stack_trace.cc index 21ab60e4d3d..8e43ef412e2 100644 --- a/runtime/vm/stack_trace.cc +++ b/runtime/vm/stack_trace.cc @@ -24,34 +24,6 @@ const intptr_t k_FutureListener_stateWhenComplete = 8; // Keep in sync with sdk/lib/async/future_impl.dart:_FutureListener.handleValue. const intptr_t kNumArgsFutureListenerHandleValue = 1; -// Find current yield index from async closure. -// Async closures contains a variable, :await_jump_var that holds the index into -// async wrapper. -intptr_t GetYieldIndex(const Closure& receiver_closure) { - const auto& function = Function::Handle(receiver_closure.function()); - if (!function.IsAsyncClosure() && !function.IsAsyncGenClosure()) { - return UntaggedPcDescriptors::kInvalidYieldIndex; - } - const auto& await_jump_var = - Object::Handle(Context::Handle(receiver_closure.context()) - .At(Context::kAwaitJumpVarIndex)); - ASSERT(await_jump_var.IsSmi()); - return Smi::Cast(await_jump_var).Value(); -} - -intptr_t FindPcOffset(const PcDescriptors& pc_descs, intptr_t yield_index) { - if (yield_index == UntaggedPcDescriptors::kInvalidYieldIndex) { - return 0; - } - PcDescriptors::Iterator iter(pc_descs, UntaggedPcDescriptors::kAnyKind); - while (iter.MoveNext()) { - if (iter.YieldIndex() == yield_index) { - return iter.PcOffset(); - } - } - UNREACHABLE(); // If we cannot find it we have a bug. -} - // Instance caches library and field references. // This way we don't have to do the look-ups for every frame in the stack. CallerClosureFinder::CallerClosureFinder(Zone* zone) @@ -245,12 +217,6 @@ ClosurePtr CallerClosureFinder::FindCallerInAsyncStarStreamController( ClosurePtr CallerClosureFinder::GetCallerInFutureListener( const Object& future_listener) { - closure_ = GetCallerInFutureListenerInternal(future_listener); - return UnwrapAsyncThen(closure_); -} - -ClosurePtr CallerClosureFinder::GetCallerInFutureListenerInternal( - const Object& future_listener) { auto value = GetFutureListenerState(future_listener); // If the _FutureListener is a `then`, `catchError`, or `whenComplete` @@ -267,11 +233,6 @@ ClosurePtr CallerClosureFinder::GetCallerInFutureListenerInternal( return GetFutureListenerCallback(future_listener); } -ClosurePtr CallerClosureFinder::FindCaller(const Closure& receiver_closure) { - closure_ = FindCallerInternal(receiver_closure); - return UnwrapAsyncThen(closure_); -} - ClosurePtr CallerClosureFinder::FindCallerFromSuspendState( const SuspendState& suspend_state) { context_entry_ = suspend_state.function_data(); @@ -285,20 +246,6 @@ ClosurePtr CallerClosureFinder::FindCallerFromSuspendState( } } -ClosurePtr CallerClosureFinder::UnwrapAsyncThen(const Closure& closure) { - if (closure.IsNull()) return closure.ptr(); - - receiver_function_ = closure.function(); - receiver_function_ = receiver_function_.parent_function(); - if (receiver_function_.recognized_kind() == - MethodRecognizer::kAsyncThenWrapperHelper) { - receiver_context_ = closure.context(); - RELEASE_ASSERT(receiver_context_.num_variables() == 1); - return Closure::RawCast(receiver_context_.At(0)); - } - return closure.ptr(); -} - bool CallerClosureFinder::IsCompactAsyncCallback(const Function& function) { parent_function_ = function.parent_function(); auto kind = parent_function_.recognized_kind(); @@ -315,8 +262,7 @@ SuspendStatePtr CallerClosureFinder::GetSuspendStateFromAsyncCallback( return SuspendState::RawCast(receiver_context_.At(0)); } -ClosurePtr CallerClosureFinder::FindCallerInternal( - const Closure& receiver_closure) { +ClosurePtr CallerClosureFinder::FindCaller(const Closure& receiver_closure) { receiver_function_ = receiver_closure.function(); receiver_context_ = receiver_closure.context(); @@ -325,15 +271,6 @@ ClosurePtr CallerClosureFinder::FindCallerInternal( return FindCallerFromSuspendState(suspend_state_); } - if (receiver_function_.IsAsyncGenClosure()) { - return FindCallerInAsyncGenClosure(receiver_context_); - } - - if (receiver_function_.IsAsyncClosure()) { - future_ = receiver_context_.At(Context::kAsyncFutureIndex); - return GetCallerInFutureImpl(future_); - } - if (receiver_function_.HasParent()) { parent_function_ = receiver_function_.parent_function(); if (parent_function_.recognized_kind() == @@ -419,73 +356,25 @@ bool CallerClosureFinder::HasCatchError(const Object& future_listener) { return false; } -bool CallerClosureFinder::IsRunningAsync(const Closure& receiver_closure) { - auto zone = Thread::Current()->zone(); - - // The async* functions are never started synchronously, they start running - // after the first `listen()` call to its returned `Stream`. - const Function& receiver_function_ = - Function::Handle(zone, receiver_closure.function()); - if (receiver_function_.IsAsyncGenClosure()) { - return true; - } - ASSERT(receiver_function_.IsAsyncClosure()); - - const Context& receiver_context_ = - Context::Handle(zone, receiver_closure.context()); - const Object& is_sync = - Object::Handle(zone, receiver_context_.At(Context::kIsSyncIndex)); - ASSERT(!is_sync.IsNull()); - ASSERT(is_sync.IsBool()); - // isSync indicates whether the future should be completed async. or sync., - // based on whether it has yielded yet. - // isSync is true when the :async_op has yielded at least once. - // I.e. isSync will be false even after :async_op has run, if e.g. it threw - // an exception before yielding. - return Bool::Cast(is_sync).value(); -} - bool CallerClosureFinder::WasPreviouslySuspended( const Function& function, const Object& suspend_state_var) { if (!suspend_state_var.IsSuspendState()) { return false; } - if (function.IsCompactAsyncFunction()) { + if (function.IsAsyncFunction()) { // Error callback is set after both 'then' and 'error' callbacks are // registered with the Zone. Callback registration may query // stack trace and should still collect the synchronous stack trace. return SuspendState::Cast(suspend_state_var).error_callback() != Object::null(); - } else if (function.IsCompactAsyncStarFunction()) { + } else if (function.IsAsyncGenerator()) { return true; } else { UNREACHABLE(); } } -ClosurePtr StackTraceUtils::FindClosureInFrame(ObjectPtr* last_object_in_caller, - const Function& function) { - NoSafepointScope nsp; - - ASSERT(!function.IsNull()); - ASSERT(function.IsAsyncClosure() || function.IsAsyncGenClosure()); - - // The callee has function signature - // :async_op(result_or_exception, stack) - // so the "this" closure is the 3rd argument. - ObjectPtr arg = last_object_in_caller[2]; - if (arg->IsHeapObject() && arg->GetClassId() == kClosureCid) { - auto& closure = Closure::Handle(); - closure = Closure::RawCast(arg); - if (closure.function() == function.ptr()) { - return closure.ptr(); - } - } - ASSERT(arg == Symbols::OptimizedOut().ptr()); - return Closure::null(); -} - ClosurePtr StackTraceUtils::ClosureFromFrameFunction( Zone* zone, CallerClosureFinder* caller_closure_finder, @@ -493,7 +382,6 @@ ClosurePtr StackTraceUtils::ClosureFromFrameFunction( StackFrame* frame, bool* skip_frame, bool* is_async) { - auto& closure = Closure::Handle(zone); auto& function = Function::Handle(zone); function = frame->LookupDartFunction(); @@ -501,8 +389,7 @@ ClosurePtr StackTraceUtils::ClosureFromFrameFunction( return Closure::null(); } - if (function.IsCompactAsyncFunction() || - function.IsCompactAsyncStarFunction()) { + if (function.IsAsyncFunction() || function.IsAsyncGenerator()) { auto& suspend_state = Object::Handle( zone, *reinterpret_cast(LocalVarAddress( frame->fp(), runtime_frame_layout.FrameSlotForVariableIndex( @@ -518,26 +405,6 @@ ClosurePtr StackTraceUtils::ClosureFromFrameFunction( return Closure::null(); } - if (function.IsAsyncClosure() || function.IsAsyncGenClosure()) { - // Next, look up caller's closure on the stack and walk backwards - // through the yields. - ObjectPtr* last_caller_obj = - reinterpret_cast(frame->GetCallerSp()); - closure = FindClosureInFrame(last_caller_obj, function); - if (closure.IsNull()) return Closure::null(); - - // If this async function hasn't yielded yet, we're still dealing with a - // normal stack. Continue to next frame as usual. - if (!caller_closure_finder->IsRunningAsync(closure)) { - return Closure::null(); - } - - *is_async = true; - - // Skip: Already handled this as a sync. frame. - return caller_closure_finder->FindCaller(closure); - } - // May have been called from `_FutureListener.handleValue`, which means its // receiver holds the Future chain. DartFrameIterator future_frames(frames); @@ -614,11 +481,8 @@ void StackTraceUtils::UnwindAwaiterChain( RELEASE_ASSERT(!code.IsNull()); code_array.Add(code); pc_descs = code.pc_descriptors(); - const intptr_t pc_offset = FindPcOffset(pc_descs, GetYieldIndex(closure)); - // Unlike other sources of PC offsets, the offset may be 0 here if we - // reach a non-async closure receiving the yielded value. - ASSERT(pc_offset >= 0); - pc_offset_array->Add(pc_offset); + // We reached a non-async closure receiving the yielded value. + pc_offset_array->Add(0); } // Inject async suspension marker. diff --git a/runtime/vm/stack_trace.h b/runtime/vm/stack_trace.h index cfd558c03c8..44e05c8d9fb 100644 --- a/runtime/vm/stack_trace.h +++ b/runtime/vm/stack_trace.h @@ -70,18 +70,12 @@ class CallerClosureFinder { bool HasCatchError(const Object& future_listener); - static bool IsRunningAsync(const Closure& receiver_closure); - // Tests if given [function] with given value of :suspend_state variable // was suspended at least once and running asynchronously. static bool WasPreviouslySuspended(const Function& function, const Object& suspend_state_var); private: - ClosurePtr FindCallerInternal(const Closure& receiver_closure); - ClosurePtr GetCallerInFutureListenerInternal(const Object& future_listener); - ClosurePtr UnwrapAsyncThen(const Closure& closure); - Closure& closure_; Context& receiver_context_; Function& receiver_function_; @@ -122,10 +116,6 @@ class CallerClosureFinder { class StackTraceUtils : public AllStatic { public: - // Find the async_op closure from the stack frame. - static ClosurePtr FindClosureInFrame(ObjectPtr* last_object_in_caller, - const Function& function); - static ClosurePtr ClosureFromFrameFunction( Zone* zone, CallerClosureFinder* caller_closure_finder, diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h index 082c168b26c..ef48ca1d21e 100644 --- a/runtime/vm/symbols.h +++ b/runtime/vm/symbols.h @@ -26,11 +26,7 @@ class ObjectPointerVisitor; V(ArgumentError, "ArgumentError") \ V(AssertionError, "_AssertionError") \ V(AssignIndexToken, "[]=") \ - V(AsyncFuture, ":async_future") \ - V(AsyncOperation, ":async_op") \ V(AsyncStarMoveNextHelper, "_asyncStarMoveNextHelper") \ - V(AwaitContextVar, ":await_ctx_var") \ - V(AwaitJumpVar, ":await_jump_var") \ V(Bool, "bool") \ V(BooleanExpression, "boolean expression") \ V(BoundsCheckForPartialInstantiation, "_boundsCheckForPartialInstantiation") \ @@ -52,8 +48,6 @@ class ObjectPointerVisitor; V(CompressedStackMaps, "CompressedStackMaps") \ V(Context, "Context") \ V(ContextScope, "ContextScope") \ - V(Controller, ":controller") \ - V(ControllerStream, ":controller_stream") \ V(Current, "current") \ V(CurrentContextVar, ":current_context_var") \ V(CyclicInitializationError, "CyclicInitializationError") \ @@ -291,10 +285,7 @@ class ObjectPointerVisitor; V(_ClosureCall, "_Closure.call") \ V(_CombinatorMirror, "_CombinatorMirror") \ V(_CompileTimeError, "_CompileTimeError") \ - V(_CompleteOnAsyncReturn, "_completeOnAsyncReturn") \ - V(_CompleteWithNoFutureOnAsyncReturn, "_completeWithNoFutureOnAsyncReturn") \ V(_ControllerSubscription, "_ControllerSubscription") \ - V(_CompleteOnAsyncError, "_completeOnAsyncError") \ V(_DeletedEnumPrefix, "Deleted enum value from ") \ V(_DeletedEnumSentinel, "_deleted_enum_sentinel") \ V(_Double, "_Double") \ @@ -383,7 +374,6 @@ class ObjectPointerVisitor; V(_StreamIterator, "_StreamIterator") \ V(_String, "String") \ V(_SuspendState, "_SuspendState") \ - V(_SyncIterator, "_SyncIterator") \ V(_SyncStarIterator, "_SyncStarIterator") \ V(_SyncStreamController, "_SyncStreamController") \ V(_TransferableTypedDataImpl, "_TransferableTypedDataImpl") \ @@ -476,7 +466,6 @@ class ObjectPointerVisitor; V(dynamic_assert_assignable_stc_check, \ ":dynamic_assert_assignable_stc_check") \ V(index_temp, ":index_temp") \ - V(is_sync, ":is_sync") \ V(isPaused, "isPaused") \ V(match_end_index, ":match_end_index") \ V(match_start_index, ":match_start_index") \ diff --git a/sdk/lib/_internal/vm/lib/async_patch.dart b/sdk/lib/_internal/vm/lib/async_patch.dart index 976860f953e..0b532b0133e 100644 --- a/sdk/lib/_internal/vm/lib/async_patch.dart +++ b/sdk/lib/_internal/vm/lib/async_patch.dart @@ -18,78 +18,6 @@ import "dart:_internal" show VMLibraryHooks, patch, unsafeCast; @pragma("vm:external-name", "DartAsync_fatal") external _fatal(msg); -// We need to pass the value as first argument and leave the second and third -// arguments empty (used for error handling). -@pragma("vm:recognized", "other") -dynamic Function(dynamic) _asyncThenWrapperHelper( - dynamic Function(dynamic, dynamic) continuation) { - @pragma("vm:invisible") - dynamic thenWrapper(dynamic arg) => continuation(arg, /*stack_trace=*/ null); - - // Any function that is used as an asynchronous callback must be registered - // in the current Zone. Normally, this is done by the future when a - // callback is registered (for example with `.then` or `.catchError`). In our - // case we want to reuse the same callback multiple times and therefore avoid - // the multiple registrations. For our internal futures (`_Future`) we can - // use the shortcut-version of `.then`, and skip the registration. However, - // that means that the continuation must be registered by us. - // - // Furthermore, we know that the root-zone doesn't actually do anything and - // we can therefore skip the registration call for it. - // - // Note, that the continuation accepts up to three arguments. If the current - // zone is the root zone, we don't wrap the continuation, and a bad - // `Future` implementation could potentially invoke the callback with the - // wrong number of arguments. - final currentZone = Zone._current; - if (identical(currentZone, _rootZone) || - identical(currentZone._registerUnaryCallback, - _rootZone._registerUnaryCallback)) { - return thenWrapper; - } - return currentZone.registerUnaryCallback(thenWrapper); -} - -// We need to pass the exception and stack trace objects as second and third -// parameter to the continuation. -dynamic Function(Object, StackTrace) _asyncErrorWrapperHelper( - dynamic Function(dynamic, StackTrace) errorCallback) { - final currentZone = Zone._current; - if (identical(currentZone, _rootZone) || - identical(currentZone._registerBinaryCallback, - _rootZone._registerBinaryCallback)) { - return errorCallback; - } - return currentZone - .registerBinaryCallback(errorCallback); -} - -/// Registers the [thenCallback] and [errorCallback] on the given [object]. -/// -/// If [object] is not a future, then it is wrapped into one. -/// -/// Returns the result of registering with `.then`. -Future _awaitHelper(var object, dynamic Function(dynamic) thenCallback, - dynamic Function(Object, StackTrace) errorCallback) { - _Future future; - if (object is _Future) { - future = object; - } else if (object is! Future) { - future = new _Future().._setValue(object); - } else { - return object.then(thenCallback, onError: errorCallback); - } - // `object` is a `_Future`. - // - // Since the callbacks have been registered in the current zone (see - // [_asyncThenWrapperHelper] and [_asyncErrorWrapperHelper]), we can avoid - // another registration and directly invoke the no-zone-registration `.then`. - // - // We can only do this for our internal futures (the default implementation of - // all futures that are constructed by the `dart:async` library). - return future._thenAwait(thenCallback, errorCallback); -} - @pragma("vm:entry-point", "call") void _asyncStarMoveNextHelper(var stream) { if (stream is! _StreamImpl) { @@ -284,41 +212,6 @@ class _StreamImpl { Function? _generator; } -@pragma("vm:entry-point", "call") -void _completeOnAsyncReturn(_Future _future, Object? value, bool is_sync) { - // The first awaited expression is invoked sync. so complete is async. to - // allow then and error handlers to be attached. - // async_jump_var=0 is prior to first await, =1 is first await. - if (!is_sync || value is Future) { - _future._asyncCompleteUnchecked(value); - } else { - _future._completeWithValue(value); - } -} - -@pragma("vm:entry-point", "call") -void _completeWithNoFutureOnAsyncReturn( - _Future _future, Object? value, bool is_sync) { - // The first awaited expression is invoked sync. so complete is async. to - // allow then and error handlers to be attached. - // async_jump_var=0 is prior to first await, =1 is first await. - if (!is_sync) { - _future._asyncCompleteUncheckedNoFuture(value); - } else { - _future._completeWithValue(value); - } -} - -@pragma("vm:entry-point", "call") -void _completeOnAsyncError( - _Future _future, Object e, StackTrace st, bool is_sync) { - if (!is_sync) { - _future._asyncCompleteError(e, st); - } else { - _future._completeError(e, st); - } -} - @pragma("vm:external-name", "AsyncStarMoveNext_debuggerStepCheck") external void _moveNextDebuggerStepCheck(Function async_op); @@ -558,7 +451,11 @@ class _SuspendState { } if (functionData is _Future) { // async function. - _completeOnAsyncError(functionData, exception, stackTrace, isSync); + if (!isSync) { + functionData._asyncCompleteError(exception, stackTrace); + } else { + functionData._completeError(exception, stackTrace); + } } else if (functionData is _AsyncStarStreamController) { // async* function. functionData.addError(exception, stackTrace); diff --git a/sdk/lib/_internal/vm/lib/core_patch.dart b/sdk/lib/_internal/vm/lib/core_patch.dart index 79ff4aa14d4..c7ad0af0387 100644 --- a/sdk/lib/_internal/vm/lib/core_patch.dart +++ b/sdk/lib/_internal/vm/lib/core_patch.dart @@ -104,134 +104,6 @@ class num { bool _equalToInteger(int other); } -// _SyncIterable and _syncIterator are used by the compiler to -// implement sync* generator functions. A sync* generator allocates -// and returns a new _SyncIterable object. - -typedef _SyncGeneratorCallback = bool Function( - _SyncIterator, Object?, StackTrace?); -typedef _SyncGeneratorCallbackCallback = _SyncGeneratorCallback - Function(); - -class _SyncIterable extends IterableBase { - // Closure that effectively "clones" the inner _moveNextFn. - // This means a _SyncIterable creates _SyncIterators that do not share state. - final _SyncGeneratorCallbackCallback _moveNextFnMaker; - - const _SyncIterable(this._moveNextFnMaker); - - Iterator get iterator { - return _SyncIterator(_moveNextFnMaker()); - } -} - -class _SyncIterator implements Iterator { - _SyncGeneratorCallback? _moveNextFn; - Iterator? _yieldEachIterator; - - // Stack of suspended _moveNextFn (sync_op). - List<_SyncGeneratorCallback>? _stack; - - // These two fields are set by generated code for the yield and yield* - // statement. - T? _current; - Iterable? _yieldEachIterable; - - @override - T get current => _current as T; - - _SyncIterator(this._moveNextFn); - - @pragma('vm:prefer-inline') - bool _handleMoveNextFnCompletion() { - _moveNextFn = null; - _current = null; - final stack = _stack; - if (stack != null && stack.isNotEmpty) { - _moveNextFn = stack.removeLast(); - return true; - } - return false; - } - - @override - bool moveNext() { - if (_moveNextFn == null) { - return false; - } - - Object? pendingException; - StackTrace? pendingStackTrace; - while (true) { - // If the active iterator isn't a nested _SyncIterator, we have to - // delegate downwards from the immediate iterator. - final iterator = _yieldEachIterator; - if (iterator != null) { - try { - if (iterator.moveNext()) { - _current = iterator.current; - return true; - } - } catch (e, st) { - pendingException = e; - pendingStackTrace = st; - } - _yieldEachIterator = null; - } - - // Start by calling _moveNextFn (sync_op) to move to the next value (or - // nested iterator). - try { - final haveMore = - _moveNextFn!.call(this, pendingException, pendingStackTrace); - // Exception was handled. - pendingException = null; - pendingStackTrace = null; - if (!haveMore) { - if (_handleMoveNextFnCompletion()) { - continue; - } - return false; - } - } catch (e, st) { - pendingException = e; - pendingStackTrace = st; - if (_handleMoveNextFnCompletion()) { - continue; - } - rethrow; - } - - // Case: yield* some_iterator. - final iterable = _yieldEachIterable; - if (iterable != null) { - if (iterable is _SyncIterable) { - // We got a recursive yield* of sync* function. Instead of creating - // a new iterator we replace our _moveNextFn (remembering the - // current _moveNextFn for later resumption). - if (_stack == null) { - _stack = []; - } - _stack!.add(_moveNextFn!); - final typedIterable = unsafeCast<_SyncIterable>(iterable); - - _moveNextFn = typedIterable._moveNextFnMaker(); - } else { - _yieldEachIterator = iterable.iterator; - } - _yieldEachIterable = null; - _current = null; - - // Fetch the next item. - continue; - } - - // We've successfully found the next `current` value. - return true; - } - } -} - @patch class StackTrace { @patch