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

Unified Diff: runtime/vm/scopes.cc

Issue 190753004: - Ensure that all names in local scopes are symbols. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/scopes.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scopes.cc
===================================================================
--- runtime/vm/scopes.cc (revision 33439)
+++ runtime/vm/scopes.cc (working copy)
@@ -81,9 +81,10 @@
NameReference* LocalScope::FindReference(const String& name) const {
+ ASSERT(name.IsSymbol());
intptr_t num_references = referenced_.length();
for (intptr_t i = 0; i < num_references; i++) {
- if (name.Equals(referenced_[i]->name())) {
+ if (name.raw() == referenced_[i]->name().raw()) {
return referenced_[i];
}
}
@@ -300,7 +301,7 @@
desc.info.end_pos = var->owner()->end_token_pos();
desc.info.index = var->index();
vars->Add(desc);
- } else if (var->name().Equals(Symbols::SavedEntryContextVar())) {
+ } else if (var->name().raw() == Symbols::SavedEntryContextVar().raw()) {
// This is the local variable in which the function saves the
// caller's chain of closure contexts (caller's CTX register).
VarDesc desc;
@@ -311,7 +312,7 @@
desc.info.end_pos = 0;
desc.info.index = var->index();
vars->Add(desc);
- } else if (var->name().Equals(Symbols::SavedCurrentContextVar())) {
+ } else if (var->name().raw() == Symbols::SavedCurrentContextVar().raw()) {
// This is the local variable in which the function saves its
// own context before calling a closure function.
VarDesc desc;
@@ -334,9 +335,10 @@
SourceLabel* LocalScope::LocalLookupLabel(const String& name) const {
+ ASSERT(name.IsSymbol());
for (intptr_t i = 0; i < labels_.length(); i++) {
SourceLabel* label = labels_[i];
- if (label->name().Equals(name)) {
+ if (label->name().raw() == name.raw()) {
return label;
}
}
« no previous file with comments | « runtime/vm/scopes.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698