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

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

Issue 299263005: More reduction of accessing TLS by caching/passing isolate value. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | 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/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 5277 matching lines...) Expand 10 before | Expand all | Expand 10 after
5288 outer_scope->function_level(), 5288 outer_scope->function_level(),
5289 outer_scope->loop_level() + 1)); 5289 outer_scope->loop_level() + 1));
5290 } 5290 }
5291 5291
5292 5292
5293 void Parser::OpenFunctionBlock(const Function& func) { 5293 void Parser::OpenFunctionBlock(const Function& func) {
5294 LocalScope* outer_scope; 5294 LocalScope* outer_scope;
5295 if (current_block_ == NULL) { 5295 if (current_block_ == NULL) {
5296 if (!func.IsLocalFunction()) { 5296 if (!func.IsLocalFunction()) {
5297 // We are compiling a non-nested function. 5297 // We are compiling a non-nested function.
5298 outer_scope = new LocalScope(NULL, 0, 0); 5298 outer_scope = new(isolate()) LocalScope(NULL, 0, 0);
5299 } else { 5299 } else {
5300 // We are compiling the function of an invoked closure. 5300 // We are compiling the function of an invoked closure.
5301 // Restore the outer scope containing all captured variables. 5301 // Restore the outer scope containing all captured variables.
5302 const ContextScope& context_scope = 5302 const ContextScope& context_scope =
5303 ContextScope::Handle(func.context_scope()); 5303 ContextScope::Handle(isolate(), func.context_scope());
5304 ASSERT(!context_scope.IsNull()); 5304 ASSERT(!context_scope.IsNull());
5305 outer_scope = 5305 outer_scope = new(isolate()) LocalScope(
5306 new LocalScope(LocalScope::RestoreOuterScope(context_scope), 0, 0); 5306 LocalScope::RestoreOuterScope(context_scope), 0, 0);
5307 } 5307 }
5308 } else { 5308 } else {
5309 // We are parsing a nested function while compiling the enclosing function. 5309 // We are parsing a nested function while compiling the enclosing function.
5310 outer_scope = new LocalScope(current_block_->scope, 5310 outer_scope =
5311 current_block_->scope->function_level() + 1, 5311 new(isolate()) LocalScope(current_block_->scope,
5312 0); 5312 current_block_->scope->function_level() + 1,
5313 0);
5313 } 5314 }
5314 ChainNewBlock(outer_scope); 5315 ChainNewBlock(outer_scope);
5315 } 5316 }
5316 5317
5317 5318
5318 SequenceNode* Parser::CloseBlock() { 5319 SequenceNode* Parser::CloseBlock() {
5319 SequenceNode* statements = current_block_->statements; 5320 SequenceNode* statements = current_block_->statements;
5320 if (current_block_->scope != NULL) { 5321 if (current_block_->scope != NULL) {
5321 // Record the begin and end token index of the scope. 5322 // Record the begin and end token index of the scope.
5322 ASSERT(statements != NULL); 5323 ASSERT(statements != NULL);
(...skipping 5633 matching lines...) Expand 10 before | Expand all | Expand 10 after
10956 void Parser::SkipQualIdent() { 10957 void Parser::SkipQualIdent() {
10957 ASSERT(IsIdentifier()); 10958 ASSERT(IsIdentifier());
10958 ConsumeToken(); 10959 ConsumeToken();
10959 if (CurrentToken() == Token::kPERIOD) { 10960 if (CurrentToken() == Token::kPERIOD) {
10960 ConsumeToken(); // Consume the kPERIOD token. 10961 ConsumeToken(); // Consume the kPERIOD token.
10961 ExpectIdentifier("identifier expected after '.'"); 10962 ExpectIdentifier("identifier expected after '.'");
10962 } 10963 }
10963 } 10964 }
10964 10965
10965 } // namespace dart 10966 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698