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

Unified Diff: vm/code_generator.cc

Issue 10828213: Don't hard-code getter prefix in code_generator.cc. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/code_generator.cc
===================================================================
--- vm/code_generator.cc (revision 10446)
+++ vm/code_generator.cc (working copy)
@@ -989,9 +989,8 @@
const Instance& receiver = Instance::CheckedHandle(arguments.At(0));
const ICData& ic_data = ICData::CheckedHandle(arguments.At(1));
const String& original_function_name = String::Handle(ic_data.target_name());
- const String& getter_prefix = String::Handle(String::New("get:"));
Closure& closure = Closure::Handle();
- if (!original_function_name.StartsWith(getter_prefix)) {
+ if (!Field::IsGetterName(original_function_name)) {
// This is not a getter so can't be the case where we are trying to
// create an implicit closure of an instance function.
arguments.SetReturn(closure);
@@ -1000,7 +999,7 @@
const Class& receiver_class = Class::Handle(receiver.clazz());
ASSERT(!receiver_class.IsNull());
String& func_name = String::Handle();
- func_name = String::SubString(original_function_name, getter_prefix.Length());
+ func_name = Field::NameFromGetter(original_function_name);
func_name = Symbols::New(func_name);
const Function& function = Function::Handle(
LookupDynamicFunction(isolate, receiver_class, func_name));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698