| OLD | NEW |
| 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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1105 ASSERT(!cls.IsCanonicalSignatureClass()); | 1105 ASSERT(!cls.IsCanonicalSignatureClass()); |
| 1106 // Check for illegal self references. | 1106 // Check for illegal self references. |
| 1107 GrowableArray<intptr_t> visited_aliases; | 1107 GrowableArray<intptr_t> visited_aliases; |
| 1108 if (!IsAliasCycleFree(cls, &visited_aliases)) { | 1108 if (!IsAliasCycleFree(cls, &visited_aliases)) { |
| 1109 const String& name = String::Handle(cls.Name()); | 1109 const String& name = String::Handle(cls.Name()); |
| 1110 const Script& script = Script::Handle(cls.script()); | 1110 const Script& script = Script::Handle(cls.script()); |
| 1111 ReportError(script, cls.token_index(), | 1111 ReportError(script, cls.token_index(), |
| 1112 "typedef '%s' illegally refers to itself", | 1112 "typedef '%s' illegally refers to itself", |
| 1113 name.ToCString()); | 1113 name.ToCString()); |
| 1114 } | 1114 } |
| 1115 // TODO(regis): Also check this: "It is a compile-time error if any default | |
| 1116 // values are specified in the signature of a function type alias". | |
| 1117 cls.Finalize(); | 1115 cls.Finalize(); |
| 1118 return; | 1116 return; |
| 1119 } | 1117 } |
| 1120 // Finalize factory class, if any. | 1118 // Finalize factory class, if any. |
| 1121 if (cls.is_interface()) { | 1119 if (cls.is_interface()) { |
| 1122 if (cls.HasFactoryClass()) { | 1120 if (cls.HasFactoryClass()) { |
| 1123 const Class& factory_class = Class::Handle(cls.FactoryClass()); | 1121 const Class& factory_class = Class::Handle(cls.FactoryClass()); |
| 1124 if (!factory_class.is_finalized()) { | 1122 if (!factory_class.is_finalized()) { |
| 1125 FinalizeClass(factory_class, generating_snapshot); | 1123 FinalizeClass(factory_class, generating_snapshot); |
| 1126 // Finalizing the factory class may indirectly finalize this interface. | 1124 // Finalizing the factory class may indirectly finalize this interface. |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 void ClassFinalizer::ReportError(const char* format, ...) { | 1491 void ClassFinalizer::ReportError(const char* format, ...) { |
| 1494 va_list args; | 1492 va_list args; |
| 1495 va_start(args, format); | 1493 va_start(args, format); |
| 1496 const Error& error = Error::Handle( | 1494 const Error& error = Error::Handle( |
| 1497 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); | 1495 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); |
| 1498 va_end(args); | 1496 va_end(args); |
| 1499 ReportError(error); | 1497 ReportError(error); |
| 1500 } | 1498 } |
| 1501 | 1499 |
| 1502 } // namespace dart | 1500 } // namespace dart |
| OLD | NEW |