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

Unified Diff: runtime/vm/object.cc

Issue 12314132: Fix bad optimization prematurely marking types as instantiated (issue 8710). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 19100)
+++ runtime/vm/object.cc (working copy)
@@ -747,7 +747,7 @@
type ^= Type::New(Object::Handle(cls.raw()),
TypeArguments::Handle(),
Scanner::kDummyTokenIndex);
- type.set_is_finalized_instantiated();
+ type.SetIsFinalized();
type ^= type.Canonicalize();
object_store->set_array_type(type);
@@ -8728,7 +8728,7 @@
}
const Type& type = Type::Handle(
Type::New(cls, type_arguments, Scanner::kDummyTokenIndex));
- type.set_is_finalized_instantiated();
+ type.SetIsFinalized();
return type.raw();
}
@@ -9291,24 +9291,22 @@
type ^= Type::New(Object::Handle(type_class.raw()),
no_type_arguments,
Scanner::kDummyTokenIndex);
- type.set_is_finalized_instantiated();
+ type.SetIsFinalized();
type ^= type.Canonicalize();
return type.raw();
}
-void Type::set_is_finalized_instantiated() const {
+void Type::SetIsFinalized() const {
ASSERT(!IsFinalized());
- set_type_state(RawType::kFinalizedInstantiated);
+ if (IsInstantiated()) {
+ set_type_state(RawType::kFinalizedInstantiated);
+ } else {
+ set_type_state(RawType::kFinalizedUninstantiated);
+ }
}
-void Type::set_is_finalized_uninstantiated() const {
- ASSERT(!IsFinalized());
- set_type_state(RawType::kFinalizedUninstantiated);
-}
-
-
void Type::set_is_being_finalized() const {
ASSERT(!IsFinalized() && !IsBeingFinalized());
set_type_state(RawType::kBeingFinalized);
@@ -9419,7 +9417,7 @@
Type::New(cls, type_arguments, token_pos()));
ASSERT(type_arguments.IsNull() ||
(type_arguments.Length() == cls.NumTypeArguments()));
- instantiated_type.set_is_finalized_instantiated();
+ instantiated_type.SetIsFinalized();
return instantiated_type.raw();
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698