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

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

Issue 143893006: Relax assert in case a type is first canonicalized at run time (issue 16239). (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 | « no previous file | 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 12559 matching lines...) Expand 10 before | Expand all | Expand 10 after
12570 } 12570 }
12571 ASSERT(type.IsFinalized()); 12571 ASSERT(type.IsFinalized());
12572 if (this->Equals(type)) { 12572 if (this->Equals(type)) {
12573 return type.raw(); 12573 return type.raw();
12574 } 12574 }
12575 index++; 12575 index++;
12576 } 12576 }
12577 // Canonicalize the type arguments. 12577 // Canonicalize the type arguments.
12578 AbstractTypeArguments& type_args = 12578 AbstractTypeArguments& type_args =
12579 AbstractTypeArguments::Handle(isolate, arguments()); 12579 AbstractTypeArguments::Handle(isolate, arguments());
12580 ASSERT(type_args.IsNull() || (type_args.Length() == cls.NumTypeArguments())); 12580 // In case the type is first canonicalized at runtime, its type argument
12581 // vector may be longer than necessary. This is not an issue.
12582 ASSERT(type_args.IsNull() || (type_args.Length() >= cls.NumTypeArguments()));
12581 type_args = type_args.Canonicalize(trail); 12583 type_args = type_args.Canonicalize(trail);
12582 set_arguments(type_args); 12584 set_arguments(type_args);
12583 // The type needs to be added to the list. Grow the list if it is full. 12585 // The type needs to be added to the list. Grow the list if it is full.
12584 if (index == canonical_types_len) { 12586 if (index == canonical_types_len) {
12585 const intptr_t kLengthIncrement = 2; // Raw and parameterized. 12587 const intptr_t kLengthIncrement = 2; // Raw and parameterized.
12586 const intptr_t new_length = canonical_types.Length() + kLengthIncrement; 12588 const intptr_t new_length = canonical_types.Length() + kLengthIncrement;
12587 const Array& new_canonical_types = Array::Handle( 12589 const Array& new_canonical_types = Array::Handle(
12588 isolate, Array::Grow(canonical_types, new_length, Heap::kOld)); 12590 isolate, Array::Grow(canonical_types, new_length, Heap::kOld));
12589 cls.set_canonical_types(new_canonical_types); 12591 cls.set_canonical_types(new_canonical_types);
12590 new_canonical_types.SetAt(index, *this); 12592 new_canonical_types.SetAt(index, *this);
(...skipping 4398 matching lines...) Expand 10 before | Expand all | Expand 10 after
16989 return "_MirrorReference"; 16991 return "_MirrorReference";
16990 } 16992 }
16991 16993
16992 16994
16993 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 16995 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
16994 Instance::PrintToJSONStream(stream, ref); 16996 Instance::PrintToJSONStream(stream, ref);
16995 } 16997 }
16996 16998
16997 16999
16998 } // namespace dart 17000 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698