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

Unified Diff: runtime/vm/parser.cc

Issue 19287003: Use proper internal name for implicit static final getters. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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/parser.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 25052)
+++ runtime/vm/parser.cc (working copy)
@@ -766,8 +766,8 @@
ASSERT(!func.is_static());
node_sequence = parser.ParseInstanceSetter(func);
break;
- case RawFunction::kConstImplicitGetter:
- node_sequence = parser.ParseStaticConstGetter(func);
+ case RawFunction::kImplicitStaticFinalGetter:
+ node_sequence = parser.ParseStaticFinalGetter(func);
break;
case RawFunction::kMethodExtractor:
node_sequence = parser.ParseMethodExtractor(func);
@@ -878,11 +878,8 @@
}
-// TODO(regis): Since a const variable is implicitly final,
-// rename ParseStaticConstGetter to ParseStaticFinalGetter and
-// rename kConstImplicitGetter to kImplicitFinalGetter.
-SequenceNode* Parser::ParseStaticConstGetter(const Function& func) {
- TRACE_PARSER("ParseStaticConstGetter");
+SequenceNode* Parser::ParseStaticFinalGetter(const Function& func) {
+ TRACE_PARSER("ParseStaticFinalGetter");
ParamList params;
ASSERT(func.num_fixed_parameters() == 0); // static.
ASSERT(!func.HasOptionalParameters());
@@ -1582,7 +1579,7 @@
const String& getter_name = String::ZoneHandle(Field::GetterName(name));
super_func = Resolver::ResolveDynamicAnyArgs(super_class, getter_name);
ASSERT(super_func.IsNull() ||
- (super_func.kind() != RawFunction::kConstImplicitGetter));
+ (super_func.kind() != RawFunction::kImplicitStaticFinalGetter));
}
if (super_func.IsNull()) {
super_func =
@@ -3139,13 +3136,13 @@
ConsumeToken();
init_value = Object::sentinel().raw();
// For static const fields, the initialization expression
- // will be parsed through the kConstImplicitGetter method
+ // will be parsed through the kImplicitStaticFinalGetter method
// invocation/compilation.
// For instance fields, the expression is parsed when a constructor
// is compiled.
// For static const fields with very simple initializer expressions
// (e.g. a literal number or string) we optimize away the
- // kConstImplicitGetter and initialize the field here.
+ // kImplicitStaticFinalGetter and initialize the field here.
// We also do it for static final non-const fields, but only in production
// mode.
@@ -3180,14 +3177,14 @@
library_.AddFieldMetadata(class_field, field->metadata_pos);
}
- // For static const fields, set value to "uninitialized" and
- // create a kConstImplicitGetter getter method.
+ // For static final fields (this includes static const fields), set value to
+ // "uninitialized" and create a kFinalImplicitGetter getter method.
if (field->has_static && has_initializer) {
class_field.set_value(init_value);
if (!has_simple_literal) {
String& getter_name = String::Handle(Field::GetterSymbol(*field->name));
getter = Function::New(getter_name,
- RawFunction::kConstImplicitGetter,
+ RawFunction::kImplicitStaticFinalGetter,
field->has_static,
field->has_const,
/* is_abstract = */ false,
@@ -4305,7 +4302,7 @@
// Create a static const getter.
String& getter_name = String::ZoneHandle(Field::GetterSymbol(var_name));
getter = Function::New(getter_name,
- RawFunction::kConstImplicitGetter,
+ RawFunction::kImplicitStaticFinalGetter,
is_static,
is_const,
/* is_abstract = */ false,
@@ -7641,7 +7638,7 @@
Object::empty_array(),
Resolver::kIsQualified);
if (!func.IsNull()) {
- ASSERT(func.kind() != RawFunction::kConstImplicitGetter);
+ ASSERT(func.kind() != RawFunction::kImplicitStaticFinalGetter);
EnsureSavedCurrentContext();
closure = new StaticGetterNode(call_pos,
NULL,
@@ -7723,7 +7720,7 @@
if (getter.IsNull()) {
return new LoadStaticFieldNode(ident_pos, Field::ZoneHandle(field.raw()));
} else {
- ASSERT(getter.kind() == RawFunction::kConstImplicitGetter);
+ ASSERT(getter.kind() == RawFunction::kImplicitStaticFinalGetter);
return new StaticGetterNode(ident_pos,
NULL, // Receiver.
false, // is_super_getter.
@@ -7808,7 +7805,7 @@
}
access = CreateImplicitClosureNode(func, call_pos, NULL);
} else {
- ASSERT(func.kind() != RawFunction::kConstImplicitGetter);
+ ASSERT(func.kind() != RawFunction::kImplicitStaticFinalGetter);
access = new StaticGetterNode(call_pos,
NULL,
false,
@@ -8371,7 +8368,7 @@
Object::empty_array(),
Resolver::kIsQualified));
ASSERT(!func.IsNull());
- ASSERT(func.kind() == RawFunction::kConstImplicitGetter);
+ ASSERT(func.kind() == RawFunction::kImplicitStaticFinalGetter);
Object& const_value = Object::Handle(
DartEntry::InvokeFunction(func, Object::empty_array()));
if (const_value.IsError()) {
@@ -8405,7 +8402,8 @@
field_name);
}
}
- if (getter.IsNull() || (getter.kind() == RawFunction::kConstImplicitGetter)) {
+ if (getter.IsNull() ||
+ (getter.kind() == RawFunction::kImplicitStaticFinalGetter)) {
return NULL;
}
ASSERT(getter.kind() == RawFunction::kImplicitGetter);
« no previous file with comments | « runtime/vm/parser.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698