| 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 } | 528 } |
| 529 FinalizeTypeArguments(super_class, arguments, finalization); | 529 FinalizeTypeArguments(super_class, arguments, finalization); |
| 530 } | 530 } |
| 531 } | 531 } |
| 532 | 532 |
| 533 | 533 |
| 534 RawAbstractType* ClassFinalizer::FinalizeType(const Class& cls, | 534 RawAbstractType* ClassFinalizer::FinalizeType(const Class& cls, |
| 535 const AbstractType& type, | 535 const AbstractType& type, |
| 536 FinalizationKind finalization) { | 536 FinalizationKind finalization) { |
| 537 if (type.IsFinalized()) { | 537 if (type.IsFinalized()) { |
| 538 // Ensure type is canonical if canonicalization is requested. |
| 539 if (finalization >= kCanonicalize) { |
| 540 return type.Canonicalize(); |
| 541 } |
| 538 return type.raw(); | 542 return type.raw(); |
| 539 } | 543 } |
| 540 ASSERT(type.IsResolved()); | 544 ASSERT(type.IsResolved()); |
| 541 ASSERT(finalization >= kFinalize); | 545 ASSERT(finalization >= kFinalize); |
| 542 | 546 |
| 543 if (FLAG_trace_type_finalization) { | 547 if (FLAG_trace_type_finalization) { |
| 544 OS::Print("Finalize type '%s'\n", String::Handle(type.Name()).ToCString()); | 548 OS::Print("Finalize type '%s'\n", String::Handle(type.Name()).ToCString()); |
| 545 } | 549 } |
| 546 | 550 |
| 547 if (type.IsTypeParameter()) { | 551 if (type.IsTypeParameter()) { |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 void ClassFinalizer::ReportError(const char* format, ...) { | 1396 void ClassFinalizer::ReportError(const char* format, ...) { |
| 1393 va_list args; | 1397 va_list args; |
| 1394 va_start(args, format); | 1398 va_start(args, format); |
| 1395 const Error& error = Error::Handle( | 1399 const Error& error = Error::Handle( |
| 1396 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); | 1400 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); |
| 1397 va_end(args); | 1401 va_end(args); |
| 1398 ReportError(error); | 1402 ReportError(error); |
| 1399 } | 1403 } |
| 1400 | 1404 |
| 1401 } // namespace dart | 1405 } // namespace dart |
| OLD | NEW |