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

Side by Side Diff: vm/scopes.cc

Issue 10808111: Move more symbols to the vm isolate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 4 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 | « vm/scanner.cc ('k') | vm/symbols.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/scopes.h" 5 #include "vm/scopes.h"
6 6
7 #include "vm/ast.h" 7 #include "vm/ast.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/parser.h" 10 #include "vm/parser.h"
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 505
506 506
507 RawContextScope* LocalScope::CreateImplicitClosureScope(const Function& func) { 507 RawContextScope* LocalScope::CreateImplicitClosureScope(const Function& func) {
508 static const intptr_t kNumCapturedVars = 1; 508 static const intptr_t kNumCapturedVars = 1;
509 509
510 // Create a ContextScope with space for kNumCapturedVars descriptors. 510 // Create a ContextScope with space for kNumCapturedVars descriptors.
511 const ContextScope& context_scope = 511 const ContextScope& context_scope =
512 ContextScope::Handle(ContextScope::New(kNumCapturedVars)); 512 ContextScope::Handle(ContextScope::New(kNumCapturedVars));
513 513
514 // Create a descriptor for 'this' variable. 514 // Create a descriptor for 'this' variable.
515 const String& name = String::Handle(Symbols::New("this")); 515 const String& name = String::Handle(Symbols::This());
516 context_scope.SetTokenIndexAt(0, func.token_pos()); 516 context_scope.SetTokenIndexAt(0, func.token_pos());
517 context_scope.SetNameAt(0, name); 517 context_scope.SetNameAt(0, name);
518 context_scope.SetIsFinalAt(0, true); 518 context_scope.SetIsFinalAt(0, true);
519 const AbstractType& type = AbstractType::Handle(func.ParameterTypeAt(0)); 519 const AbstractType& type = AbstractType::Handle(func.ParameterTypeAt(0));
520 context_scope.SetTypeAt(0, type); 520 context_scope.SetTypeAt(0, type);
521 context_scope.SetContextIndexAt(0, 0); 521 context_scope.SetContextIndexAt(0, 0);
522 context_scope.SetContextLevelAt(0, 0); 522 context_scope.SetContextLevelAt(0, 0);
523 ASSERT(context_scope.num_variables() == kNumCapturedVars); // Verify count. 523 ASSERT(context_scope.num_variables() == kNumCapturedVars); // Verify count.
524 return context_scope.raw(); 524 return context_scope.raw();
525 } 525 }
(...skipping 26 matching lines...) Expand all
552 } else { 552 } else {
553 // Shift negative indexes so that the lowest one is 0 (they are still 553 // Shift negative indexes so that the lowest one is 0 (they are still
554 // non-positive) and index them backward from the end of the vector. 554 // non-positive) and index them backward from the end of the vector.
555 return (var_count - 1) + 555 return (var_count - 1) +
556 (index() - ParsedFunction::kFirstLocalSlotIndex); 556 (index() - ParsedFunction::kFirstLocalSlotIndex);
557 } 557 }
558 } 558 }
559 559
560 560
561 } // namespace dart 561 } // namespace dart
OLDNEW
« no previous file with comments | « vm/scanner.cc ('k') | vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698