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

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

Issue 11366093: Do not copy type parameter bound from declaration to reference, since we are (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | runtime/vm/object.cc » ('j') | 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/class_finalizer.h" 5 #include "vm/class_finalizer.h"
6 6
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/heap.h" 8 #include "vm/heap.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 ASSERT(!parameterized_class.IsNull()); 704 ASSERT(!parameterized_class.IsNull());
705 // The index must reflect the position of this type parameter in the type 705 // The index must reflect the position of this type parameter in the type
706 // arguments vector of its parameterized class. The offset to add is the 706 // arguments vector of its parameterized class. The offset to add is the
707 // number of type arguments in the super type, which is equal to the 707 // number of type arguments in the super type, which is equal to the
708 // difference in number of type arguments and type parameters of the 708 // difference in number of type arguments and type parameters of the
709 // parameterized class. 709 // parameterized class.
710 const intptr_t offset = parameterized_class.NumTypeArguments() - 710 const intptr_t offset = parameterized_class.NumTypeArguments() -
711 parameterized_class.NumTypeParameters(); 711 parameterized_class.NumTypeParameters();
712 type_parameter.set_index(type_parameter.index() + offset); 712 type_parameter.set_index(type_parameter.index() + offset);
713 type_parameter.set_is_finalized(); 713 type_parameter.set_is_finalized();
714 // TODO(regis): We are not able to finalize the bound here without getting
715 // into cycles. Revisit.
714 // We do not canonicalize type parameters. 716 // We do not canonicalize type parameters.
715 return type_parameter.raw(); 717 return type_parameter.raw();
716 } 718 }
717 719
718 // At this point, we can only have a parameterized_type. 720 // At this point, we can only have a parameterized_type.
719 const Type& parameterized_type = Type::Cast(type); 721 const Type& parameterized_type = Type::Cast(type);
720 722
721 if (parameterized_type.IsBeingFinalized()) { 723 if (parameterized_type.IsBeingFinalized()) {
722 // Self reference detected. The type is malformed. 724 // Self reference detected. The type is malformed.
723 FinalizeMalformedType( 725 FinalizeMalformedType(
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 void ClassFinalizer::ReportError(const char* format, ...) { 1598 void ClassFinalizer::ReportError(const char* format, ...) {
1597 va_list args; 1599 va_list args;
1598 va_start(args, format); 1600 va_start(args, format);
1599 const Error& error = Error::Handle( 1601 const Error& error = Error::Handle(
1600 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); 1602 Parser::FormatError(Script::Handle(), -1, "Error", format, args));
1601 va_end(args); 1603 va_end(args);
1602 ReportError(error); 1604 ReportError(error);
1603 } 1605 }
1604 1606
1605 } // namespace dart 1607 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698