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

Unified Diff: runtime/vm/mirrors_api_impl.cc

Issue 19030004: Stop resolving classes prematurely in the vm (issue 11023). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/class_finalizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/mirrors_api_impl.cc
===================================================================
--- runtime/vm/mirrors_api_impl.cc (revision 24964)
+++ runtime/vm/mirrors_api_impl.cc (working copy)
@@ -182,6 +182,11 @@
if (!obj.IsType() && !obj.IsClass()) {
RETURN_TYPE_ERROR(isolate, object, Class/Type);
}
+ // Ensure all classes are finalized.
+ Dart_Handle state = Api::CheckIsolateState(isolate);
+ if (::Dart_IsError(state)) {
+ return state;
+ }
const Class& cls = (obj.IsType()) ?
Class::Handle(Type::Cast(obj).type_class()) : Class::Cast(obj);
// A class represents a function type when it is a canonical
@@ -500,7 +505,11 @@
if (func.IsNull()) {
RETURN_TYPE_ERROR(isolate, function, Function);
}
-
+ // Ensure all classes are finalized.
+ Dart_Handle state = Api::CheckIsolateState(isolate);
+ if (::Dart_IsError(state)) {
+ return state;
+ }
if (func.kind() == RawFunction::kConstructor) {
// Special case the return type for constructors. Inside the vm
// we mark them as returning dynamic, but for the purposes of
@@ -555,7 +564,11 @@
if (func.IsNull()) {
RETURN_TYPE_ERROR(isolate, function, Function);
}
-
+ // Ensure all classes are finalized.
+ Dart_Handle state = Api::CheckIsolateState(isolate);
+ if (::Dart_IsError(state)) {
+ return state;
+ }
const intptr_t num_implicit_params = func.NumImplicitParameters();
const intptr_t num_params = func.NumParameters() - num_implicit_params;
if (parameter_index < 0 || parameter_index >= num_params) {
@@ -709,7 +722,11 @@
if (var.IsNull()) {
RETURN_TYPE_ERROR(isolate, variable, Field);
}
-
+ // Ensure all classes are finalized.
+ Dart_Handle state = Api::CheckIsolateState(isolate);
+ if (::Dart_IsError(state)) {
+ return state;
+ }
const AbstractType& type = AbstractType::Handle(isolate, var.type());
return TypeToHandle(isolate, "Dart_VariableType", type);
}
@@ -722,6 +739,11 @@
if (!obj.IsType() && !obj.IsClass()) {
RETURN_TYPE_ERROR(isolate, object, Class/Type);
}
+ // Ensure all classes are finalized.
+ Dart_Handle state = Api::CheckIsolateState(isolate);
+ if (::Dart_IsError(state)) {
+ return state;
+ }
const Class& cls = (obj.IsType()) ?
Class::Handle(Type::Cast(obj).type_class()) : Class::Cast(obj);
const intptr_t num_type_params = cls.NumTypeParameters();
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698