Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(444)

Side by Side Diff: runtime/vm/parser.cc

Issue 1409173002: More work for background compilation; move pending_functions_ from ObjectStore to Thread. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Better code. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/object_store.cc ('k') | runtime/vm/thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 trace_indent_(0) { 377 trace_indent_(0) {
378 ASSERT(tokens_iterator_.IsValid()); 378 ASSERT(tokens_iterator_.IsValid());
379 ASSERT(!current_function().IsNull()); 379 ASSERT(!current_function().IsNull());
380 EnsureExpressionTemp(); 380 EnsureExpressionTemp();
381 } 381 }
382 382
383 383
384 Parser::~Parser() { 384 Parser::~Parser() {
385 if (unregister_pending_function_) { 385 if (unregister_pending_function_) {
386 const GrowableObjectArray& pending_functions = 386 const GrowableObjectArray& pending_functions =
387 GrowableObjectArray::Handle(I->object_store()->pending_functions()); 387 GrowableObjectArray::Handle(T->pending_functions());
388 ASSERT(pending_functions.Length() > 0); 388 ASSERT(pending_functions.Length() > 0);
389 ASSERT(pending_functions.At(pending_functions.Length()-1) == 389 ASSERT(pending_functions.At(pending_functions.Length()-1) ==
390 current_function().raw()); 390 current_function().raw());
391 pending_functions.RemoveLast(); 391 pending_functions.RemoveLast();
392 } 392 }
393 } 393 }
394 394
395 395
396 // Each try in this function gets its own try index. 396 // Each try in this function gets its own try index.
397 // See definition of RawPcDescriptors::PcDescriptor. 397 // See definition of RawPcDescriptors::PcDescriptor.
(...skipping 2526 matching lines...) Expand 10 before | Expand all | Expand 10 after
2924 2924
2925 // Empty constructor body. 2925 // Empty constructor body.
2926 current_block_->statements->Add(new ReturnNode(Scanner::kNoSourcePos)); 2926 current_block_->statements->Add(new ReturnNode(Scanner::kNoSourcePos));
2927 SequenceNode* statements = CloseBlock(); 2927 SequenceNode* statements = CloseBlock();
2928 return statements; 2928 return statements;
2929 } 2929 }
2930 2930
2931 2931
2932 void Parser::CheckRecursiveInvocation() { 2932 void Parser::CheckRecursiveInvocation() {
2933 const GrowableObjectArray& pending_functions = 2933 const GrowableObjectArray& pending_functions =
2934 GrowableObjectArray::Handle(Z, 2934 GrowableObjectArray::Handle(Z, T->pending_functions());
2935 I->object_store()->pending_functions());
2936 for (int i = 0; i < pending_functions.Length(); i++) { 2935 for (int i = 0; i < pending_functions.Length(); i++) {
2937 if (pending_functions.At(i) == current_function().raw()) { 2936 if (pending_functions.At(i) == current_function().raw()) {
2938 const String& fname = 2937 const String& fname =
2939 String::Handle(Z, current_function().UserVisibleName()); 2938 String::Handle(Z, current_function().UserVisibleName());
2940 ReportError("circular dependency for function %s", fname.ToCString()); 2939 ReportError("circular dependency for function %s", fname.ToCString());
2941 } 2940 }
2942 } 2941 }
2943 ASSERT(!unregister_pending_function_); 2942 ASSERT(!unregister_pending_function_);
2944 pending_functions.Add(current_function()); 2943 pending_functions.Add(current_function());
2945 unregister_pending_function_ = true; 2944 unregister_pending_function_ = true;
(...skipping 11357 matching lines...) Expand 10 before | Expand all | Expand 10 after
14303 void Parser::SkipQualIdent() { 14302 void Parser::SkipQualIdent() {
14304 ASSERT(IsIdentifier()); 14303 ASSERT(IsIdentifier());
14305 ConsumeToken(); 14304 ConsumeToken();
14306 if (CurrentToken() == Token::kPERIOD) { 14305 if (CurrentToken() == Token::kPERIOD) {
14307 ConsumeToken(); // Consume the kPERIOD token. 14306 ConsumeToken(); // Consume the kPERIOD token.
14308 ExpectIdentifier("identifier expected after '.'"); 14307 ExpectIdentifier("identifier expected after '.'");
14309 } 14308 }
14310 } 14309 }
14311 14310
14312 } // namespace dart 14311 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object_store.cc ('k') | runtime/vm/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698