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

Side by Side Diff: runtime/vm/object.cc

Issue 137983006: Leave uninitialized type arguments of a type being finalized as null instead of (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 3795 matching lines...) Expand 10 before | Expand all | Expand 10 after
3806 } 3806 }
3807 return true; 3807 return true;
3808 } 3808 }
3809 3809
3810 3810
3811 bool TypeArguments::IsInstantiated(GrowableObjectArray* trail) const { 3811 bool TypeArguments::IsInstantiated(GrowableObjectArray* trail) const {
3812 AbstractType& type = AbstractType::Handle(); 3812 AbstractType& type = AbstractType::Handle();
3813 const intptr_t num_types = Length(); 3813 const intptr_t num_types = Length();
3814 for (intptr_t i = 0; i < num_types; i++) { 3814 for (intptr_t i = 0; i < num_types; i++) {
3815 type = TypeAt(i); 3815 type = TypeAt(i);
3816 ASSERT(!type.IsNull()); 3816 if (!type.IsBeingFinalized() && !type.IsInstantiated(trail)) {
3817 if (!type.IsInstantiated(trail)) {
3818 return false; 3817 return false;
3819 } 3818 }
3820 } 3819 }
3821 return true; 3820 return true;
3822 } 3821 }
3823 3822
3824 3823
3825 bool TypeArguments::IsUninstantiatedIdentity() const { 3824 bool TypeArguments::IsUninstantiatedIdentity() const {
3826 ASSERT(!IsInstantiated()); 3825 ASSERT(!IsInstantiated());
3827 AbstractType& type = AbstractType::Handle(); 3826 AbstractType& type = AbstractType::Handle();
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
3971 IsUninstantiatedIdentity() && 3970 IsUninstantiatedIdentity() &&
3972 (instantiator_type_arguments.Length() == Length())) { 3971 (instantiator_type_arguments.Length() == Length())) {
3973 return instantiator_type_arguments.raw(); 3972 return instantiator_type_arguments.raw();
3974 } 3973 }
3975 const intptr_t num_types = Length(); 3974 const intptr_t num_types = Length();
3976 TypeArguments& instantiated_array = 3975 TypeArguments& instantiated_array =
3977 TypeArguments::Handle(TypeArguments::New(num_types, Heap::kNew)); 3976 TypeArguments::Handle(TypeArguments::New(num_types, Heap::kNew));
3978 AbstractType& type = AbstractType::Handle(); 3977 AbstractType& type = AbstractType::Handle();
3979 for (intptr_t i = 0; i < num_types; i++) { 3978 for (intptr_t i = 0; i < num_types; i++) {
3980 type = TypeAt(i); 3979 type = TypeAt(i);
3981 if (!type.IsInstantiated()) { 3980 if (!type.IsBeingFinalized() && !type.IsInstantiated()) {
3982 type = type.InstantiateFrom(instantiator_type_arguments, 3981 type = type.InstantiateFrom(instantiator_type_arguments,
3983 bound_error, 3982 bound_error,
3984 trail); 3983 trail);
3985 } 3984 }
3986 instantiated_array.SetTypeAt(i, type); 3985 instantiated_array.SetTypeAt(i, type);
3987 } 3986 }
3988 return instantiated_array.raw(); 3987 return instantiated_array.raw();
3989 } 3988 }
3990 3989
3991 3990
(...skipping 12983 matching lines...) Expand 10 before | Expand all | Expand 10 after
16975 return "_MirrorReference"; 16974 return "_MirrorReference";
16976 } 16975 }
16977 16976
16978 16977
16979 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 16978 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
16980 Instance::PrintToJSONStream(stream, ref); 16979 Instance::PrintToJSONStream(stream, ref);
16981 } 16980 }
16982 16981
16983 16982
16984 } // namespace dart 16983 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698