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

Unified Diff: runtime/lib/mirrors.cc

Issue 109593003: Use a trail instead of a mark bit when processing recursive types in the VM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « no previous file | runtime/lib/object_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
===================================================================
--- runtime/lib/mirrors.cc (revision 31568)
+++ runtime/lib/mirrors.cc (working copy)
@@ -317,10 +317,15 @@
const AbstractType& type,
const Bool& is_declaration,
const Instance& owner_mirror) {
+ if (type.IsTypeRef()) {
+ AbstractType& ref_type = AbstractType::Handle(TypeRef::Cast(type).type());
+ ASSERT(!ref_type.IsTypeRef());
+ ASSERT(ref_type.IsCanonical());
+ return CreateClassMirror(cls, ref_type, is_declaration, owner_mirror);
+ }
ASSERT(!cls.IsDynamicClass() && !cls.IsVoidClass());
ASSERT(!type.IsNull());
ASSERT(type.IsFinalized());
- ASSERT(!type.IsTypeRef());
if (cls.IsSignatureClass()) {
if (cls.IsCanonicalSignatureClass()) {
@@ -365,9 +370,14 @@
static RawInstance* CreateTypeMirror(const AbstractType& type) {
+ if (type.IsTypeRef()) {
+ AbstractType& ref_type = AbstractType::Handle(TypeRef::Cast(type).type());
+ ASSERT(!ref_type.IsTypeRef());
+ ASSERT(ref_type.IsCanonical());
+ return CreateTypeMirror(ref_type);
+ }
ASSERT(type.IsFinalized());
ASSERT(!type.IsMalformed());
- ASSERT(!type.IsTypeRef());
if (type.HasResolvedTypeClass()) {
const Class& cls = Class::Handle(type.type_class());
// Handle void and dynamic types.
@@ -1260,7 +1270,6 @@
const intptr_t num_inherited_args = args.Length() - num_params;
for (intptr_t i = 0; i < num_params; i++) {
arg_type ^= args.TypeAt(i + num_inherited_args);
- arg_type = arg_type.Canonicalize(); // Necessary for recursive types.
type_mirror = CreateTypeMirror(arg_type);
result.SetAt(i, type_mirror);
}
« no previous file with comments | « no previous file | runtime/lib/object_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698