Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index 040f302473750a83b71330764fd9cd1d3306bf79..d316138f93480972c01f8e758d06017b63ab859e 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -107,7 +107,7 @@ class FunctionVisitor : public ObjectVisitor { |
// Verify that the result type of a function is canonical or a |
// TypeParameter. |
typeHandle_ ^= funcHandle_.result_type(); |
- ASSERT(typeHandle_.IsNull() || |
+ ASSERT(typeHandle_.IsMalformed() || |
!typeHandle_.IsResolved() || |
typeHandle_.IsTypeParameter() || |
typeHandle_.IsCanonical()); |
@@ -116,8 +116,9 @@ class FunctionVisitor : public ObjectVisitor { |
const intptr_t num_parameters = funcHandle_.NumParameters(); |
for (intptr_t i = 0; i < num_parameters; i++) { |
typeHandle_ = funcHandle_.ParameterTypeAt(i); |
- ASSERT(typeHandle_.IsTypeParameter() || |
+ ASSERT(typeHandle_.IsMalformed() || |
!typeHandle_.IsResolved() || |
+ typeHandle_.IsTypeParameter() || |
typeHandle_.IsCanonical()); |
} |
} |
@@ -1854,14 +1855,7 @@ DART_EXPORT bool Dart_IsTypeVariable(Dart_Handle handle) { |
DART_EXPORT bool Dart_IsClosure(Dart_Handle object) { |
- // We can't use a fast class index check here because there are many |
- // different signature classes for closures. |
- Thread* thread = Thread::Current(); |
- CHECK_ISOLATE(thread->isolate()); |
- ReusableObjectHandleScope reused_obj_handle(thread); |
- const Instance& closure_obj = |
- Api::UnwrapInstanceHandle(reused_obj_handle, object); |
- return (!closure_obj.IsNull() && closure_obj.IsClosure()); |
+ return Api::ClassId(object) == kClosureCid; |
} |
@@ -1913,7 +1907,8 @@ DART_EXPORT Dart_Handle Dart_InstanceGetType(Dart_Handle instance) { |
if (!obj.IsInstance()) { |
RETURN_TYPE_ERROR(Z, instance, Instance); |
} |
- const Type& type = Type::Handle(Instance::Cast(obj).GetType()); |
+ const AbstractType& type = |
+ AbstractType::Handle(Instance::Cast(obj).GetType()); |
return Api::NewHandle(T, type.Canonicalize()); |
} |
@@ -3884,7 +3879,7 @@ DART_EXPORT Dart_Handle Dart_InvokeConstructor(Dart_Handle object, |
// Construct name of the constructor to invoke. |
const String& constructor_name = Api::UnwrapStringHandle(Z, name); |
- const Type& type_obj = Type::Handle(Z, instance.GetType()); |
+ const AbstractType& type_obj = AbstractType::Handle(Z, instance.GetType()); |
const Class& cls = Class::Handle(Z, type_obj.type_class()); |
const String& class_name = String::Handle(Z, cls.Name()); |
const Array& strings = Array::Handle(Z, Array::New(3)); |