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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1584223006: Remove signature classes from the VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 11 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/debugger.cc » ('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 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));
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698