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

Unified Diff: vm/parser.cc

Issue 11519006: Add read only handles for the following predefined symbols (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« vm/ast.h ('K') | « vm/object.cc ('k') | vm/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/parser.cc
===================================================================
--- vm/parser.cc (revision 15920)
+++ vm/parser.cc (working copy)
@@ -435,7 +435,7 @@
}
void AddFinalParameter(intptr_t name_pos,
- String* name,
+ const String* name,
const AbstractType* type) {
this->num_fixed_parameters++;
ParamDesc param;
@@ -449,7 +449,7 @@
void AddReceiver(const Type* receiver_type) {
ASSERT(this->parameters->is_empty());
AddFinalParameter(receiver_type->token_pos(),
- &String::ZoneHandle(Symbols::This()),
+ &Symbols::ThisHandle(),
receiver_type);
}
@@ -1897,7 +1897,7 @@
const Class& cls = Class::Handle(func.Owner());
LocalVariable* receiver = new LocalVariable(
ctor_pos,
- String::ZoneHandle(Symbols::This()),
+ Symbols::ThisHandle(),
Type::ZoneHandle(Type::DynamicType()));
current_block_->scope->AddVariable(receiver);
@@ -4532,8 +4532,7 @@
LocalVariable* Parser::LookupReceiver(LocalScope* from_scope, bool test_only) {
ASSERT(!current_function().is_static());
- const String& this_name = String::Handle(Symbols::This());
- return from_scope->LookupVariable(this_name, test_only);
+ return from_scope->LookupVariable(Symbols::ThisHandle(), test_only);
}
@@ -7691,7 +7690,7 @@
if (current_block_ == NULL) {
return false;
}
- if (ident.Equals(String::Handle(Symbols::This()))) {
+ if (ident.Equals(Symbols::ThisHandle())) {
// 'this' is not a formal parameter.
return false;
}
@@ -9306,8 +9305,7 @@
}
ASSERT(primary != NULL);
} else if (CurrentToken() == Token::kTHIS) {
- const String& this_name = String::Handle(Symbols::This());
- LocalVariable* local = LookupLocalScope(this_name);
+ LocalVariable* local = LookupLocalScope(Symbols::ThisHandle());
if (local == NULL) {
ErrorMsg("receiver 'this' is not in scope");
}
« vm/ast.h ('K') | « vm/object.cc ('k') | vm/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698