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 3553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3564 func.set_modifier(func_modifier); | 3564 func.set_modifier(func_modifier); |
3565 } | 3565 } |
3566 | 3566 |
3567 OpenBlock(); // Open a nested scope for the outermost function block. | 3567 OpenBlock(); // Open a nested scope for the outermost function block. |
3568 | 3568 |
3569 Function& generated_body_closure = Function::ZoneHandle(Z); | 3569 Function& generated_body_closure = Function::ZoneHandle(Z); |
3570 if (func.IsAsyncFunction()) { | 3570 if (func.IsAsyncFunction()) { |
3571 ASSERT(!func.is_generated_body()); | 3571 ASSERT(!func.is_generated_body()); |
3572 // The code of an async function is synthesized. Disable debugging. | 3572 // The code of an async function is synthesized. Disable debugging. |
3573 func.set_is_debuggable(false); | 3573 func.set_is_debuggable(false); |
| 3574 // In order to collect causal asynchronous stacks efficiently we rely on |
| 3575 // this function not being inlined. |
| 3576 func.set_is_inlinable(!FLAG_causal_async_stacks); |
3574 generated_body_closure = OpenAsyncFunction(func.token_pos()); | 3577 generated_body_closure = OpenAsyncFunction(func.token_pos()); |
3575 } else if (func.IsAsyncClosure()) { | 3578 } else if (func.IsAsyncClosure()) { |
3576 // The closure containing the body of an async function is debuggable. | 3579 // The closure containing the body of an async function is debuggable. |
3577 ASSERT(func.is_debuggable()); | 3580 ASSERT(func.is_debuggable()); |
| 3581 // In order to collect causal asynchronous stacks efficiently we rely on |
| 3582 // this function not being inlined. |
| 3583 func.set_is_inlinable(!FLAG_causal_async_stacks); |
3578 OpenAsyncClosure(); | 3584 OpenAsyncClosure(); |
3579 } else if (func.IsSyncGenerator()) { | 3585 } else if (func.IsSyncGenerator()) { |
3580 // The code of a sync generator is synthesized. Disable debugging. | 3586 // The code of a sync generator is synthesized. Disable debugging. |
3581 func.set_is_debuggable(false); | 3587 func.set_is_debuggable(false); |
3582 generated_body_closure = OpenSyncGeneratorFunction(func.token_pos()); | 3588 generated_body_closure = OpenSyncGeneratorFunction(func.token_pos()); |
3583 } else if (func.IsSyncGenClosure()) { | 3589 } else if (func.IsSyncGenClosure()) { |
3584 // The closure containing the body of a sync generator is debuggable. | 3590 // The closure containing the body of a sync generator is debuggable. |
3585 ASSERT(func.is_debuggable()); | 3591 ASSERT(func.is_debuggable()); |
3586 async_temp_scope_ = current_block_->scope; | 3592 async_temp_scope_ = current_block_->scope; |
3587 } else if (func.IsAsyncGenerator()) { | 3593 } else if (func.IsAsyncGenerator()) { |
3588 func.set_is_debuggable(false); | 3594 func.set_is_debuggable(false); |
| 3595 // In order to collect causal asynchronous stacks efficiently we rely on |
| 3596 // this function not being inlined. |
| 3597 func.set_is_inlinable(!FLAG_causal_async_stacks); |
3589 generated_body_closure = OpenAsyncGeneratorFunction(func.token_pos()); | 3598 generated_body_closure = OpenAsyncGeneratorFunction(func.token_pos()); |
3590 } else if (func.IsAsyncGenClosure()) { | 3599 } else if (func.IsAsyncGenClosure()) { |
3591 // The closure containing the body of an async* function is debuggable. | 3600 // The closure containing the body of an async* function is debuggable. |
3592 ASSERT(func.is_debuggable()); | 3601 ASSERT(func.is_debuggable()); |
| 3602 // In order to collect causal asynchronous stacks efficiently we rely on |
| 3603 // this function not being inlined. |
| 3604 func.set_is_inlinable(!FLAG_causal_async_stacks); |
3593 OpenAsyncGeneratorClosure(); | 3605 OpenAsyncGeneratorClosure(); |
3594 } | 3606 } |
3595 | 3607 |
3596 BoolScope allow_await(&this->await_is_keyword_, | 3608 BoolScope allow_await(&this->await_is_keyword_, |
3597 func.IsAsyncOrGenerator() || func.is_generated_body()); | 3609 func.IsAsyncOrGenerator() || func.is_generated_body()); |
3598 TokenPosition end_token_pos = TokenPosition::kNoSource; | 3610 TokenPosition end_token_pos = TokenPosition::kNoSource; |
3599 if (CurrentToken() == Token::kLBRACE) { | 3611 if (CurrentToken() == Token::kLBRACE) { |
3600 ConsumeToken(); | 3612 ConsumeToken(); |
3601 if (String::Handle(Z, func.name()).Equals(Symbols::EqualOperator())) { | 3613 if (String::Handle(Z, func.name()).Equals(Symbols::EqualOperator())) { |
3602 const Class& owner = Class::Handle(Z, func.Owner()); | 3614 const Class& owner = Class::Handle(Z, func.Owner()); |
(...skipping 3427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7030 current_block_->scope->AddVariable(await_ctx_var); | 7042 current_block_->scope->AddVariable(await_ctx_var); |
7031 } | 7043 } |
7032 | 7044 |
7033 | 7045 |
7034 void Parser::AddAsyncClosureVariables() { | 7046 void Parser::AddAsyncClosureVariables() { |
7035 // Add to current block's scope: | 7047 // Add to current block's scope: |
7036 // var :async_op; | 7048 // var :async_op; |
7037 // var :async_then_callback; | 7049 // var :async_then_callback; |
7038 // var :async_catch_error_callback; | 7050 // var :async_catch_error_callback; |
7039 // var :async_completer; | 7051 // var :async_completer; |
| 7052 // var :async_stack_trace; |
7040 LocalVariable* async_op_var = | 7053 LocalVariable* async_op_var = |
7041 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7054 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7042 Symbols::AsyncOperation(), Object::dynamic_type()); | 7055 Symbols::AsyncOperation(), Object::dynamic_type()); |
7043 current_block_->scope->AddVariable(async_op_var); | 7056 current_block_->scope->AddVariable(async_op_var); |
7044 LocalVariable* async_then_callback_var = new (Z) | 7057 LocalVariable* async_then_callback_var = new (Z) |
7045 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7058 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7046 Symbols::AsyncThenCallback(), Object::dynamic_type()); | 7059 Symbols::AsyncThenCallback(), Object::dynamic_type()); |
7047 current_block_->scope->AddVariable(async_then_callback_var); | 7060 current_block_->scope->AddVariable(async_then_callback_var); |
7048 LocalVariable* async_catch_error_callback_var = new (Z) | 7061 LocalVariable* async_catch_error_callback_var = new (Z) |
7049 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7062 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7050 Symbols::AsyncCatchErrorCallback(), Object::dynamic_type()); | 7063 Symbols::AsyncCatchErrorCallback(), Object::dynamic_type()); |
7051 current_block_->scope->AddVariable(async_catch_error_callback_var); | 7064 current_block_->scope->AddVariable(async_catch_error_callback_var); |
7052 LocalVariable* async_completer = | 7065 LocalVariable* async_completer = |
7053 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7066 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7054 Symbols::AsyncCompleter(), Object::dynamic_type()); | 7067 Symbols::AsyncCompleter(), Object::dynamic_type()); |
7055 current_block_->scope->AddVariable(async_completer); | 7068 current_block_->scope->AddVariable(async_completer); |
| 7069 LocalVariable* async_stack_trace = new (Z) |
| 7070 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
| 7071 Symbols::AsyncStackTraceVar(), Object::dynamic_type()); |
| 7072 current_block_->scope->AddVariable(async_stack_trace); |
7056 } | 7073 } |
7057 | 7074 |
7058 | 7075 |
7059 void Parser::AddAsyncGeneratorVariables() { | 7076 void Parser::AddAsyncGeneratorVariables() { |
7060 // Add to current block's scope: | 7077 // Add to current block's scope: |
7061 // var :controller; | 7078 // var :controller; |
7062 // The :controller variable is used by the async generator closure to | 7079 // The :controller variable is used by the async generator closure to |
7063 // store the StreamController object to which the yielded expressions | 7080 // store the StreamController object to which the yielded expressions |
7064 // are added. | 7081 // are added. |
7065 // var :async_op; | 7082 // var :async_op; |
7066 // var :async_then_callback; | 7083 // var :async_then_callback; |
7067 // var :async_catch_error_callback; | 7084 // var :async_catch_error_callback; |
| 7085 // var :async_stack_trace; |
7068 // These variables are used to store the async generator closure containing | 7086 // These variables are used to store the async generator closure containing |
7069 // the body of the async* function. They are used by the await operator. | 7087 // the body of the async* function. They are used by the await operator. |
7070 LocalVariable* controller_var = | 7088 LocalVariable* controller_var = |
7071 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7089 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7072 Symbols::Controller(), Object::dynamic_type()); | 7090 Symbols::Controller(), Object::dynamic_type()); |
7073 current_block_->scope->AddVariable(controller_var); | 7091 current_block_->scope->AddVariable(controller_var); |
7074 LocalVariable* async_op_var = | 7092 LocalVariable* async_op_var = |
7075 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7093 new (Z) LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7076 Symbols::AsyncOperation(), Object::dynamic_type()); | 7094 Symbols::AsyncOperation(), Object::dynamic_type()); |
7077 current_block_->scope->AddVariable(async_op_var); | 7095 current_block_->scope->AddVariable(async_op_var); |
7078 LocalVariable* async_then_callback_var = new (Z) | 7096 LocalVariable* async_then_callback_var = new (Z) |
7079 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7097 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7080 Symbols::AsyncThenCallback(), Object::dynamic_type()); | 7098 Symbols::AsyncThenCallback(), Object::dynamic_type()); |
7081 current_block_->scope->AddVariable(async_then_callback_var); | 7099 current_block_->scope->AddVariable(async_then_callback_var); |
7082 LocalVariable* async_catch_error_callback_var = new (Z) | 7100 LocalVariable* async_catch_error_callback_var = new (Z) |
7083 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, | 7101 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
7084 Symbols::AsyncCatchErrorCallback(), Object::dynamic_type()); | 7102 Symbols::AsyncCatchErrorCallback(), Object::dynamic_type()); |
7085 current_block_->scope->AddVariable(async_catch_error_callback_var); | 7103 current_block_->scope->AddVariable(async_catch_error_callback_var); |
| 7104 LocalVariable* async_stack_trace = new (Z) |
| 7105 LocalVariable(TokenPosition::kNoSource, TokenPosition::kNoSource, |
| 7106 Symbols::AsyncStackTraceVar(), Object::dynamic_type()); |
| 7107 current_block_->scope->AddVariable(async_stack_trace); |
7086 } | 7108 } |
7087 | 7109 |
7088 | 7110 |
7089 RawFunction* Parser::OpenAsyncGeneratorFunction(TokenPosition async_func_pos) { | 7111 RawFunction* Parser::OpenAsyncGeneratorFunction(TokenPosition async_func_pos) { |
7090 TRACE_PARSER("OpenAsyncGeneratorFunction"); | 7112 TRACE_PARSER("OpenAsyncGeneratorFunction"); |
7091 AddContinuationVariables(); | 7113 AddContinuationVariables(); |
7092 AddAsyncGeneratorVariables(); | 7114 AddAsyncGeneratorVariables(); |
7093 | 7115 |
7094 Function& closure = Function::Handle(Z); | 7116 Function& closure = Function::Handle(Z); |
7095 bool is_new_closure = false; | 7117 bool is_new_closure = false; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7173 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7195 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7174 existing_var = | 7196 existing_var = |
7175 closure_body->scope()->LookupVariable(Symbols::AsyncOperation(), false); | 7197 closure_body->scope()->LookupVariable(Symbols::AsyncOperation(), false); |
7176 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7198 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7177 existing_var = closure_body->scope()->LookupVariable( | 7199 existing_var = closure_body->scope()->LookupVariable( |
7178 Symbols::AsyncThenCallback(), false); | 7200 Symbols::AsyncThenCallback(), false); |
7179 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7201 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7180 existing_var = closure_body->scope()->LookupVariable( | 7202 existing_var = closure_body->scope()->LookupVariable( |
7181 Symbols::AsyncCatchErrorCallback(), false); | 7203 Symbols::AsyncCatchErrorCallback(), false); |
7182 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7204 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 7205 existing_var = closure_body->scope()->LookupVariable( |
| 7206 Symbols::AsyncStackTraceVar(), false); |
| 7207 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7183 | 7208 |
7184 const Library& async_lib = Library::Handle(Library::AsyncLibrary()); | 7209 const Library& async_lib = Library::Handle(Library::AsyncLibrary()); |
7185 | 7210 |
7186 const Class& controller_class = Class::Handle( | 7211 const Class& controller_class = Class::Handle( |
7187 Z, | 7212 Z, |
7188 async_lib.LookupClassAllowPrivate(Symbols::_AsyncStarStreamController())); | 7213 async_lib.LookupClassAllowPrivate(Symbols::_AsyncStarStreamController())); |
7189 ASSERT(!controller_class.IsNull()); | 7214 ASSERT(!controller_class.IsNull()); |
7190 const Function& controller_constructor = Function::ZoneHandle( | 7215 const Function& controller_constructor = Function::ZoneHandle( |
7191 Z, controller_class.LookupConstructorAllowPrivate( | 7216 Z, controller_class.LookupConstructorAllowPrivate( |
7192 Symbols::_AsyncStarStreamControllerConstructor())); | 7217 Symbols::_AsyncStarStreamControllerConstructor())); |
7193 | 7218 |
7194 // :await_jump_var = -1; | 7219 // :await_jump_var = -1; |
7195 LocalVariable* jump_var = | 7220 LocalVariable* jump_var = |
7196 current_block_->scope->LookupVariable(Symbols::AwaitJumpVar(), false); | 7221 current_block_->scope->LookupVariable(Symbols::AwaitJumpVar(), false); |
7197 LiteralNode* init_value = new (Z) | 7222 LiteralNode* init_value = new (Z) |
7198 LiteralNode(TokenPosition::kNoSource, Smi::ZoneHandle(Smi::New(-1))); | 7223 LiteralNode(TokenPosition::kNoSource, Smi::ZoneHandle(Smi::New(-1))); |
7199 current_block_->statements->Add( | 7224 current_block_->statements->Add( |
7200 new (Z) StoreLocalNode(TokenPosition::kNoSource, jump_var, init_value)); | 7225 new (Z) StoreLocalNode(TokenPosition::kNoSource, jump_var, init_value)); |
7201 | 7226 |
| 7227 TokenPosition token_pos = TokenPosition::kNoSource; |
| 7228 |
| 7229 if (FLAG_causal_async_stacks) { |
| 7230 // Add to AST: |
| 7231 // :async_stack_trace = _asyncStackTraceHelper(); |
| 7232 const Function& async_stack_trace_helper = Function::ZoneHandle( |
| 7233 Z, |
| 7234 async_lib.LookupFunctionAllowPrivate(Symbols::AsyncStackTraceHelper())); |
| 7235 ASSERT(!async_stack_trace_helper.IsNull()); |
| 7236 ArgumentListNode* async_stack_trace_helper_args = |
| 7237 new (Z) ArgumentListNode(TokenPosition::kNoSource); |
| 7238 StaticCallNode* async_stack_trace_helper_call = new (Z) StaticCallNode( |
| 7239 token_pos, async_stack_trace_helper, async_stack_trace_helper_args); |
| 7240 LocalVariable* async_stack_trace_var = |
| 7241 current_block_->scope->LookupVariable(Symbols::AsyncStackTraceVar(), |
| 7242 false); |
| 7243 StoreLocalNode* store_async_stack_trace = new (Z) StoreLocalNode( |
| 7244 token_pos, async_stack_trace_var, async_stack_trace_helper_call); |
| 7245 current_block_->statements->Add(store_async_stack_trace); |
| 7246 } |
| 7247 |
| 7248 |
7202 // Add to AST: | 7249 // Add to AST: |
7203 // :async_op = <closure>; (containing the original body) | 7250 // :async_op = <closure>; (containing the original body) |
7204 LocalVariable* async_op_var = | 7251 LocalVariable* async_op_var = |
7205 current_block_->scope->LookupVariable(Symbols::AsyncOperation(), false); | 7252 current_block_->scope->LookupVariable(Symbols::AsyncOperation(), false); |
7206 ClosureNode* closure_obj = new (Z) ClosureNode( | 7253 ClosureNode* closure_obj = new (Z) ClosureNode( |
7207 TokenPosition::kNoSource, closure_func, NULL, closure_body->scope()); | 7254 TokenPosition::kNoSource, closure_func, NULL, closure_body->scope()); |
7208 StoreLocalNode* store_async_op = new (Z) | 7255 StoreLocalNode* store_async_op = new (Z) |
7209 StoreLocalNode(TokenPosition::kNoSource, async_op_var, closure_obj); | 7256 StoreLocalNode(TokenPosition::kNoSource, async_op_var, closure_obj); |
7210 | 7257 |
7211 current_block_->statements->Add(store_async_op); | 7258 current_block_->statements->Add(store_async_op); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7335 // closure body in order to mark them as captured. | 7382 // closure body in order to mark them as captured. |
7336 LocalVariable* existing_var = | 7383 LocalVariable* existing_var = |
7337 closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); | 7384 closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); |
7338 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7385 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7339 existing_var = | 7386 existing_var = |
7340 closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false); | 7387 closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false); |
7341 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7388 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7342 existing_var = | 7389 existing_var = |
7343 closure_body->scope()->LookupVariable(Symbols::AsyncCompleter(), false); | 7390 closure_body->scope()->LookupVariable(Symbols::AsyncCompleter(), false); |
7344 ASSERT((existing_var != NULL) && existing_var->is_captured()); | 7391 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 7392 existing_var = closure_body->scope()->LookupVariable( |
| 7393 Symbols::AsyncStackTraceVar(), false); |
| 7394 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7345 | 7395 |
7346 // Create and return a new future that executes a closure with the current | 7396 // Create and return a new future that executes a closure with the current |
7347 // body. | 7397 // body. |
7348 | 7398 |
7349 // No need to capture parameters or other variables, since they have already | 7399 // No need to capture parameters or other variables, since they have already |
7350 // been captured in the corresponding scope as the body has been parsed within | 7400 // been captured in the corresponding scope as the body has been parsed within |
7351 // a nested block (contained in the async function's block). | 7401 // a nested block (contained in the async function's block). |
7352 const Class& future = Class::ZoneHandle(Z, I->object_store()->future_class()); | 7402 const Class& future = Class::ZoneHandle(Z, I->object_store()->future_class()); |
7353 ASSERT(!future.IsNull()); | 7403 ASSERT(!future.IsNull()); |
7354 const Function& constructor = Function::ZoneHandle( | 7404 const Function& constructor = Function::ZoneHandle( |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7387 // :async_op = <closure>; (containing the original body) | 7437 // :async_op = <closure>; (containing the original body) |
7388 LocalVariable* async_op_var = | 7438 LocalVariable* async_op_var = |
7389 current_block_->scope->LookupVariable(Symbols::AsyncOperation(), false); | 7439 current_block_->scope->LookupVariable(Symbols::AsyncOperation(), false); |
7390 ClosureNode* cn = | 7440 ClosureNode* cn = |
7391 new (Z) ClosureNode(token_pos, closure, NULL, closure_body->scope()); | 7441 new (Z) ClosureNode(token_pos, closure, NULL, closure_body->scope()); |
7392 StoreLocalNode* store_async_op = | 7442 StoreLocalNode* store_async_op = |
7393 new (Z) StoreLocalNode(token_pos, async_op_var, cn); | 7443 new (Z) StoreLocalNode(token_pos, async_op_var, cn); |
7394 current_block_->statements->Add(store_async_op); | 7444 current_block_->statements->Add(store_async_op); |
7395 | 7445 |
7396 const Library& async_lib = Library::Handle(Library::AsyncLibrary()); | 7446 const Library& async_lib = Library::Handle(Library::AsyncLibrary()); |
| 7447 |
| 7448 if (FLAG_causal_async_stacks) { |
| 7449 // Add to AST: |
| 7450 // :async_stack_trace = _asyncStackTraceHelper(); |
| 7451 const Function& async_stack_trace_helper = Function::ZoneHandle( |
| 7452 Z, |
| 7453 async_lib.LookupFunctionAllowPrivate(Symbols::AsyncStackTraceHelper())); |
| 7454 ASSERT(!async_stack_trace_helper.IsNull()); |
| 7455 ArgumentListNode* async_stack_trace_helper_args = |
| 7456 new (Z) ArgumentListNode(token_pos); |
| 7457 StaticCallNode* async_stack_trace_helper_call = new (Z) StaticCallNode( |
| 7458 token_pos, async_stack_trace_helper, async_stack_trace_helper_args); |
| 7459 LocalVariable* async_stack_trace_var = |
| 7460 current_block_->scope->LookupVariable(Symbols::AsyncStackTraceVar(), |
| 7461 false); |
| 7462 StoreLocalNode* store_async_stack_trace = new (Z) StoreLocalNode( |
| 7463 token_pos, async_stack_trace_var, async_stack_trace_helper_call); |
| 7464 current_block_->statements->Add(store_async_stack_trace); |
| 7465 } |
| 7466 |
7397 // :async_then_callback = _asyncThenWrapperHelper(:async_op) | 7467 // :async_then_callback = _asyncThenWrapperHelper(:async_op) |
7398 const Function& async_then_wrapper_helper = Function::ZoneHandle( | 7468 const Function& async_then_wrapper_helper = Function::ZoneHandle( |
7399 Z, | 7469 Z, |
7400 async_lib.LookupFunctionAllowPrivate(Symbols::AsyncThenWrapperHelper())); | 7470 async_lib.LookupFunctionAllowPrivate(Symbols::AsyncThenWrapperHelper())); |
7401 ASSERT(!async_then_wrapper_helper.IsNull()); | 7471 ASSERT(!async_then_wrapper_helper.IsNull()); |
7402 ArgumentListNode* async_then_wrapper_helper_args = | 7472 ArgumentListNode* async_then_wrapper_helper_args = |
7403 new (Z) ArgumentListNode(token_pos); | 7473 new (Z) ArgumentListNode(token_pos); |
7404 async_then_wrapper_helper_args->Add( | 7474 async_then_wrapper_helper_args->Add( |
7405 new (Z) LoadLocalNode(token_pos, async_op_var)); | 7475 new (Z) LoadLocalNode(token_pos, async_op_var)); |
7406 StaticCallNode* then_wrapper_call = new (Z) StaticCallNode( | 7476 StaticCallNode* then_wrapper_call = new (Z) StaticCallNode( |
(...skipping 7564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14971 const ArgumentListNode& function_args, | 15041 const ArgumentListNode& function_args, |
14972 const LocalVariable* temp_for_last_arg, | 15042 const LocalVariable* temp_for_last_arg, |
14973 bool is_super_invocation) { | 15043 bool is_super_invocation) { |
14974 UNREACHABLE(); | 15044 UNREACHABLE(); |
14975 return NULL; | 15045 return NULL; |
14976 } | 15046 } |
14977 | 15047 |
14978 } // namespace dart | 15048 } // namespace dart |
14979 | 15049 |
14980 #endif // DART_PRECOMPILED_RUNTIME | 15050 #endif // DART_PRECOMPILED_RUNTIME |
OLD | NEW |