OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/parser.h" | 5 #include "vm/parser.h" |
6 #include "vm/flags.h" | 6 #include "vm/flags.h" |
7 | 7 |
8 #ifndef DART_PRECOMPILED_RUNTIME | 8 #ifndef DART_PRECOMPILED_RUNTIME |
9 | 9 |
10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
(...skipping 3537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3548 func.set_modifier(func_modifier); | 3548 func.set_modifier(func_modifier); |
3549 } | 3549 } |
3550 | 3550 |
3551 OpenBlock(); // Open a nested scope for the outermost function block. | 3551 OpenBlock(); // Open a nested scope for the outermost function block. |
3552 | 3552 |
3553 Function& generated_body_closure = Function::ZoneHandle(Z); | 3553 Function& generated_body_closure = Function::ZoneHandle(Z); |
3554 if (func.IsAsyncFunction()) { | 3554 if (func.IsAsyncFunction()) { |
3555 ASSERT(!func.is_generated_body()); | 3555 ASSERT(!func.is_generated_body()); |
3556 // The code of an async function is synthesized. Disable debugging. | 3556 // The code of an async function is synthesized. Disable debugging. |
3557 func.set_is_debuggable(false); | 3557 func.set_is_debuggable(false); |
| 3558 // In order to collect causal asynchronous stacks efficiently we rely on |
| 3559 // this function not being inlined. |
| 3560 func.set_is_inlinable(!FLAG_causal_async_stacks); |
3558 generated_body_closure = OpenAsyncFunction(func.token_pos()); | 3561 generated_body_closure = OpenAsyncFunction(func.token_pos()); |
3559 } else if (func.IsAsyncClosure()) { | 3562 } else if (func.IsAsyncClosure()) { |
3560 // The closure containing the body of an async function is debuggable. | 3563 // The closure containing the body of an async function is debuggable. |
3561 ASSERT(func.is_debuggable()); | 3564 ASSERT(func.is_debuggable()); |
| 3565 // In order to collect causal asynchronous stacks efficiently we rely on |
| 3566 // this function not being inlined. |
| 3567 func.set_is_inlinable(!FLAG_causal_async_stacks); |
3562 OpenAsyncClosure(); | 3568 OpenAsyncClosure(); |
3563 } else if (func.IsSyncGenerator()) { | 3569 } else if (func.IsSyncGenerator()) { |
3564 // The code of a sync generator is synthesized. Disable debugging. | 3570 // The code of a sync generator is synthesized. Disable debugging. |
3565 func.set_is_debuggable(false); | 3571 func.set_is_debuggable(false); |
3566 generated_body_closure = OpenSyncGeneratorFunction(func.token_pos()); | 3572 generated_body_closure = OpenSyncGeneratorFunction(func.token_pos()); |
3567 } else if (func.IsSyncGenClosure()) { | 3573 } else if (func.IsSyncGenClosure()) { |
3568 // The closure containing the body of a sync generator is debuggable. | 3574 // The closure containing the body of a sync generator is debuggable. |
3569 ASSERT(func.is_debuggable()); | 3575 ASSERT(func.is_debuggable()); |
3570 async_temp_scope_ = current_block_->scope; | 3576 async_temp_scope_ = current_block_->scope; |
3571 } else if (func.IsAsyncGenerator()) { | 3577 } else if (func.IsAsyncGenerator()) { |
3572 func.set_is_debuggable(false); | 3578 func.set_is_debuggable(false); |
| 3579 // In order to collect causal asynchronous stacks efficiently we rely on |
| 3580 // this function not being inlined. |
| 3581 func.set_is_inlinable(!FLAG_causal_async_stacks); |
3573 generated_body_closure = OpenAsyncGeneratorFunction(func.token_pos()); | 3582 generated_body_closure = OpenAsyncGeneratorFunction(func.token_pos()); |
3574 } else if (func.IsAsyncGenClosure()) { | 3583 } else if (func.IsAsyncGenClosure()) { |
3575 // The closure containing the body of an async* function is debuggable. | 3584 // The closure containing the body of an async* function is debuggable. |
3576 ASSERT(func.is_debuggable()); | 3585 ASSERT(func.is_debuggable()); |
| 3586 // In order to collect causal asynchronous stacks efficiently we rely on |
| 3587 // this function not being inlined. |
| 3588 func.set_is_inlinable(!FLAG_causal_async_stacks); |
3577 OpenAsyncGeneratorClosure(); | 3589 OpenAsyncGeneratorClosure(); |
3578 } | 3590 } |
3579 | 3591 |
3580 BoolScope allow_await(&this->await_is_keyword_, | 3592 BoolScope allow_await(&this->await_is_keyword_, |
3581 func.IsAsyncOrGenerator() || func.is_generated_body()); | 3593 func.IsAsyncOrGenerator() || func.is_generated_body()); |
3582 TokenPosition end_token_pos = TokenPosition::kNoSource; | 3594 TokenPosition end_token_pos = TokenPosition::kNoSource; |
3583 if (CurrentToken() == Token::kLBRACE) { | 3595 if (CurrentToken() == Token::kLBRACE) { |
3584 ConsumeToken(); | 3596 ConsumeToken(); |
3585 if (String::Handle(Z, func.name()).Equals(Symbols::EqualOperator())) { | 3597 if (String::Handle(Z, func.name()).Equals(Symbols::EqualOperator())) { |
3586 const Class& owner = Class::Handle(Z, func.Owner()); | 3598 const Class& owner = Class::Handle(Z, func.Owner()); |
(...skipping 3431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7018 current_block_->scope->AddVariable(await_ctx_var); | 7030 current_block_->scope->AddVariable(await_ctx_var); |
7019 } | 7031 } |
7020 | 7032 |
7021 | 7033 |
7022 void Parser::AddAsyncClosureVariables() { | 7034 void Parser::AddAsyncClosureVariables() { |
7023 // Add to current block's scope: | 7035 // Add to current block's scope: |
7024 // var :async_op; | 7036 // var :async_op; |
7025 // var :async_then_callback; | 7037 // var :async_then_callback; |
7026 // var :async_catch_error_callback; | 7038 // var :async_catch_error_callback; |
7027 // var :async_completer; | 7039 // var :async_completer; |
| 7040 // var :async_stack_trace; |
7028 LocalVariable* async_op_var = | 7041 LocalVariable* async_op_var = |
7029 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7042 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7030 Symbols::AsyncOperation(), Object::dynamic_type()); | 7043 Symbols::AsyncOperation(), Object::dynamic_type()); |
7031 current_block_->scope->AddVariable(async_op_var); | 7044 current_block_->scope->AddVariable(async_op_var); |
7032 LocalVariable* async_then_callback_var = new (Z) | 7045 LocalVariable* async_then_callback_var = new (Z) |
7033 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7046 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7034 Symbols::AsyncThenCallback(), Object::dynamic_type()); | 7047 Symbols::AsyncThenCallback(), Object::dynamic_type()); |
7035 current_block_->scope->AddVariable(async_then_callback_var); | 7048 current_block_->scope->AddVariable(async_then_callback_var); |
7036 LocalVariable* async_catch_error_callback_var = new (Z) | 7049 LocalVariable* async_catch_error_callback_var = new (Z) |
7037 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7050 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7038 Symbols::AsyncCatchErrorCallback(), Object::dynamic_type()); | 7051 Symbols::AsyncCatchErrorCallback(), Object::dynamic_type()); |
7039 current_block_->scope->AddVariable(async_catch_error_callback_var); | 7052 current_block_->scope->AddVariable(async_catch_error_callback_var); |
7040 LocalVariable* async_completer = | 7053 LocalVariable* async_completer = |
7041 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7054 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7042 Symbols::AsyncCompleter(), Object::dynamic_type()); | 7055 Symbols::AsyncCompleter(), Object::dynamic_type()); |
7043 current_block_->scope->AddVariable(async_completer); | 7056 current_block_->scope->AddVariable(async_completer); |
| 7057 LocalVariable* async_stack_trace = new (Z) |
| 7058 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
| 7059 Symbols::AsyncStackTraceVar(), Object::dynamic_type()); |
| 7060 current_block_->scope->AddVariable(async_stack_trace); |
7044 } | 7061 } |
7045 | 7062 |
7046 | 7063 |
7047 void Parser::AddAsyncGeneratorVariables() { | 7064 void Parser::AddAsyncGeneratorVariables() { |
7048 // Add to current block's scope: | 7065 // Add to current block's scope: |
7049 // var :controller; | 7066 // var :controller; |
7050 // The :controller variable is used by the async generator closure to | 7067 // The :controller variable is used by the async generator closure to |
7051 // store the StreamController object to which the yielded expressions | 7068 // store the StreamController object to which the yielded expressions |
7052 // are added. | 7069 // are added. |
7053 // var :async_op; | 7070 // var :async_op; |
7054 // var :async_then_callback; | 7071 // var :async_then_callback; |
7055 // var :async_catch_error_callback; | 7072 // var :async_catch_error_callback; |
| 7073 // var :async_stack_trace; |
7056 // These variables are used to store the async generator closure containing | 7074 // These variables are used to store the async generator closure containing |
7057 // the body of the async* function. They are used by the await operator. | 7075 // the body of the async* function. They are used by the await operator. |
7058 LocalVariable* controller_var = | 7076 LocalVariable* controller_var = |
7059 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7077 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7060 Symbols::Controller(), Object::dynamic_type()); | 7078 Symbols::Controller(), Object::dynamic_type()); |
7061 current_block_->scope->AddVariable(controller_var); | 7079 current_block_->scope->AddVariable(controller_var); |
7062 LocalVariable* async_op_var = | 7080 LocalVariable* async_op_var = |
7063 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7081 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7064 Symbols::AsyncOperation(), Object::dynamic_type()); | 7082 Symbols::AsyncOperation(), Object::dynamic_type()); |
7065 current_block_->scope->AddVariable(async_op_var); | 7083 current_block_->scope->AddVariable(async_op_var); |
7066 LocalVariable* async_then_callback_var = new (Z) | 7084 LocalVariable* async_then_callback_var = new (Z) |
7067 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7085 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7068 Symbols::AsyncThenCallback(), Object::dynamic_type()); | 7086 Symbols::AsyncThenCallback(), Object::dynamic_type()); |
7069 current_block_->scope->AddVariable(async_then_callback_var); | 7087 current_block_->scope->AddVariable(async_then_callback_var); |
7070 LocalVariable* async_catch_error_callback_var = new (Z) | 7088 LocalVariable* async_catch_error_callback_var = new (Z) |
7071 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7089 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7072 Symbols::AsyncCatchErrorCallback(), Object::dynamic_type()); | 7090 Symbols::AsyncCatchErrorCallback(), Object::dynamic_type()); |
7073 current_block_->scope->AddVariable(async_catch_error_callback_var); | 7091 current_block_->scope->AddVariable(async_catch_error_callback_var); |
| 7092 LocalVariable* async_stack_trace = new (Z) |
| 7093 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
| 7094 Symbols::AsyncStackTraceVar(), Object::dynamic_type()); |
| 7095 current_block_->scope->AddVariable(async_stack_trace); |
7074 } | 7096 } |
7075 | 7097 |
7076 | 7098 |
7077 RawFunction* Parser::OpenAsyncGeneratorFunction(TokenPosition async_func_pos) { | 7099 RawFunction* Parser::OpenAsyncGeneratorFunction(TokenPosition async_func_pos) { |
7078 TRACE_PARSER("OpenAsyncGeneratorFunction"); | 7100 TRACE_PARSER("OpenAsyncGeneratorFunction"); |
7079 AddContinuationVariables(); | 7101 AddContinuationVariables(); |
7080 AddAsyncGeneratorVariables(); | 7102 AddAsyncGeneratorVariables(); |
7081 | 7103 |
7082 Function& closure = Function::Handle(Z); | 7104 Function& closure = Function::Handle(Z); |
7083 bool is_new_closure = false; | 7105 bool is_new_closure = false; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7162 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7184 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7163 existing_var = | 7185 existing_var = |
7164 closure_body->scope()->LookupVariable(Symbols::AsyncOperation(), false); | 7186 closure_body->scope()->LookupVariable(Symbols::AsyncOperation(), false); |
7165 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7187 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7166 existing_var = closure_body->scope()->LookupVariable( | 7188 existing_var = closure_body->scope()->LookupVariable( |
7167 Symbols::AsyncThenCallback(), false); | 7189 Symbols::AsyncThenCallback(), false); |
7168 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7190 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7169 existing_var = closure_body->scope()->LookupVariable( | 7191 existing_var = closure_body->scope()->LookupVariable( |
7170 Symbols::AsyncCatchErrorCallback(), false); | 7192 Symbols::AsyncCatchErrorCallback(), false); |
7171 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7193 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 7194 existing_var = closure_body->scope()->LookupVariable( |
| 7195 Symbols::AsyncStackTraceVar(), false); |
| 7196 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7172 | 7197 |
7173 const Library& async_lib = Library::Handle(Library::AsyncLibrary()); | 7198 const Library& async_lib = Library::Handle(Library::AsyncLibrary()); |
7174 | 7199 |
7175 const Class& controller_class = Class::Handle( | 7200 const Class& controller_class = Class::Handle( |
7176 Z, | 7201 Z, |
7177 async_lib.LookupClassAllowPrivate(Symbols::_AsyncStarStreamController())); | 7202 async_lib.LookupClassAllowPrivate(Symbols::_AsyncStarStreamController())); |
7178 ASSERT(!controller_class.IsNull()); | 7203 ASSERT(!controller_class.IsNull()); |
7179 const Function& controller_constructor = Function::ZoneHandle( | 7204 const Function& controller_constructor = Function::ZoneHandle( |
7180 Z, controller_class.LookupConstructorAllowPrivate( | 7205 Z, controller_class.LookupConstructorAllowPrivate( |
7181 Symbols::_AsyncStarStreamControllerConstructor())); | 7206 Symbols::_AsyncStarStreamControllerConstructor())); |
7182 | 7207 |
7183 // :await_jump_var = -1; | 7208 // :await_jump_var = -1; |
7184 LocalVariable* jump_var = | 7209 LocalVariable* jump_var = |
7185 current_block_->scope->LookupVariable(Symbols::AwaitJumpVar(), false); | 7210 current_block_->scope->LookupVariable(Symbols::AwaitJumpVar(), false); |
7186 LiteralNode* init_value = new (Z) | 7211 LiteralNode* init_value = new (Z) |
7187 LiteralNode(TokenPosition::kNoSource, Smi::ZoneHandle(Smi::New(-1))); | 7212 LiteralNode(TokenPosition::kNoSource, Smi::ZoneHandle(Smi::New(-1))); |
7188 current_block_->statements->Add( | 7213 current_block_->statements->Add( |
7189 new (Z) StoreLocalNode(TokenPosition::kNoSource, jump_var, init_value)); | 7214 new (Z) StoreLocalNode(TokenPosition::kNoSource, jump_var, init_value)); |
7190 | 7215 |
| 7216 TokenPosition token_pos = TokenPosition::kNoSource; |
| 7217 |
| 7218 if (FLAG_causal_async_stacks) { |
| 7219 // Add to AST: |
| 7220 // :async_stack_trace = _asyncStackTraceHelper(); |
| 7221 const Function& async_stack_trace_helper = Function::ZoneHandle( |
| 7222 Z, |
| 7223 async_lib.LookupFunctionAllowPrivate(Symbols::AsyncStackTraceHelper())); |
| 7224 ASSERT(!async_stack_trace_helper.IsNull()); |
| 7225 ArgumentListNode* async_stack_trace_helper_args = |
| 7226 new (Z) ArgumentListNode(TokenPosition::kNoSource); |
| 7227 StaticCallNode* async_stack_trace_helper_call = new (Z) StaticCallNode( |
| 7228 token_pos, async_stack_trace_helper, async_stack_trace_helper_args); |
| 7229 LocalVariable* async_stack_trace_var = |
| 7230 current_block_->scope->LookupVariable(Symbols::AsyncStackTraceVar(), |
| 7231 false); |
| 7232 StoreLocalNode* store_async_stack_trace = new (Z) StoreLocalNode( |
| 7233 token_pos, async_stack_trace_var, async_stack_trace_helper_call); |
| 7234 current_block_->statements->Add(store_async_stack_trace); |
| 7235 } |
| 7236 |
| 7237 |
7191 // Add to AST: | 7238 // Add to AST: |
7192 // :async_op = <closure>; (containing the original body) | 7239 // :async_op = <closure>; (containing the original body) |
7193 LocalVariable* async_op_var = | 7240 LocalVariable* async_op_var = |
7194 current_block_->scope->LookupVariable(Symbols::AsyncOperation(), false); | 7241 current_block_->scope->LookupVariable(Symbols::AsyncOperation(), false); |
7195 ClosureNode* closure_obj = new (Z) ClosureNode( | 7242 ClosureNode* closure_obj = new (Z) ClosureNode( |
7196 TokenPosition::kNoSource, closure_func, NULL, closure_body->scope()); | 7243 TokenPosition::kNoSource, closure_func, NULL, closure_body->scope()); |
7197 StoreLocalNode* store_async_op = new (Z) | 7244 StoreLocalNode* store_async_op = new (Z) |
7198 StoreLocalNode(TokenPosition::kNoSource, async_op_var, closure_obj); | 7245 StoreLocalNode(TokenPosition::kNoSource, async_op_var, closure_obj); |
7199 | 7246 |
7200 current_block_->statements->Add(store_async_op); | 7247 current_block_->statements->Add(store_async_op); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7324 // closure body in order to mark them as captured. | 7371 // closure body in order to mark them as captured. |
7325 LocalVariable* existing_var = | 7372 LocalVariable* existing_var = |
7326 closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); | 7373 closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); |
7327 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7374 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7328 existing_var = | 7375 existing_var = |
7329 closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false); | 7376 closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false); |
7330 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7377 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7331 existing_var = | 7378 existing_var = |
7332 closure_body->scope()->LookupVariable(Symbols::AsyncCompleter(), false); | 7379 closure_body->scope()->LookupVariable(Symbols::AsyncCompleter(), false); |
7333 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7380 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 7381 existing_var = closure_body->scope()->LookupVariable( |
| 7382 Symbols::AsyncStackTraceVar(), false); |
| 7383 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7334 | 7384 |
7335 // Create and return a new future that executes a closure with the current | 7385 // Create and return a new future that executes a closure with the current |
7336 // body. | 7386 // body. |
7337 | 7387 |
7338 // No need to capture parameters or other variables, since they have already | 7388 // No need to capture parameters or other variables, since they have already |
7339 // been captured in the corresponding scope as the body has been parsed within | 7389 // been captured in the corresponding scope as the body has been parsed within |
7340 // a nested block (contained in the async function's block). | 7390 // a nested block (contained in the async function's block). |
7341 const Class& future = Class::ZoneHandle(Z, I->object_store()->future_class()); | 7391 const Class& future = Class::ZoneHandle(Z, I->object_store()->future_class()); |
7342 ASSERT(!future.IsNull()); | 7392 ASSERT(!future.IsNull()); |
7343 const Function& constructor = Function::ZoneHandle( | 7393 const Function& constructor = Function::ZoneHandle( |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7376 // :async_op = <closure>; (containing the original body) | 7426 // :async_op = <closure>; (containing the original body) |
7377 LocalVariable* async_op_var = | 7427 LocalVariable* async_op_var = |
7378 current_block_->scope->LookupVariable(Symbols::AsyncOperation(), false); | 7428 current_block_->scope->LookupVariable(Symbols::AsyncOperation(), false); |
7379 ClosureNode* cn = | 7429 ClosureNode* cn = |
7380 new (Z) ClosureNode(token_pos, closure, NULL, closure_body->scope()); | 7430 new (Z) ClosureNode(token_pos, closure, NULL, closure_body->scope()); |
7381 StoreLocalNode* store_async_op = | 7431 StoreLocalNode* store_async_op = |
7382 new (Z) StoreLocalNode(token_pos, async_op_var, cn); | 7432 new (Z) StoreLocalNode(token_pos, async_op_var, cn); |
7383 current_block_->statements->Add(store_async_op); | 7433 current_block_->statements->Add(store_async_op); |
7384 | 7434 |
7385 const Library& async_lib = Library::Handle(Library::AsyncLibrary()); | 7435 const Library& async_lib = Library::Handle(Library::AsyncLibrary()); |
| 7436 |
| 7437 if (FLAG_causal_async_stacks) { |
| 7438 // Add to AST: |
| 7439 // :async_stack_trace = _asyncStackTraceHelper(); |
| 7440 const Function& async_stack_trace_helper = Function::ZoneHandle( |
| 7441 Z, |
| 7442 async_lib.LookupFunctionAllowPrivate(Symbols::AsyncStackTraceHelper())); |
| 7443 ASSERT(!async_stack_trace_helper.IsNull()); |
| 7444 ArgumentListNode* async_stack_trace_helper_args = |
| 7445 new (Z) ArgumentListNode(token_pos); |
| 7446 StaticCallNode* async_stack_trace_helper_call = new (Z) StaticCallNode( |
| 7447 token_pos, async_stack_trace_helper, async_stack_trace_helper_args); |
| 7448 LocalVariable* async_stack_trace_var = |
| 7449 current_block_->scope->LookupVariable(Symbols::AsyncStackTraceVar(), |
| 7450 false); |
| 7451 StoreLocalNode* store_async_stack_trace = new (Z) StoreLocalNode( |
| 7452 token_pos, async_stack_trace_var, async_stack_trace_helper_call); |
| 7453 current_block_->statements->Add(store_async_stack_trace); |
| 7454 } |
| 7455 |
7386 // :async_then_callback = _asyncThenWrapperHelper(:async_op) | 7456 // :async_then_callback = _asyncThenWrapperHelper(:async_op) |
7387 const Function& async_then_wrapper_helper = Function::ZoneHandle( | 7457 const Function& async_then_wrapper_helper = Function::ZoneHandle( |
7388 Z, | 7458 Z, |
7389 async_lib.LookupFunctionAllowPrivate(Symbols::AsyncThenWrapperHelper())); | 7459 async_lib.LookupFunctionAllowPrivate(Symbols::AsyncThenWrapperHelper())); |
7390 ASSERT(!async_then_wrapper_helper.IsNull()); | 7460 ASSERT(!async_then_wrapper_helper.IsNull()); |
7391 ArgumentListNode* async_then_wrapper_helper_args = | 7461 ArgumentListNode* async_then_wrapper_helper_args = |
7392 new (Z) ArgumentListNode(token_pos); | 7462 new (Z) ArgumentListNode(token_pos); |
7393 async_then_wrapper_helper_args->Add( | 7463 async_then_wrapper_helper_args->Add( |
7394 new (Z) LoadLocalNode(token_pos, async_op_var)); | 7464 new (Z) LoadLocalNode(token_pos, async_op_var)); |
7395 StaticCallNode* then_wrapper_call = new (Z) StaticCallNode( | 7465 StaticCallNode* then_wrapper_call = new (Z) StaticCallNode( |
(...skipping 7640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15036 const ArgumentListNode& function_args, | 15106 const ArgumentListNode& function_args, |
15037 const LocalVariable* temp_for_last_arg, | 15107 const LocalVariable* temp_for_last_arg, |
15038 bool is_super_invocation) { | 15108 bool is_super_invocation) { |
15039 UNREACHABLE(); | 15109 UNREACHABLE(); |
15040 return NULL; | 15110 return NULL; |
15041 } | 15111 } |
15042 | 15112 |
15043 } // namespace dart | 15113 } // namespace dart |
15044 | 15114 |
15045 #endif // DART_PRECOMPILED_RUNTIME | 15115 #endif // DART_PRECOMPILED_RUNTIME |
OLD | NEW |