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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 1393373003: Remove isolate argument from handle allocation: Part I (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cleanups Created 5 years, 2 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/benchmark_test.cc ('k') | runtime/vm/class_finalizer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 763885088a074a9b5c0524838a6f8f84ad8bbf10..4d8178bc67252b9b224a18cdf367afe97f9fda3c 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -120,7 +120,8 @@ bool ClassFinalizer::ProcessPendingClasses() {
ASSERT(isolate != NULL);
HANDLESCOPE(thread);
ObjectStore* object_store = isolate->object_store();
- const Error& error = Error::Handle(isolate, object_store->sticky_error());
+ const Error& error =
+ Error::Handle(thread->zone(), object_store->sticky_error());
if (!error.IsNull()) {
return false;
}
@@ -562,15 +563,15 @@ void ClassFinalizer::FinalizeTypeParameters(
void ClassFinalizer::CheckRecursiveType(const Class& cls,
const Type& type,
PendingTypes* pending_types) {
- Isolate* isolate = Isolate::Current();
+ Zone* zone = Thread::Current()->zone();
if (FLAG_trace_type_finalization) {
THR_Print("Checking recursive type '%s': %s\n",
String::Handle(type.Name()).ToCString(),
type.ToCString());
}
- const Class& type_cls = Class::Handle(isolate, type.type_class());
+ const Class& type_cls = Class::Handle(zone, type.type_class());
const TypeArguments& arguments =
- TypeArguments::Handle(isolate, type.arguments());
+ TypeArguments::Handle(zone, type.arguments());
// A type can only be recursive via its type arguments.
ASSERT(!arguments.IsNull());
const intptr_t num_type_args = arguments.Length();
@@ -589,7 +590,7 @@ void ClassFinalizer::CheckRecursiveType(const Class& cls,
// The type parameters are not instantiated. Verify that there is no other
// type pending finalization with the same type class, but different
// uninstantiated type parameters.
- TypeArguments& pending_arguments = TypeArguments::Handle(isolate);
+ TypeArguments& pending_arguments = TypeArguments::Handle(zone);
const intptr_t num_pending_types = pending_types->length();
for (intptr_t i = num_pending_types - 1; i >= 0; i--) {
const Type& pending_type = Type::Cast(pending_types->At(i));
@@ -607,7 +608,7 @@ void ClassFinalizer::CheckRecursiveType(const Class& cls,
!pending_arguments.IsSubvectorInstantiated(first_type_param,
num_type_params)) {
// Reject the non-contractive recursive type.
- const String& type_name = String::Handle(isolate, type.Name());
+ const String& type_name = String::Handle(zone, type.Name());
ReportError(cls, type.token_pos(),
"illegal recursive type '%s'", type_name.ToCString());
}
@@ -1573,14 +1574,15 @@ void ClassFinalizer::ResolveAndFinalizeMemberTypes(const Class& cls) {
// bound BT on T of M is applied to T of S&M. See comments below.
void ClassFinalizer::CloneMixinAppTypeParameters(const Class& mixin_app_class) {
ASSERT(mixin_app_class.type_parameters() == TypeArguments::null());
- Isolate* isolate = Isolate::Current();
- const AbstractType& super_type = AbstractType::Handle(isolate,
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
+ const AbstractType& super_type = AbstractType::Handle(zone,
mixin_app_class.super_type());
ASSERT(super_type.IsResolved());
- const Class& super_class = Class::Handle(isolate, super_type.type_class());
+ const Class& super_class = Class::Handle(zone, super_type.type_class());
const intptr_t num_super_type_params = super_class.NumTypeParameters();
- const Type& mixin_type = Type::Handle(isolate, mixin_app_class.mixin());
- const Class& mixin_class = Class::Handle(isolate, mixin_type.type_class());
+ const Type& mixin_type = Type::Handle(zone, mixin_app_class.mixin());
+ const Class& mixin_class = Class::Handle(zone, mixin_type.type_class());
const intptr_t num_mixin_type_params = mixin_class.NumTypeParameters();
// The mixin type (in raw form) should have been added to the interfaces
@@ -1593,14 +1595,14 @@ void ClassFinalizer::CloneMixinAppTypeParameters(const Class& mixin_app_class) {
// If both the super type and the mixin type are non generic, the mixin
// application class is non generic as well and we can skip type parameter
// cloning.
- TypeArguments& instantiator = TypeArguments::Handle(isolate);
+ TypeArguments& instantiator = TypeArguments::Handle(zone);
if ((num_super_type_params + num_mixin_type_params) > 0) {
// If the last ampersand in the name of the mixin application class is
// doubled, the same type parameters can propagate the type arguments to
// the super type and to the mixin type.
bool share_type_params = false;
if (num_super_type_params == num_mixin_type_params) {
- const String& name = String::Handle(isolate, mixin_app_class.Name());
+ const String& name = String::Handle(zone, mixin_app_class.Name());
for (intptr_t i = name.Length() - 1; i > 0; --i) {
if (name.CharAt(i) == '&') {
if (name.CharAt(i - 1) == '&') {
@@ -1611,13 +1613,13 @@ void ClassFinalizer::CloneMixinAppTypeParameters(const Class& mixin_app_class) {
}
}
- const TypeArguments& cloned_type_params = TypeArguments::Handle(isolate,
+ const TypeArguments& cloned_type_params = TypeArguments::Handle(zone,
TypeArguments::New((share_type_params ? 0 : num_super_type_params) +
num_mixin_type_params));
- TypeParameter& param = TypeParameter::Handle(isolate);
- TypeParameter& cloned_param = TypeParameter::Handle(isolate);
- String& param_name = String::Handle(isolate);
- AbstractType& param_bound = AbstractType::Handle(isolate);
+ TypeParameter& param = TypeParameter::Handle(zone);
+ TypeParameter& cloned_param = TypeParameter::Handle(zone);
+ String& param_name = String::Handle(zone);
+ AbstractType& param_bound = AbstractType::Handle(zone);
intptr_t cloned_index = 0;
// First, clone the super class type parameters. Rename them so that
@@ -1625,8 +1627,8 @@ void ClassFinalizer::CloneMixinAppTypeParameters(const Class& mixin_app_class) {
// class and the mixin class.
if (!share_type_params && (num_super_type_params > 0)) {
const TypeArguments& super_type_params =
- TypeArguments::Handle(isolate, super_class.type_parameters());
- const TypeArguments& super_type_args = TypeArguments::Handle(isolate,
+ TypeArguments::Handle(zone, super_class.type_parameters());
+ const TypeArguments& super_type_args = TypeArguments::Handle(zone,
TypeArguments::New(num_super_type_params));
// The cloned super class type parameters do not need to repeat their
// bounds, since the bound checks will be performed at the super class
@@ -1636,7 +1638,7 @@ void ClassFinalizer::CloneMixinAppTypeParameters(const Class& mixin_app_class) {
// the super class of its mixin. Note also that the other mixin
// application will only mixin the last mixin type listed in the first
// mixin application it is mixing in.
- param_bound = isolate->object_store()->object_type();
+ param_bound = thread->isolate()->object_store()->object_type();
for (intptr_t i = 0; i < num_super_type_params; i++) {
param ^= super_type_params.TypeAt(i);
param_name = param.name();
@@ -1665,10 +1667,10 @@ void ClassFinalizer::CloneMixinAppTypeParameters(const Class& mixin_app_class) {
// with that name. We also retain the type parameter bounds.
if (num_mixin_type_params > 0) {
const TypeArguments& mixin_params =
- TypeArguments::Handle(isolate, mixin_class.type_parameters());
+ TypeArguments::Handle(zone, mixin_class.type_parameters());
const intptr_t offset =
mixin_class.NumTypeArguments() - mixin_class.NumTypeParameters();
- const TypeArguments& mixin_type_args = TypeArguments::Handle(isolate,
+ const TypeArguments& mixin_type_args = TypeArguments::Handle(zone,
TypeArguments::New(num_mixin_type_params));
instantiator ^= TypeArguments::New(offset + num_mixin_type_params);
bool has_uninstantiated_bounds = false;
@@ -1700,7 +1702,7 @@ void ClassFinalizer::CloneMixinAppTypeParameters(const Class& mixin_app_class) {
// is not a problem since they will get finalized shortly as the mixin
// application class gets finalized.
if (has_uninstantiated_bounds) {
- Error& bound_error = Error::Handle(isolate);
+ Error& bound_error = Error::Handle(zone);
for (intptr_t i = 0; i < num_mixin_type_params; i++) {
param ^= mixin_type_args.TypeAt(i);
param_bound = param.bound();
@@ -1821,13 +1823,13 @@ void ClassFinalizer::ApplyMixinAppAlias(const Class& mixin_app_class,
// If this mixin alias is aliasing another mixin alias, another class
// will be inserted via recursion. No need to check here.
// The mixin type may or may not be finalized yet.
- Isolate* isolate = Isolate::Current();
- AbstractType& super_type = AbstractType::Handle(isolate,
+ Zone* zone = Thread::Current()->zone();
+ AbstractType& super_type = AbstractType::Handle(zone,
mixin_app_class.super_type());
- const Type& mixin_type = Type::Handle(isolate, mixin_app_class.mixin());
- const Class& mixin_class = Class::Handle(isolate, mixin_type.type_class());
+ const Type& mixin_type = Type::Handle(zone, mixin_app_class.mixin());
+ const Class& mixin_class = Class::Handle(zone, mixin_type.type_class());
ASSERT(mixin_class.is_mixin_app_alias());
- const Class& aliased_mixin_app_class = Class::Handle(isolate,
+ const Class& aliased_mixin_app_class = Class::Handle(zone,
mixin_class.SuperClass());
// Note that the super class of aliased_mixin_app_class can itself be a
// mixin application class (this happens if the alias is mixing more than one
@@ -1835,19 +1837,19 @@ void ClassFinalizer::ApplyMixinAppAlias(const Class& mixin_app_class,
// super class of this inserted class, we apply the composition rules of the
// spec and only mixin the members of aliased_mixin_app_class, not those of
// its super class. In other words, we only mixin the last mixin of the alias.
- const Type& aliased_mixin_type = Type::Handle(isolate,
+ const Type& aliased_mixin_type = Type::Handle(zone,
aliased_mixin_app_class.mixin());
// The name of the inserted mixin application class is the name of mixin
// class name with a backtick added.
- String& inserted_class_name = String::Handle(isolate, mixin_app_class.Name());
+ String& inserted_class_name = String::Handle(zone, mixin_app_class.Name());
inserted_class_name = String::Concat(inserted_class_name,
Symbols::Backtick());
- const Library& library = Library::Handle(isolate, mixin_app_class.library());
- Class& inserted_class = Class::Handle(isolate,
+ const Library& library = Library::Handle(zone, mixin_app_class.library());
+ Class& inserted_class = Class::Handle(zone,
library.LookupLocalClass(inserted_class_name));
if (inserted_class.IsNull()) {
inserted_class_name = Symbols::New(inserted_class_name);
- const Script& script = Script::Handle(isolate, mixin_app_class.script());
+ const Script& script = Script::Handle(zone, mixin_app_class.script());
inserted_class = Class::New(
inserted_class_name, script, mixin_app_class.token_pos());
inserted_class.set_is_synthesized_class();
@@ -1872,8 +1874,8 @@ void ClassFinalizer::ApplyMixinAppAlias(const Class& mixin_app_class,
// After FinalizeTypesInClass, if the mixin type and interface type are
// generic, their type arguments will refer to the type parameters of
// inserted_class.
- const Type& inserted_class_mixin_type = Type::Handle(isolate,
- Type::New(Class::Handle(isolate, aliased_mixin_type.type_class()),
+ const Type& inserted_class_mixin_type = Type::Handle(zone,
+ Type::New(Class::Handle(zone, aliased_mixin_type.type_class()),
Object::null_type_arguments(),
aliased_mixin_type.token_pos()));
inserted_class.set_mixin(inserted_class_mixin_type);
@@ -1904,33 +1906,33 @@ void ClassFinalizer::ApplyMixinAppAlias(const Class& mixin_app_class,
// It is important that the type parameters of the mixin application class
// are not finalized yet, because new type parameters may have been added
// to the super class.
- const Class& super_class = Class::Handle(isolate, super_type.type_class());
+ const Class& super_class = Class::Handle(zone, super_type.type_class());
ASSERT(mixin_app_class.SuperClass() == super_class.raw()); // Will change.
const intptr_t num_super_type_params = super_class.NumTypeParameters();
- AbstractType& type = AbstractType::Handle(isolate);
+ AbstractType& type = AbstractType::Handle(zone);
// The instantiator is mapping finalized type parameters of mixin_class to
// unfinalized type parameters of mixin_app_class.
ASSERT(aliased_mixin_type.IsFinalized());
- const Class& aliased_mixin_type_class = Class::Handle(isolate,
+ const Class& aliased_mixin_type_class = Class::Handle(zone,
aliased_mixin_type.type_class());
const intptr_t num_aliased_mixin_type_params =
aliased_mixin_type_class.NumTypeParameters();
ASSERT(inserted_class.NumTypeParameters() ==
(num_super_type_params + num_aliased_mixin_type_params));
const AbstractType& mixin_class_super_type =
- AbstractType::Handle(isolate, mixin_class.super_type());
+ AbstractType::Handle(zone, mixin_class.super_type());
ASSERT(mixin_class_super_type.IsFinalized());
// The aliased_mixin_type may be raw.
const TypeArguments& mixin_class_super_type_args =
- TypeArguments::Handle(isolate, mixin_class_super_type.arguments());
- TypeArguments& new_mixin_type_args = TypeArguments::Handle(isolate);
+ TypeArguments::Handle(zone, mixin_class_super_type.arguments());
+ TypeArguments& new_mixin_type_args = TypeArguments::Handle(zone);
if ((num_aliased_mixin_type_params > 0) &&
!mixin_class_super_type_args.IsNull()) {
new_mixin_type_args = TypeArguments::New(num_aliased_mixin_type_params);
- AbstractType& bounded_type = AbstractType::Handle(isolate);
- AbstractType& upper_bound = AbstractType::Handle(isolate);
- TypeParameter& type_parameter = TypeParameter::Handle(isolate);
- Error& bound_error = Error::Handle(isolate);
+ AbstractType& bounded_type = AbstractType::Handle(zone);
+ AbstractType& upper_bound = AbstractType::Handle(zone);
+ TypeParameter& type_parameter = TypeParameter::Handle(zone);
+ Error& bound_error = Error::Handle(zone);
const intptr_t offset =
mixin_class_super_type_args.Length() - num_aliased_mixin_type_params;
for (intptr_t i = 0; i < num_aliased_mixin_type_params; i++) {
@@ -1960,12 +1962,12 @@ void ClassFinalizer::ApplyMixinAppAlias(const Class& mixin_app_class,
new_mixin_type_args.SetTypeAt(i, type);
}
}
- TypeArguments& new_super_type_args = TypeArguments::Handle(isolate);
+ TypeArguments& new_super_type_args = TypeArguments::Handle(zone);
if ((num_super_type_params + num_aliased_mixin_type_params) > 0) {
new_super_type_args = TypeArguments::New(num_super_type_params +
num_aliased_mixin_type_params);
const TypeArguments& type_params =
- TypeArguments::Handle(isolate, mixin_app_class.type_parameters());
+ TypeArguments::Handle(zone, mixin_app_class.type_parameters());
for (intptr_t i = 0; i < num_super_type_params; i++) {
type = type_params.TypeAt(i);
new_super_type_args.SetTypeAt(i, type);
@@ -1995,7 +1997,7 @@ void ClassFinalizer::ApplyMixinAppAlias(const Class& mixin_app_class,
String::Handle(inserted_class.Name()).ToCString(),
TypeArguments::Handle(
inserted_class.type_parameters()).ToCString(),
- String::Handle(isolate, super_type.Name()).ToCString(),
+ String::Handle(zone, super_type.Name()).ToCString(),
num_super_type_params + num_aliased_mixin_type_params,
super_type.ToCString(),
String::Handle(mixin_app_class.Name()).ToCString(),
@@ -2627,27 +2629,27 @@ RawType* ClassFinalizer::ResolveMixinAppType(
const MixinAppType& mixin_app_type) {
// Lookup or create mixin application classes in the library of cls
// and resolve super type and mixin types.
- Isolate* isolate = Isolate::Current();
- const Library& library = Library::Handle(isolate, cls.library());
+ Zone* zone = Thread::Current()->zone();
+ const Library& library = Library::Handle(zone, cls.library());
ASSERT(!library.IsNull());
- const Script& script = Script::Handle(isolate, cls.script());
+ const Script& script = Script::Handle(zone, cls.script());
ASSERT(!script.IsNull());
const GrowableObjectArray& type_args =
- GrowableObjectArray::Handle(isolate, GrowableObjectArray::New());
+ GrowableObjectArray::Handle(zone, GrowableObjectArray::New());
AbstractType& mixin_super_type =
- AbstractType::Handle(isolate, mixin_app_type.super_type());
+ AbstractType::Handle(zone, mixin_app_type.super_type());
ResolveType(cls, mixin_super_type);
ASSERT(mixin_super_type.HasResolvedTypeClass()); // Even if malformed.
// The super type may have a BoundedType as type argument, but cannot be
// a BoundedType itself.
CollectTypeArguments(cls, Type::Cast(mixin_super_type), type_args);
- AbstractType& mixin_type = AbstractType::Handle(isolate);
- Class& mixin_type_class = Class::Handle(isolate);
- Class& mixin_app_class = Class::Handle(isolate);
- String& mixin_app_class_name = String::Handle(isolate);
- String& mixin_type_class_name = String::Handle(isolate);
- AbstractType& super_type_arg = AbstractType::Handle(isolate);
- AbstractType& mixin_type_arg = AbstractType::Handle(isolate);
+ AbstractType& mixin_type = AbstractType::Handle(zone);
+ Class& mixin_type_class = Class::Handle(zone);
+ Class& mixin_app_class = Class::Handle(zone);
+ String& mixin_app_class_name = String::Handle(zone);
+ String& mixin_type_class_name = String::Handle(zone);
+ AbstractType& super_type_arg = AbstractType::Handle(zone);
+ AbstractType& mixin_type_arg = AbstractType::Handle(zone);
const intptr_t depth = mixin_app_type.Depth();
for (intptr_t i = 0; i < depth; i++) {
mixin_type = mixin_app_type.MixinTypeAt(i);
@@ -2702,7 +2704,7 @@ RawType* ClassFinalizer::ResolveMixinAppType(
mixin_type.token_pos());
mixin_app_class.set_super_type(mixin_super_type);
mixin_type_class = mixin_type.type_class();
- const Type& generic_mixin_type = Type::Handle(isolate,
+ const Type& generic_mixin_type = Type::Handle(zone,
Type::New(mixin_type_class,
Object::null_type_arguments(),
mixin_type.token_pos()));
@@ -2710,7 +2712,7 @@ RawType* ClassFinalizer::ResolveMixinAppType(
// Add the mixin type to the list of interfaces that the mixin application
// class implements. This is necessary so that cycle check work at
// compile time (type arguments are ignored by that check).
- const Array& interfaces = Array::Handle(isolate, Array::New(1));
+ const Array& interfaces = Array::Handle(zone, Array::New(1));
interfaces.SetAt(0, generic_mixin_type);
ASSERT(mixin_app_class.interfaces() == Object::empty_array().raw());
mixin_app_class.set_interfaces(interfaces);
@@ -2732,10 +2734,10 @@ RawType* ClassFinalizer::ResolveMixinAppType(
Object::null_type_arguments(),
mixin_type.token_pos());
}
- TypeArguments& mixin_app_args = TypeArguments::Handle(isolate);
+ TypeArguments& mixin_app_args = TypeArguments::Handle(zone);
if (type_args.Length() > 0) {
mixin_app_args = TypeArguments::New(type_args.Length());
- AbstractType& type_arg = AbstractType::Handle(isolate);
+ AbstractType& type_arg = AbstractType::Handle(zone);
for (intptr_t i = 0; i < type_args.Length(); i++) {
type_arg ^= type_args.At(i);
mixin_app_args.SetTypeAt(i, type_arg);
@@ -2771,12 +2773,12 @@ void ClassFinalizer::ResolveSuperTypeAndInterfaces(
if (FLAG_trace_class_finalization) {
THR_Print("Resolving super and interfaces: %s\n", cls.ToCString());
}
- Isolate* isolate = Isolate::Current();
+ Zone* zone = Thread::Current()->zone();
const intptr_t cls_index = cls.id();
for (intptr_t i = 0; i < visited->length(); i++) {
if ((*visited)[i] == cls_index) {
// We have already visited class 'cls'. We found a cycle.
- const String& class_name = String::Handle(isolate, cls.Name());
+ const String& class_name = String::Handle(zone, cls.Name());
ReportError(cls, cls.token_pos(),
"cyclic reference found for class '%s'",
class_name.ToCString());
@@ -2785,8 +2787,8 @@ void ClassFinalizer::ResolveSuperTypeAndInterfaces(
// If the class/interface has no explicit super class/interfaces
// and is not a mixin application, we are done.
- AbstractType& super_type = AbstractType::Handle(isolate, cls.super_type());
- Array& super_interfaces = Array::Handle(isolate, cls.interfaces());
+ AbstractType& super_type = AbstractType::Handle(zone, cls.super_type());
+ Array& super_interfaces = Array::Handle(zone, cls.interfaces());
if ((super_type.IsNull() || super_type.IsObjectType()) &&
(super_interfaces.Length() == 0)) {
cls.set_is_cycle_free();
@@ -2809,32 +2811,32 @@ void ClassFinalizer::ResolveSuperTypeAndInterfaces(
// Resolve and check the super type and interfaces of cls.
visited->Add(cls_index);
- AbstractType& interface = AbstractType::Handle(isolate);
- Class& interface_class = Class::Handle(isolate);
+ AbstractType& interface = AbstractType::Handle(zone);
+ Class& interface_class = Class::Handle(zone);
// Resolve super type. Failures lead to a longjmp.
ResolveType(cls, super_type);
if (super_type.IsMalformedOrMalbounded()) {
- ReportError(Error::Handle(isolate, super_type.error()));
+ ReportError(Error::Handle(zone, super_type.error()));
}
if (super_type.IsDynamicType()) {
ReportError(cls, cls.token_pos(),
"class '%s' may not extend 'dynamic'",
- String::Handle(isolate, cls.Name()).ToCString());
+ String::Handle(zone, cls.Name()).ToCString());
}
interface_class = super_type.type_class();
if (interface_class.IsSignatureClass()) {
ReportError(cls, cls.token_pos(),
"class '%s' may not extend function type alias '%s'",
- String::Handle(isolate, cls.Name()).ToCString(),
- String::Handle(isolate,
+ String::Handle(zone, cls.Name()).ToCString(),
+ String::Handle(zone,
super_type.UserVisibleName()).ToCString());
}
if (interface_class.is_enum_class()) {
ReportError(cls, cls.token_pos(),
"class '%s' may not extend enum '%s'",
- String::Handle(isolate, cls.Name()).ToCString(),
- String::Handle(isolate, interface_class.Name()).ToCString());
+ String::Handle(zone, cls.Name()).ToCString(),
+ String::Handle(zone, interface_class.Name()).ToCString());
}
// If cls belongs to core lib or to core lib's implementation, restrictions
@@ -2879,11 +2881,11 @@ void ClassFinalizer::ResolveSuperTypeAndInterfaces(
}
}
if (is_error) {
- const String& interface_name = String::Handle(isolate,
+ const String& interface_name = String::Handle(zone,
interface_class.Name());
ReportError(cls, cls.token_pos(),
"'%s' is not allowed to extend '%s'",
- String::Handle(isolate, cls.Name()).ToCString(),
+ String::Handle(zone, cls.Name()).ToCString(),
interface_name.ToCString());
}
}
@@ -2897,7 +2899,7 @@ void ClassFinalizer::ResolveSuperTypeAndInterfaces(
ASSERT(!interface.IsTypeParameter()); // Should be detected by parser.
// A malbounded interface is only reported when involved in a type test.
if (interface.IsMalformed()) {
- ReportError(Error::Handle(isolate, interface.error()));
+ ReportError(Error::Handle(zone, interface.error()));
}
if (interface.IsDynamicType()) {
ReportError(cls, cls.token_pos(),
@@ -2905,14 +2907,14 @@ void ClassFinalizer::ResolveSuperTypeAndInterfaces(
}
interface_class = interface.type_class();
if (interface_class.IsSignatureClass()) {
- const String& interface_name = String::Handle(isolate,
+ const String& interface_name = String::Handle(zone,
interface_class.Name());
ReportError(cls, cls.token_pos(),
"function type alias '%s' may not be used as interface",
interface_name.ToCString());
}
if (interface_class.is_enum_class()) {
- const String& interface_name = String::Handle(isolate,
+ const String& interface_name = String::Handle(zone,
interface_class.Name());
ReportError(cls, cls.token_pos(),
"enum '%s' may not be used as interface",
@@ -2928,7 +2930,7 @@ void ClassFinalizer::ResolveSuperTypeAndInterfaces(
interface.IsDoubleType() ||
interface.IsStringType() ||
interface.IsDynamicType()) {
- const String& interface_name = String::Handle(isolate,
+ const String& interface_name = String::Handle(zone,
interface_class.Name());
if (cls.IsMixinApplication()) {
ReportError(cls, cls.token_pos(),
@@ -2937,7 +2939,7 @@ void ClassFinalizer::ResolveSuperTypeAndInterfaces(
} else {
ReportError(cls, cls.token_pos(),
"'%s' is not allowed to extend or implement '%s'",
- String::Handle(isolate, cls.Name()).ToCString(),
+ String::Handle(zone, cls.Name()).ToCString(),
interface_name.ToCString());
}
}
« no previous file with comments | « runtime/vm/benchmark_test.cc ('k') | runtime/vm/class_finalizer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698