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

Unified Diff: runtime/vm/object.cc

Issue 10161030: Canonicalize type arguments lazily. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 6969)
+++ runtime/vm/object.cc (working copy)
@@ -6585,7 +6585,7 @@
const Class& cls = Class::Handle(clazz());
intptr_t field_offset = cls.type_arguments_instance_field_offset();
ASSERT(field_offset != Class::kNoTypeArguments);
- *FieldAddrAtOffset(field_offset) = value.Canonicalize();
+ *FieldAddrAtOffset(field_offset) = value.raw();
}
@@ -6619,6 +6619,10 @@
const intptr_t num_type_arguments = cls.NumTypeArguments();
if (num_type_arguments > 0) {
type_arguments = GetTypeArguments();
+ if (!type_arguments.IsNull() && !type_arguments.IsCanonical()) {
+ type_arguments = type_arguments.Canonicalize();
+ SetTypeArguments(type_arguments);
+ }
// Verify that the number of type arguments in the instance matches the
// number of type arguments expected by the instance class.
// A discrepancy is allowed for closures, which borrow the type argument
« 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