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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
520 | 520 |
521 TIR_Print("Class `%s` can be reloaded (%" Pd " and %" Pd ")\n", | 521 TIR_Print("Class `%s` can be reloaded (%" Pd " and %" Pd ")\n", |
522 ToCString(), | 522 ToCString(), |
523 id(), | 523 id(), |
524 replacement.id()); | 524 replacement.id()); |
525 return true; | 525 return true; |
526 } | 526 } |
527 | 527 |
528 | 528 |
529 bool Library::CanReload(const Library& replacement) const { | 529 bool Library::CanReload(const Library& replacement) const { |
530 // If the replacement library uses deferred loading, reject it. We | |
rmacnak
2016/07/13 22:19:54
TODO(issue number)
turnidge
2016/07/13 22:23:03
Done.
| |
531 // do not yet support reloading deferred libraries. | |
532 LibraryPrefix& prefix = LibraryPrefix::Handle(); | |
533 LibraryPrefixIterator it(replacement); | |
534 while (it.HasNext()) { | |
535 prefix = it.GetNext(); | |
536 if (prefix.is_deferred_load()) { | |
537 const String& lib_url = String::Handle(replacement.url()); | |
538 const String& prefix_name = String::Handle(prefix.name()); | |
539 IRC->ReportError(String::Handle(String::NewFormatted( | |
540 "Reloading support for deferred loading has not yet been implemented:" | |
541 " library '%s' has deferred import '%s'", | |
542 lib_url.ToCString(), prefix_name.ToCString()))); | |
543 return false; | |
544 } | |
545 } | |
530 return true; | 546 return true; |
531 } | 547 } |
532 | 548 |
533 | 549 |
534 static const Function* static_call_target = NULL; | 550 static const Function* static_call_target = NULL; |
535 | 551 |
536 void ICData::Reset() const { | 552 void ICData::Reset() const { |
537 if (is_static_call()) { | 553 if (is_static_call()) { |
538 const Function& old_target = Function::Handle(GetTargetAt(0)); | 554 const Function& old_target = Function::Handle(GetTargetAt(0)); |
539 if (old_target.IsNull()) { | 555 if (old_target.IsNull()) { |
(...skipping 20 matching lines...) Expand all Loading... | |
560 } | 576 } |
561 ClearAndSetStaticTarget(new_target); | 577 ClearAndSetStaticTarget(new_target); |
562 } else { | 578 } else { |
563 ClearWithSentinel(); | 579 ClearWithSentinel(); |
564 } | 580 } |
565 } | 581 } |
566 | 582 |
567 #endif // !PRODUCT | 583 #endif // !PRODUCT |
568 | 584 |
569 } // namespace dart. | 585 } // namespace dart. |
OLD | NEW |