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(), |
| 777 StackFrameIterator::kNoCrossThreadIteration); |
776 | 778 |
777 Function& func = Function::Handle(); | 779 Function& func = Function::Handle(); |
778 while (it.HasNextFrame()) { | 780 while (it.HasNextFrame()) { |
779 StackFrame* frame = it.NextFrame(); | 781 StackFrame* frame = it.NextFrame(); |
780 if (frame->IsDartFrame()) { | 782 if (frame->IsDartFrame()) { |
781 func = frame->LookupDartFunction(); | 783 func = frame->LookupDartFunction(); |
782 ASSERT(!func.IsNull()); | 784 ASSERT(!func.IsNull()); |
783 func.EnsureHasCompiledUnoptimizedCode(); | 785 func.EnsureHasCompiledUnoptimizedCode(); |
784 } | 786 } |
785 } | 787 } |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 } | 1550 } |
1549 | 1551 |
1550 | 1552 |
1551 void IsolateReloadContext::ResetUnoptimizedICsOnStack() { | 1553 void IsolateReloadContext::ResetUnoptimizedICsOnStack() { |
1552 Thread* thread = Thread::Current(); | 1554 Thread* thread = Thread::Current(); |
1553 StackZone stack_zone(thread); | 1555 StackZone stack_zone(thread); |
1554 Zone* zone = stack_zone.GetZone(); | 1556 Zone* zone = stack_zone.GetZone(); |
1555 | 1557 |
1556 Code& code = Code::Handle(zone); | 1558 Code& code = Code::Handle(zone); |
1557 Function& function = Function::Handle(zone); | 1559 Function& function = Function::Handle(zone); |
1558 DartFrameIterator iterator; | 1560 DartFrameIterator iterator(thread, |
| 1561 StackFrameIterator::kNoCrossThreadIteration); |
1559 StackFrame* frame = iterator.NextFrame(); | 1562 StackFrame* frame = iterator.NextFrame(); |
1560 while (frame != NULL) { | 1563 while (frame != NULL) { |
1561 code = frame->LookupDartCode(); | 1564 code = frame->LookupDartCode(); |
1562 if (code.is_optimized()) { | 1565 if (code.is_optimized()) { |
1563 // If this code is optimized, we need to reset the ICs in the | 1566 // If this code is optimized, we need to reset the ICs in the |
1564 // corresponding unoptimized code, which will be executed when the stack | 1567 // corresponding unoptimized code, which will be executed when the stack |
1565 // unwinds to the optimized code. | 1568 // unwinds to the optimized code. |
1566 function = code.function(); | 1569 function = code.function(); |
1567 code = function.unoptimized_code(); | 1570 code = function.unoptimized_code(); |
1568 ASSERT(!code.IsNull()); | 1571 ASSERT(!code.IsNull()); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1895 ASSERT(!super_cls.IsNull()); | 1898 ASSERT(!super_cls.IsNull()); |
1896 super_cls.AddDirectSubclass(cls); | 1899 super_cls.AddDirectSubclass(cls); |
1897 } | 1900 } |
1898 } | 1901 } |
1899 } | 1902 } |
1900 } | 1903 } |
1901 | 1904 |
1902 #endif // !PRODUCT | 1905 #endif // !PRODUCT |
1903 | 1906 |
1904 } // namespace dart | 1907 } // namespace dart |
OLD | NEW |