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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 23633002: Implementation for ClosureMirror.findInContext. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Aaaaaaaaaand one more round of comments Created 7 years, 3 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/bootstrap_natives.h ('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
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 0e48c5e3a3f2f47a00ccf4eba5011694edf91bbf..7a6bc66e459c5dae110e3b86c3551fb1f41a4c0f 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -3116,18 +3116,6 @@ DART_EXPORT Dart_Handle Dart_InvokeClosure(Dart_Handle closure,
}
-static bool FieldIsUninitialized(Isolate* isolate, const Field& fld) {
- ASSERT(!fld.IsNull());
-
- // Return getter method for uninitialized fields, rather than the
- // field object, since the value in the field object will not be
- // initialized until the first time the getter is invoked.
- const Instance& value = Instance::Handle(isolate, fld.value());
- ASSERT(value.raw() != Object::transition_sentinel().raw());
- return value.raw() == Object::sentinel().raw();
-}
-
-
DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
@@ -3156,7 +3144,7 @@ DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name) {
Class& cls = Class::Handle(isolate, Type::Cast(obj).type_class());
field = cls.LookupStaticField(field_name);
- if (field.IsNull() || FieldIsUninitialized(isolate, field)) {
+ if (field.IsNull() || field.IsUninitialized()) {
const String& getter_name =
String::Handle(isolate, Field::GetterName(field_name));
getter = cls.LookupStaticFunctionAllowPrivate(getter_name);
@@ -3215,7 +3203,7 @@ DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name) {
const String& getter_name =
String::Handle(isolate, Field::GetterName(field_name));
getter = lib.LookupFunctionAllowPrivate(getter_name);
- } else if (!field.IsNull() && FieldIsUninitialized(isolate, field)) {
+ } else if (!field.IsNull() && field.IsUninitialized()) {
// A field was found. Check for a getter in the field's owner classs.
const Class& cls = Class::Handle(isolate, field.owner());
const String& getter_name =
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698