| 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/isolate_reload.h" | 5 #include "vm/isolate_reload.h" |
| 6 | 6 |
| 7 #include "vm/become.h" | 7 #include "vm/become.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/runtime_entry.h" | 9 #include "vm/runtime_entry.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 for (intptr_t i = 0; i < instance_morphers_.length(); i++) { | 765 for (intptr_t i = 0; i < instance_morphers_.length(); i++) { |
| 766 instance_morphers_.At(i)->AppendTo(&array); | 766 instance_morphers_.At(i)->AppendTo(&array); |
| 767 } | 767 } |
| 768 } | 768 } |
| 769 } | 769 } |
| 770 } | 770 } |
| 771 | 771 |
| 772 | 772 |
| 773 void IsolateReloadContext::EnsuredUnoptimizedCodeForStack() { | 773 void IsolateReloadContext::EnsuredUnoptimizedCodeForStack() { |
| 774 TIMELINE_SCOPE(EnsuredUnoptimizedCodeForStack); | 774 TIMELINE_SCOPE(EnsuredUnoptimizedCodeForStack); |
| 775 StackFrameIterator it(StackFrameIterator::kDontValidateFrames); | 775 StackFrameIterator it(StackFrameIterator::kDontValidateFrames, |
| 776 Thread::Current(), false); |
| 776 | 777 |
| 777 Function& func = Function::Handle(); | 778 Function& func = Function::Handle(); |
| 778 while (it.HasNextFrame()) { | 779 while (it.HasNextFrame()) { |
| 779 StackFrame* frame = it.NextFrame(); | 780 StackFrame* frame = it.NextFrame(); |
| 780 if (frame->IsDartFrame()) { | 781 if (frame->IsDartFrame()) { |
| 781 func = frame->LookupDartFunction(); | 782 func = frame->LookupDartFunction(); |
| 782 ASSERT(!func.IsNull()); | 783 ASSERT(!func.IsNull()); |
| 783 func.EnsureHasCompiledUnoptimizedCode(); | 784 func.EnsureHasCompiledUnoptimizedCode(); |
| 784 } | 785 } |
| 785 } | 786 } |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1548 } | 1549 } |
| 1549 | 1550 |
| 1550 | 1551 |
| 1551 void IsolateReloadContext::ResetUnoptimizedICsOnStack() { | 1552 void IsolateReloadContext::ResetUnoptimizedICsOnStack() { |
| 1552 Thread* thread = Thread::Current(); | 1553 Thread* thread = Thread::Current(); |
| 1553 StackZone stack_zone(thread); | 1554 StackZone stack_zone(thread); |
| 1554 Zone* zone = stack_zone.GetZone(); | 1555 Zone* zone = stack_zone.GetZone(); |
| 1555 | 1556 |
| 1556 Code& code = Code::Handle(zone); | 1557 Code& code = Code::Handle(zone); |
| 1557 Function& function = Function::Handle(zone); | 1558 Function& function = Function::Handle(zone); |
| 1558 DartFrameIterator iterator; | 1559 DartFrameIterator iterator(thread, false); |
| 1559 StackFrame* frame = iterator.NextFrame(); | 1560 StackFrame* frame = iterator.NextFrame(); |
| 1560 while (frame != NULL) { | 1561 while (frame != NULL) { |
| 1561 code = frame->LookupDartCode(); | 1562 code = frame->LookupDartCode(); |
| 1562 if (code.is_optimized()) { | 1563 if (code.is_optimized()) { |
| 1563 // If this code is optimized, we need to reset the ICs in the | 1564 // If this code is optimized, we need to reset the ICs in the |
| 1564 // corresponding unoptimized code, which will be executed when the stack | 1565 // corresponding unoptimized code, which will be executed when the stack |
| 1565 // unwinds to the optimized code. | 1566 // unwinds to the optimized code. |
| 1566 function = code.function(); | 1567 function = code.function(); |
| 1567 code = function.unoptimized_code(); | 1568 code = function.unoptimized_code(); |
| 1568 ASSERT(!code.IsNull()); | 1569 ASSERT(!code.IsNull()); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1895 ASSERT(!super_cls.IsNull()); | 1896 ASSERT(!super_cls.IsNull()); |
| 1896 super_cls.AddDirectSubclass(cls); | 1897 super_cls.AddDirectSubclass(cls); |
| 1897 } | 1898 } |
| 1898 } | 1899 } |
| 1899 } | 1900 } |
| 1900 } | 1901 } |
| 1901 | 1902 |
| 1902 #endif // !PRODUCT | 1903 #endif // !PRODUCT |
| 1903 | 1904 |
| 1904 } // namespace dart | 1905 } // namespace dart |
| OLD | NEW |