| 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/heap.h" | 5 #include "vm/heap.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 MicrosecondsToMilliseconds(stats_.times_[2]), | 780 MicrosecondsToMilliseconds(stats_.times_[2]), |
| 781 MicrosecondsToMilliseconds(stats_.times_[3]), | 781 MicrosecondsToMilliseconds(stats_.times_[3]), |
| 782 stats_.data_[0], | 782 stats_.data_[0], |
| 783 stats_.data_[1], | 783 stats_.data_[1], |
| 784 stats_.data_[2], | 784 stats_.data_[2], |
| 785 stats_.data_[3]); | 785 stats_.data_[3]); |
| 786 } | 786 } |
| 787 | 787 |
| 788 | 788 |
| 789 NoHeapGrowthControlScope::NoHeapGrowthControlScope() | 789 NoHeapGrowthControlScope::NoHeapGrowthControlScope() |
| 790 : StackResource(Isolate::Current()) { | 790 : StackResource(Thread::Current()) { |
| 791 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); | 791 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); |
| 792 current_growth_controller_state_ = heap->GrowthControlState(); | 792 current_growth_controller_state_ = heap->GrowthControlState(); |
| 793 heap->DisableGrowthControl(); | 793 heap->DisableGrowthControl(); |
| 794 } | 794 } |
| 795 | 795 |
| 796 | 796 |
| 797 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { | 797 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { |
| 798 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); | 798 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); |
| 799 heap->SetGrowthControlState(current_growth_controller_state_); | 799 heap->SetGrowthControlState(current_growth_controller_state_); |
| 800 } | 800 } |
| 801 | 801 |
| 802 | 802 |
| 803 WritableVMIsolateScope::WritableVMIsolateScope(Thread* thread, | 803 WritableVMIsolateScope::WritableVMIsolateScope(Thread* thread, |
| 804 bool include_code_pages) | 804 bool include_code_pages) |
| 805 : StackResource(thread), include_code_pages_(include_code_pages) { | 805 : StackResource(thread), include_code_pages_(include_code_pages) { |
| 806 Dart::vm_isolate()->heap()->WriteProtect(false, include_code_pages_); | 806 Dart::vm_isolate()->heap()->WriteProtect(false, include_code_pages_); |
| 807 } | 807 } |
| 808 | 808 |
| 809 | 809 |
| 810 WritableVMIsolateScope::~WritableVMIsolateScope() { | 810 WritableVMIsolateScope::~WritableVMIsolateScope() { |
| 811 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); | 811 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); |
| 812 Dart::vm_isolate()->heap()->WriteProtect(true, include_code_pages_); | 812 Dart::vm_isolate()->heap()->WriteProtect(true, include_code_pages_); |
| 813 } | 813 } |
| 814 | 814 |
| 815 } // namespace dart | 815 } // namespace dart |
| OLD | NEW |