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

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
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 10086)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -2753,8 +2753,7 @@
ASSERT(func_kind == RawFunction::kRegularFunction ||
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());
@@ -2795,7 +2794,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);
}
@@ -2843,13 +2842,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);
}
@@ -2865,13 +2858,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698