| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 "vm/isolate_reload.h" | 7 #include "vm/isolate_reload.h" |
| 8 #include "vm/log.h" | 8 #include "vm/log.h" |
| 9 #include "vm/resolver.h" | 9 #include "vm/resolver.h" |
| 10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 if (is_finalized()) { | 416 if (is_finalized()) { |
| 417 const Error& error = | 417 const Error& error = |
| 418 Error::Handle(replacement.EnsureIsFinalized(Thread::Current())); | 418 Error::Handle(replacement.EnsureIsFinalized(Thread::Current())); |
| 419 if (!error.IsNull()) { | 419 if (!error.IsNull()) { |
| 420 IRC->ReportError(error); | 420 IRC->ReportError(error); |
| 421 return false; | 421 return false; |
| 422 } | 422 } |
| 423 TIR_Print("Finalized replacement class for %s\n", ToCString()); | 423 TIR_Print("Finalized replacement class for %s\n", ToCString()); |
| 424 } | 424 } |
| 425 | 425 |
| 426 // At this point the original and replacement must be in the same state. |
| 427 ASSERT(is_finalized() == replacement.is_finalized()); |
| 428 |
| 426 if (is_finalized()) { | 429 if (is_finalized()) { |
| 427 // Get the field maps for both classes. These field maps walk the class | 430 // Get the field maps for both classes. These field maps walk the class |
| 428 // hierarchy. | 431 // hierarchy. |
| 429 const Array& fields = | 432 const Array& fields = |
| 430 Array::Handle(OffsetToFieldMap()); | 433 Array::Handle(OffsetToFieldMap()); |
| 431 const Array& replacement_fields = | 434 const Array& replacement_fields = |
| 432 Array::Handle(replacement.OffsetToFieldMap()); | 435 Array::Handle(replacement.OffsetToFieldMap()); |
| 433 | 436 |
| 434 // Check that we have the same number of fields. | 437 // Check that we have the same number of fields. |
| 435 if (fields.Length() != replacement_fields.Length()) { | 438 if (fields.Length() != replacement_fields.Length()) { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 542 } |
| 540 ClearAndSetStaticTarget(new_target); | 543 ClearAndSetStaticTarget(new_target); |
| 541 } else { | 544 } else { |
| 542 ClearWithSentinel(); | 545 ClearWithSentinel(); |
| 543 } | 546 } |
| 544 } | 547 } |
| 545 | 548 |
| 546 #endif // !PRODUCT | 549 #endif // !PRODUCT |
| 547 | 550 |
| 548 } // namespace dart. | 551 } // namespace dart. |
| OLD | NEW |