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 | 6 |
7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
9 #include "vm/ast_transformer.h" | 9 #include "vm/ast_transformer.h" |
10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
(...skipping 6577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6588 async_temp_scope_ = current_block_->scope; | 6588 async_temp_scope_ = current_block_->scope; |
6589 return body.raw(); | 6589 return body.raw(); |
6590 } | 6590 } |
6591 | 6591 |
6592 SequenceNode* Parser::CloseSyncGenFunction(const Function& closure, | 6592 SequenceNode* Parser::CloseSyncGenFunction(const Function& closure, |
6593 SequenceNode* closure_body) { | 6593 SequenceNode* closure_body) { |
6594 // The block for the closure body has already been closed. Close the | 6594 // The block for the closure body has already been closed. Close the |
6595 // corresponding function block. | 6595 // corresponding function block. |
6596 CloseBlock(); | 6596 CloseBlock(); |
6597 | 6597 |
6598 closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); | 6598 LocalVariable* existing_var = |
6599 closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false); | 6599 closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); |
| 6600 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 6601 existing_var = |
| 6602 closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false); |
| 6603 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
6600 | 6604 |
6601 // :await_jump_var = -1; | 6605 // :await_jump_var = -1; |
6602 LocalVariable* jump_var = | 6606 LocalVariable* jump_var = |
6603 current_block_->scope->LookupVariable(Symbols::AwaitJumpVar(), false); | 6607 current_block_->scope->LookupVariable(Symbols::AwaitJumpVar(), false); |
6604 LiteralNode* init_value = | 6608 LiteralNode* init_value = |
6605 new(Z) LiteralNode(Scanner::kNoSourcePos, Smi::ZoneHandle(Smi::New(-1))); | 6609 new(Z) LiteralNode(Scanner::kNoSourcePos, Smi::ZoneHandle(Smi::New(-1))); |
6606 current_block_->statements->Add( | 6610 current_block_->statements->Add( |
6607 new(Z) StoreLocalNode(Scanner::kNoSourcePos, jump_var, init_value)); | 6611 new(Z) StoreLocalNode(Scanner::kNoSourcePos, jump_var, init_value)); |
6608 | 6612 |
6609 // return new SyncIterable(body_closure); | 6613 // return new SyncIterable(body_closure); |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6891 TRACE_PARSER("CloseAsyncGeneratorFunction"); | 6895 TRACE_PARSER("CloseAsyncGeneratorFunction"); |
6892 ASSERT(!closure_func.IsNull()); | 6896 ASSERT(!closure_func.IsNull()); |
6893 ASSERT(closure_body != NULL); | 6897 ASSERT(closure_body != NULL); |
6894 | 6898 |
6895 // The block for the async closure body has already been closed. Close the | 6899 // The block for the async closure body has already been closed. Close the |
6896 // corresponding function block. | 6900 // corresponding function block. |
6897 CloseBlock(); | 6901 CloseBlock(); |
6898 | 6902 |
6899 // Make sure the implicit variables of the async generator function | 6903 // Make sure the implicit variables of the async generator function |
6900 // are captured. | 6904 // are captured. |
6901 closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); | 6905 LocalVariable* existing_var = closure_body->scope()->LookupVariable( |
6902 closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false); | 6906 Symbols::AwaitJumpVar(), false); |
6903 closure_body->scope()->LookupVariable(Symbols::Controller(), false); | 6907 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
6904 closure_body->scope()->LookupVariable(Symbols::AsyncOperation(), false); | 6908 existing_var = closure_body->scope()->LookupVariable( |
6905 closure_body->scope()->LookupVariable(Symbols::AsyncThenCallback(), false); | 6909 Symbols::AwaitContextVar(), false); |
6906 closure_body->scope()->LookupVariable( | 6910 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 6911 existing_var = closure_body->scope()->LookupVariable( |
| 6912 Symbols::Controller(), false); |
| 6913 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 6914 existing_var = closure_body->scope()->LookupVariable( |
| 6915 Symbols::AsyncOperation(), false); |
| 6916 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 6917 existing_var = closure_body->scope()->LookupVariable( |
| 6918 Symbols::AsyncThenCallback(), false); |
| 6919 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 6920 existing_var = closure_body->scope()->LookupVariable( |
6907 Symbols::AsyncCatchErrorCallback(), false); | 6921 Symbols::AsyncCatchErrorCallback(), false); |
| 6922 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
6908 | 6923 |
6909 const Library& async_lib = Library::Handle(Library::AsyncLibrary()); | 6924 const Library& async_lib = Library::Handle(Library::AsyncLibrary()); |
6910 | 6925 |
6911 const Class& controller_class = Class::Handle(Z, | 6926 const Class& controller_class = Class::Handle(Z, |
6912 async_lib.LookupClassAllowPrivate( | 6927 async_lib.LookupClassAllowPrivate( |
6913 Symbols::_AsyncStarStreamController())); | 6928 Symbols::_AsyncStarStreamController())); |
6914 ASSERT(!controller_class.IsNull()); | 6929 ASSERT(!controller_class.IsNull()); |
6915 const Function& controller_constructor = Function::ZoneHandle(Z, | 6930 const Function& controller_constructor = Function::ZoneHandle(Z, |
6916 controller_class.LookupConstructorAllowPrivate( | 6931 controller_class.LookupConstructorAllowPrivate( |
6917 Symbols::_AsyncStarStreamControllerConstructor())); | 6932 Symbols::_AsyncStarStreamControllerConstructor())); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7021 // We need a temporary expression to store intermediate return values. | 7036 // We need a temporary expression to store intermediate return values. |
7022 parsed_function()->EnsureExpressionTemp(); | 7037 parsed_function()->EnsureExpressionTemp(); |
7023 | 7038 |
7024 SequenceNode* new_body = CloseAsyncGeneratorTryBlock(body); | 7039 SequenceNode* new_body = CloseAsyncGeneratorTryBlock(body); |
7025 ASSERT(new_body != NULL); | 7040 ASSERT(new_body != NULL); |
7026 ASSERT(new_body->scope() != NULL); | 7041 ASSERT(new_body->scope() != NULL); |
7027 | 7042 |
7028 // Implicitly mark those variables below as captured. We currently mark all | 7043 // Implicitly mark those variables below as captured. We currently mark all |
7029 // variables of all scopes as captured, but as soon as we do something | 7044 // variables of all scopes as captured, but as soon as we do something |
7030 // smarter we rely on these internal variables to be available. | 7045 // smarter we rely on these internal variables to be available. |
7031 new_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); | 7046 LocalVariable* existing_var = new_body->scope()->LookupVariable( |
7032 new_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false); | 7047 Symbols::AwaitJumpVar(), false); |
7033 new_body->scope()->LookupVariable(Symbols::Controller(), false); | 7048 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7034 new_body->scope()->LookupVariable(Symbols::AsyncOperationParam(), false); | 7049 existing_var = new_body->scope()->LookupVariable( |
7035 new_body->scope()->LookupVariable(Symbols::AsyncOperationErrorParam(), false); | 7050 Symbols::AwaitContextVar(), false); |
7036 new_body->scope()->LookupVariable( | 7051 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 7052 existing_var = new_body->scope()->LookupVariable( |
| 7053 Symbols::Controller(), false); |
| 7054 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 7055 existing_var = new_body->scope()->LookupVariable( |
| 7056 Symbols::AsyncOperationParam(), false); |
| 7057 ASSERT(existing_var != NULL); |
| 7058 existing_var = new_body->scope()->LookupVariable( |
| 7059 Symbols::AsyncOperationErrorParam(), false); |
| 7060 ASSERT(existing_var != NULL); |
| 7061 existing_var = new_body->scope()->LookupVariable( |
7037 Symbols::AsyncOperationStackTraceParam(), false); | 7062 Symbols::AsyncOperationStackTraceParam(), false); |
| 7063 ASSERT(existing_var != NULL); |
7038 new_body->scope()->RecursivelyCaptureAllVariables(); | 7064 new_body->scope()->RecursivelyCaptureAllVariables(); |
7039 return new_body; | 7065 return new_body; |
7040 } | 7066 } |
7041 | 7067 |
7042 | 7068 |
7043 // Add a return node to the sequence if necessary. | 7069 // Add a return node to the sequence if necessary. |
7044 void Parser::EnsureHasReturnStatement(SequenceNode* seq, intptr_t return_pos) { | 7070 void Parser::EnsureHasReturnStatement(SequenceNode* seq, intptr_t return_pos) { |
7045 if ((seq->length() == 0) || | 7071 if ((seq->length() == 0) || |
7046 !seq->NodeAt(seq->length() - 1)->IsReturnNode()) { | 7072 !seq->NodeAt(seq->length() - 1)->IsReturnNode()) { |
7047 const Function& func = innermost_function(); | 7073 const Function& func = innermost_function(); |
(...skipping 24 matching lines...) Expand all Loading... |
7072 SequenceNode* Parser::CloseAsyncFunction(const Function& closure, | 7098 SequenceNode* Parser::CloseAsyncFunction(const Function& closure, |
7073 SequenceNode* closure_body) { | 7099 SequenceNode* closure_body) { |
7074 TRACE_PARSER("CloseAsyncFunction"); | 7100 TRACE_PARSER("CloseAsyncFunction"); |
7075 ASSERT(!closure.IsNull()); | 7101 ASSERT(!closure.IsNull()); |
7076 ASSERT(closure_body != NULL); | 7102 ASSERT(closure_body != NULL); |
7077 | 7103 |
7078 // The block for the async closure body has already been closed. Close the | 7104 // The block for the async closure body has already been closed. Close the |
7079 // corresponding function block. | 7105 // corresponding function block. |
7080 CloseBlock(); | 7106 CloseBlock(); |
7081 | 7107 |
7082 closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); | 7108 LocalVariable* existing_var = |
7083 closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false); | 7109 closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); |
7084 closure_body->scope()->CaptureVariable(Symbols::AsyncCompleter()); | 7110 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 7111 existing_var = |
| 7112 closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false); |
| 7113 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 7114 existing_var = |
| 7115 closure_body->scope()->LookupVariable(Symbols::AsyncCompleter(), false); |
| 7116 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7085 | 7117 |
7086 // Create and return a new future that executes a closure with the current | 7118 // Create and return a new future that executes a closure with the current |
7087 // body. | 7119 // body. |
7088 | 7120 |
7089 // No need to capture parameters or other variables, since they have already | 7121 // No need to capture parameters or other variables, since they have already |
7090 // been captured in the corresponding scope as the body has been parsed within | 7122 // been captured in the corresponding scope as the body has been parsed within |
7091 // a nested block (contained in the async funtion's block). | 7123 // a nested block (contained in the async funtion's block). |
7092 const Class& future = | 7124 const Class& future = |
7093 Class::ZoneHandle(Z, I->object_store()->future_class()); | 7125 Class::ZoneHandle(Z, I->object_store()->future_class()); |
7094 ASSERT(!future.IsNull()); | 7126 ASSERT(!future.IsNull()); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7215 | 7247 |
7216 SequenceNode* Parser::CloseAsyncClosure(SequenceNode* body) { | 7248 SequenceNode* Parser::CloseAsyncClosure(SequenceNode* body) { |
7217 // We need a temporary expression to store intermediate return values. | 7249 // We need a temporary expression to store intermediate return values. |
7218 parsed_function()->EnsureExpressionTemp(); | 7250 parsed_function()->EnsureExpressionTemp(); |
7219 // Implicitly mark those variables below as captured. We currently mark all | 7251 // Implicitly mark those variables below as captured. We currently mark all |
7220 // variables of all scopes as captured (below), but as soon as we do something | 7252 // variables of all scopes as captured (below), but as soon as we do something |
7221 // smarter we rely on these internal variables to be available. | 7253 // smarter we rely on these internal variables to be available. |
7222 SequenceNode* new_body = CloseAsyncTryBlock(body); | 7254 SequenceNode* new_body = CloseAsyncTryBlock(body); |
7223 ASSERT(new_body != NULL); | 7255 ASSERT(new_body != NULL); |
7224 ASSERT(new_body->scope() != NULL); | 7256 ASSERT(new_body->scope() != NULL); |
7225 new_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); | 7257 LocalVariable* existing_var = |
7226 new_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false); | 7258 new_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false); |
7227 new_body->scope()->LookupVariable(Symbols::AsyncCompleter(), false); | 7259 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 7260 existing_var = |
| 7261 new_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false); |
| 7262 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
| 7263 existing_var = |
| 7264 new_body->scope()->LookupVariable(Symbols::AsyncCompleter(), false); |
| 7265 ASSERT((existing_var != NULL) && existing_var->is_captured()); |
7228 new_body->scope()->RecursivelyCaptureAllVariables(); | 7266 new_body->scope()->RecursivelyCaptureAllVariables(); |
7229 return new_body; | 7267 return new_body; |
7230 } | 7268 } |
7231 | 7269 |
7232 | 7270 |
7233 // Set up default values for all optional parameters to the function. | 7271 // Set up default values for all optional parameters to the function. |
7234 void Parser::SetupDefaultsForOptionalParams( | 7272 void Parser::SetupDefaultsForOptionalParams( |
7235 const ParamList& params, | 7273 const ParamList& params, |
7236 ZoneGrowableArray<const Instance*>* default_values) { | 7274 ZoneGrowableArray<const Instance*>* default_values) { |
7237 if (params.num_optional_parameters > 0) { | 7275 if (params.num_optional_parameters > 0) { |
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8508 | 8546 |
8509 static LocalVariable* LookupAsyncSavedTryContextVar(LocalScope* scope, | 8547 static LocalVariable* LookupAsyncSavedTryContextVar(LocalScope* scope, |
8510 uint16_t try_index) { | 8548 uint16_t try_index) { |
8511 const String& async_saved_try_ctx_name = | 8549 const String& async_saved_try_ctx_name = |
8512 String::ZoneHandle(Symbols::New(String::Handle( | 8550 String::ZoneHandle(Symbols::New(String::Handle( |
8513 String::NewFormatted( | 8551 String::NewFormatted( |
8514 "%s%d", | 8552 "%s%d", |
8515 Symbols::AsyncSavedTryCtxVarPrefix().ToCString(), | 8553 Symbols::AsyncSavedTryCtxVarPrefix().ToCString(), |
8516 try_index)))); | 8554 try_index)))); |
8517 LocalVariable* var = scope->LocalLookupVariable(async_saved_try_ctx_name); | 8555 LocalVariable* var = scope->LocalLookupVariable(async_saved_try_ctx_name); |
8518 ASSERT((var != NULL) && var->is_captured());\ | 8556 ASSERT((var != NULL) && var->is_captured()); |
8519 return var; | 8557 return var; |
8520 } | 8558 } |
8521 | 8559 |
8522 | 8560 |
8523 // If the await or yield being parsed is in a try block, the continuation code | 8561 // If the await or yield being parsed is in a try block, the continuation code |
8524 // needs to restore the corresponding stack-based variable :saved_try_ctx_var, | 8562 // needs to restore the corresponding stack-based variable :saved_try_ctx_var, |
8525 // and the stack-based variable :saved_try_ctx_var of the outer try block. | 8563 // and the stack-based variable :saved_try_ctx_var of the outer try block. |
8526 // The inner :saved_try_ctx_var is used by a finally clause handling an | 8564 // The inner :saved_try_ctx_var is used by a finally clause handling an |
8527 // exception thrown by the continuation code in a try block or catch block. | 8565 // exception thrown by the continuation code in a try block or catch block. |
8528 // If no finally clause exists, the catch or finally clause of the outer try | 8566 // If no finally clause exists, the catch or finally clause of the outer try |
(...skipping 15 matching lines...) Expand all Loading... |
8544 *outer_saved_try_ctx = NULL; | 8582 *outer_saved_try_ctx = NULL; |
8545 *outer_async_saved_try_ctx = NULL; | 8583 *outer_async_saved_try_ctx = NULL; |
8546 if (try_stack_ != NULL) { | 8584 if (try_stack_ != NULL) { |
8547 LocalScope* scope = try_stack_->try_block()->scope; | 8585 LocalScope* scope = try_stack_->try_block()->scope; |
8548 uint16_t try_index = try_stack_->try_index(); | 8586 uint16_t try_index = try_stack_->try_index(); |
8549 const int current_function_level = current_block_->scope->function_level(); | 8587 const int current_function_level = current_block_->scope->function_level(); |
8550 if (scope->function_level() == current_function_level) { | 8588 if (scope->function_level() == current_function_level) { |
8551 // The block declaring :saved_try_ctx_var variable is the parent of the | 8589 // The block declaring :saved_try_ctx_var variable is the parent of the |
8552 // pushed try block. | 8590 // pushed try block. |
8553 *saved_try_ctx = LookupSavedTryContextVar(scope->parent()); | 8591 *saved_try_ctx = LookupSavedTryContextVar(scope->parent()); |
8554 *async_saved_try_ctx = LookupAsyncSavedTryContextVar(scope, try_index); | 8592 *async_saved_try_ctx = LookupAsyncSavedTryContextVar(async_temp_scope_, |
| 8593 try_index); |
8555 if ((try_stack_->outer_try() != NULL) && !try_stack_->inside_finally()) { | 8594 if ((try_stack_->outer_try() != NULL) && !try_stack_->inside_finally()) { |
8556 // Collecting the outer try scope is not necessary if we | 8595 // Collecting the outer try scope is not necessary if we |
8557 // are in a finally block. | 8596 // are in a finally block. |
8558 scope = try_stack_->outer_try()->try_block()->scope; | 8597 scope = try_stack_->outer_try()->try_block()->scope; |
8559 try_index = try_stack_->outer_try()->try_index(); | 8598 try_index = try_stack_->outer_try()->try_index(); |
8560 if (scope->function_level() == current_function_level) { | 8599 if (scope->function_level() == current_function_level) { |
8561 *outer_saved_try_ctx = LookupSavedTryContextVar(scope->parent()); | 8600 *outer_saved_try_ctx = LookupSavedTryContextVar(scope->parent()); |
8562 *outer_async_saved_try_ctx = | 8601 *outer_async_saved_try_ctx = |
8563 LookupAsyncSavedTryContextVar(scope, try_index); | 8602 LookupAsyncSavedTryContextVar(async_temp_scope_, try_index); |
8564 } | 8603 } |
8565 } | 8604 } |
8566 } | 8605 } |
8567 } | 8606 } |
8568 // An async or async* has an implicitly created try-catch around the | 8607 // An async or async* has an implicitly created try-catch around the |
8569 // function body, so the await or yield inside the async closure should always | 8608 // function body, so the await or yield inside the async closure should always |
8570 // be created with a try scope. | 8609 // be created with a try scope. |
8571 ASSERT((*saved_try_ctx != NULL) || | 8610 ASSERT((*saved_try_ctx != NULL) || |
8572 innermost_function().IsAsyncFunction() || | 8611 innermost_function().IsAsyncFunction() || |
8573 innermost_function().IsAsyncGenerator() || | 8612 innermost_function().IsAsyncGenerator() || |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9225 // In case of async closures we need to restore the saved try index of an | 9264 // In case of async closures we need to restore the saved try index of an |
9226 // outer try block (if it exists). The current try block has already been | 9265 // outer try block (if it exists). The current try block has already been |
9227 // removed from the stack of try blocks. | 9266 // removed from the stack of try blocks. |
9228 if (is_async) { | 9267 if (is_async) { |
9229 if (try_stack_ != NULL) { | 9268 if (try_stack_ != NULL) { |
9230 LocalScope* scope = try_stack_->try_block()->scope; | 9269 LocalScope* scope = try_stack_->try_block()->scope; |
9231 if (scope->function_level() == current_block_->scope->function_level()) { | 9270 if (scope->function_level() == current_block_->scope->function_level()) { |
9232 LocalVariable* saved_try_ctx = | 9271 LocalVariable* saved_try_ctx = |
9233 LookupSavedTryContextVar(scope->parent()); | 9272 LookupSavedTryContextVar(scope->parent()); |
9234 LocalVariable* async_saved_try_ctx = | 9273 LocalVariable* async_saved_try_ctx = |
9235 LookupAsyncSavedTryContextVar(scope->parent(), | 9274 LookupAsyncSavedTryContextVar(async_temp_scope_, |
9236 try_stack_->try_index()); | 9275 try_stack_->try_index()); |
9237 current_block_->statements->Add( | 9276 current_block_->statements->Add( |
9238 new (Z) StoreLocalNode( | 9277 new (Z) StoreLocalNode( |
9239 Scanner::kNoSourcePos, | 9278 Scanner::kNoSourcePos, |
9240 saved_try_ctx, | 9279 saved_try_ctx, |
9241 new (Z) LoadLocalNode(Scanner::kNoSourcePos, | 9280 new (Z) LoadLocalNode(Scanner::kNoSourcePos, |
9242 async_saved_try_ctx))); | 9281 async_saved_try_ctx))); |
9243 } | 9282 } |
9244 } | 9283 } |
9245 // We need to save the exception variables as in catch clauses, whether | 9284 // We need to save the exception variables as in catch clauses, whether |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9499 if (is_async && (current != NULL)) { | 9538 if (is_async && (current != NULL)) { |
9500 ASSERT(try_stack_ != NULL); | 9539 ASSERT(try_stack_ != NULL); |
9501 SequenceNode* async_code = new(Z) SequenceNode(handler_pos, NULL); | 9540 SequenceNode* async_code = new(Z) SequenceNode(handler_pos, NULL); |
9502 const TryStack* try_block = try_stack_->outer_try(); | 9541 const TryStack* try_block = try_stack_->outer_try(); |
9503 if (try_block != NULL) { | 9542 if (try_block != NULL) { |
9504 LocalScope* scope = try_block->try_block()->scope; | 9543 LocalScope* scope = try_block->try_block()->scope; |
9505 if (scope->function_level() == current_block_->scope->function_level()) { | 9544 if (scope->function_level() == current_block_->scope->function_level()) { |
9506 LocalVariable* saved_try_ctx = | 9545 LocalVariable* saved_try_ctx = |
9507 LookupSavedTryContextVar(scope->parent()); | 9546 LookupSavedTryContextVar(scope->parent()); |
9508 LocalVariable* async_saved_try_ctx = | 9547 LocalVariable* async_saved_try_ctx = |
9509 LookupAsyncSavedTryContextVar(scope->parent(), | 9548 LookupAsyncSavedTryContextVar(async_temp_scope_, |
9510 try_block->try_index()); | 9549 try_block->try_index()); |
9511 async_code->Add( | 9550 async_code->Add( |
9512 new (Z) StoreLocalNode( | 9551 new (Z) StoreLocalNode( |
9513 Scanner::kNoSourcePos, | 9552 Scanner::kNoSourcePos, |
9514 saved_try_ctx, | 9553 saved_try_ctx, |
9515 new (Z) LoadLocalNode(Scanner::kNoSourcePos, | 9554 new (Z) LoadLocalNode(Scanner::kNoSourcePos, |
9516 async_saved_try_ctx))); | 9555 async_saved_try_ctx))); |
9517 } | 9556 } |
9518 } | 9557 } |
9519 SaveExceptionAndStacktrace(async_code, | 9558 SaveExceptionAndStacktrace(async_code, |
(...skipping 4660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14180 void Parser::SkipQualIdent() { | 14219 void Parser::SkipQualIdent() { |
14181 ASSERT(IsIdentifier()); | 14220 ASSERT(IsIdentifier()); |
14182 ConsumeToken(); | 14221 ConsumeToken(); |
14183 if (CurrentToken() == Token::kPERIOD) { | 14222 if (CurrentToken() == Token::kPERIOD) { |
14184 ConsumeToken(); // Consume the kPERIOD token. | 14223 ConsumeToken(); // Consume the kPERIOD token. |
14185 ExpectIdentifier("identifier expected after '.'"); | 14224 ExpectIdentifier("identifier expected after '.'"); |
14186 } | 14225 } |
14187 } | 14226 } |
14188 | 14227 |
14189 } // namespace dart | 14228 } // namespace dart |
OLD | NEW |