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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 10796004: Consolidate a few fields in RawFunction using bitfields. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 9727)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -2734,8 +2734,7 @@
ASSERT(func_kind == RawFunction::kFunction ||
func_kind == RawFunction::kGetterFunction ||
func_kind == RawFunction::kSetterFunction ||
- func_kind == RawFunction::kConstructor ||
- func_kind == RawFunction::kAbstract);
+ func_kind == RawFunction::kConstructor);
}
#endif
return Api::NewHandle(isolate, func.raw());
@@ -2776,7 +2775,7 @@
if (func.IsNull()) {
RETURN_TYPE_ERROR(isolate, function, Function);
}
- *is_abstract = (func.kind() == RawFunction::kAbstract);
+ *is_abstract = func.is_abstract();
return Api::Success(isolate);
}
@@ -2824,13 +2823,7 @@
if (func.IsNull()) {
RETURN_TYPE_ERROR(isolate, function, Function);
}
- // TODO(turnidge): It would be nice if I could just use func.kind()
- // to check for a getter function here, but unfortunately the only
- // way to distinguish abstract getter functions is to use the name
- // itself. Consider adding a RawFunction::kAbstractGetter type.
- const String& func_name = String::Handle(isolate, func.name());
- *is_getter = Field::IsGetterName(func_name);
-
+ *is_getter = (func.kind() == RawFunction::kGetterFunction);
return Api::Success(isolate);
}
@@ -2846,13 +2839,7 @@
if (func.IsNull()) {
RETURN_TYPE_ERROR(isolate, function, Function);
}
- // TODO(turnidge): It would be nice if I could just use func.kind()
- // to check for a setter function here, but unfortunately the only
- // way to distinguish abstract setter functions is to use the name
- // itself. Consider adding a RawFunction::kAbstractSetter type.
- const String& func_name = String::Handle(isolate, func.name());
- *is_setter = Field::IsSetterName(func_name);
-
+ *is_setter = (func.kind() == RawFunction::kSetterFunction);
return Api::Success(isolate);
}
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/object.h » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698