| 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 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 // types in order to break cycles. | 1075 // types in order to break cycles. |
| 1076 cls.Finalize(); | 1076 cls.Finalize(); |
| 1077 ResolveAndFinalizeUpperBounds(cls); | 1077 ResolveAndFinalizeUpperBounds(cls); |
| 1078 ResolveAndFinalizeMemberTypes(cls); | 1078 ResolveAndFinalizeMemberTypes(cls); |
| 1079 // Run additional checks after all types are finalized. | 1079 // Run additional checks after all types are finalized. |
| 1080 if (cls.is_const()) { | 1080 if (cls.is_const()) { |
| 1081 CheckForLegalConstClass(cls); | 1081 CheckForLegalConstClass(cls); |
| 1082 } | 1082 } |
| 1083 // Check to ensure we don't have classes with native fields in libraries | 1083 // Check to ensure we don't have classes with native fields in libraries |
| 1084 // which do not have a native resolver. | 1084 // which do not have a native resolver. |
| 1085 if (cls.num_native_fields() != 0) { | 1085 // TODO(regis): Re-enable native resolver checking after Dartium is fixed. |
| 1086 if (false && cls.num_native_fields() != 0) { |
| 1086 const Library& lib = Library::Handle(cls.library()); | 1087 const Library& lib = Library::Handle(cls.library()); |
| 1087 if (lib.native_entry_resolver() == NULL) { | 1088 if (lib.native_entry_resolver() == NULL) { |
| 1088 const String& cls_name = String::Handle(cls.Name()); | 1089 const String& cls_name = String::Handle(cls.Name()); |
| 1089 const String& lib_name = String::Handle(lib.url()); | 1090 const String& lib_name = String::Handle(lib.url()); |
| 1090 const Script& script = Script::Handle(cls.script()); | 1091 const Script& script = Script::Handle(cls.script()); |
| 1091 ReportError(script, cls.token_pos(), | 1092 ReportError(script, cls.token_pos(), |
| 1092 "class '%s' is trying to extend a native fields class, " | 1093 "class '%s' is trying to extend a native fields class, " |
| 1093 "but library '%s' has no native resolvers", | 1094 "but library '%s' has no native resolvers", |
| 1094 cls_name.ToCString(), lib_name.ToCString()); | 1095 cls_name.ToCString(), lib_name.ToCString()); |
| 1095 } | 1096 } |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1404 void ClassFinalizer::ReportError(const char* format, ...) { | 1405 void ClassFinalizer::ReportError(const char* format, ...) { |
| 1405 va_list args; | 1406 va_list args; |
| 1406 va_start(args, format); | 1407 va_start(args, format); |
| 1407 const Error& error = Error::Handle( | 1408 const Error& error = Error::Handle( |
| 1408 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); | 1409 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); |
| 1409 va_end(args); | 1410 va_end(args); |
| 1410 ReportError(error); | 1411 ReportError(error); |
| 1411 } | 1412 } |
| 1412 | 1413 |
| 1413 } // namespace dart | 1414 } // namespace dart |
| OLD | NEW |