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

Side by Side Diff: vm/scopes.cc

Issue 8919025: Added type propagation from store to load locals, but only within a sequence node (not across bas... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years 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/scopes.h ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/object.h" 8 #include "vm/object.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 context_scope.SetNameAt(0, name); 403 context_scope.SetNameAt(0, name);
404 context_scope.SetIsFinalAt(0, true); 404 context_scope.SetIsFinalAt(0, true);
405 const AbstractType& type = AbstractType::Handle(func.ParameterTypeAt(0)); 405 const AbstractType& type = AbstractType::Handle(func.ParameterTypeAt(0));
406 context_scope.SetTypeAt(0, type); 406 context_scope.SetTypeAt(0, type);
407 context_scope.SetContextIndexAt(0, 0); 407 context_scope.SetContextIndexAt(0, 0);
408 context_scope.SetContextLevelAt(0, 0); 408 context_scope.SetContextLevelAt(0, 0);
409 ASSERT(context_scope.num_variables() == kNumCapturedVars); // Verify count. 409 ASSERT(context_scope.num_variables() == kNumCapturedVars); // Verify count.
410 return context_scope.raw(); 410 return context_scope.raw();
411 } 411 }
412 412
413
414 bool LocalVariable::Equals(const LocalVariable& other) const {
415 if (HasIndex() && other.HasIndex() && (index() == other.index())) {
416 if (is_captured() == other.is_captured()) {
417 if (!is_captured()) {
418 return true;
419 }
420 if (owner()->context_level() == other.owner()->context_level()) {
421 return true;
422 }
423 }
424 }
425 return false;
426 }
427
413 } // namespace dart 428 } // namespace dart
OLDNEW
« no previous file with comments | « vm/scopes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698