| 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 intptr_t max_new_gen_words, | 513 intptr_t max_new_gen_words, |
| 514 intptr_t max_old_gen_words, | 514 intptr_t max_old_gen_words, |
| 515 intptr_t max_external_words) { | 515 intptr_t max_external_words) { |
| 516 ASSERT(isolate->heap() == NULL); | 516 ASSERT(isolate->heap() == NULL); |
| 517 Heap* heap = new Heap(isolate, max_new_gen_words, max_old_gen_words, | 517 Heap* heap = new Heap(isolate, max_new_gen_words, max_old_gen_words, |
| 518 max_external_words); | 518 max_external_words); |
| 519 isolate->set_heap(heap); | 519 isolate->set_heap(heap); |
| 520 } | 520 } |
| 521 | 521 |
| 522 | 522 |
| 523 void Heap::RegionName(Heap* heap, Space space, char* name, intptr_t name_size) { |
| 524 const bool no_isolate_name = (heap == NULL) || (heap->isolate() == NULL) || |
| 525 (heap->isolate()->debugger_name() == NULL); |
| 526 const char* isolate_name = |
| 527 no_isolate_name ? "<unknown>" : heap->isolate()->debugger_name(); |
| 528 const char* space_name = (space == kNew) ? "newspace" : "oldspace"; |
| 529 const char* type_name = (space == kCode) ? "code" : "data"; |
| 530 OS::SNPrint(name, name_size, "%s %s %s", isolate_name, space_name, type_name); |
| 531 } |
| 532 |
| 533 |
| 523 void Heap::AddRegionsToObjectSet(ObjectSet* set) const { | 534 void Heap::AddRegionsToObjectSet(ObjectSet* set) const { |
| 524 new_space_.AddRegionsToObjectSet(set); | 535 new_space_.AddRegionsToObjectSet(set); |
| 525 old_space_.AddRegionsToObjectSet(set); | 536 old_space_.AddRegionsToObjectSet(set); |
| 526 } | 537 } |
| 527 | 538 |
| 528 | 539 |
| 529 ObjectSet* Heap::CreateAllocatedObjectSet( | 540 ObjectSet* Heap::CreateAllocatedObjectSet( |
| 530 Zone* zone, | 541 Zone* zone, |
| 531 MarkExpectation mark_expectation) const { | 542 MarkExpectation mark_expectation) const { |
| 532 ObjectSet* allocated_set = new (zone) ObjectSet(zone); | 543 ObjectSet* allocated_set = new (zone) ObjectSet(zone); |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 Dart::vm_isolate()->heap()->WriteProtect(false); | 865 Dart::vm_isolate()->heap()->WriteProtect(false); |
| 855 } | 866 } |
| 856 | 867 |
| 857 | 868 |
| 858 WritableVMIsolateScope::~WritableVMIsolateScope() { | 869 WritableVMIsolateScope::~WritableVMIsolateScope() { |
| 859 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); | 870 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); |
| 860 Dart::vm_isolate()->heap()->WriteProtect(true); | 871 Dart::vm_isolate()->heap()->WriteProtect(true); |
| 861 } | 872 } |
| 862 | 873 |
| 863 } // namespace dart | 874 } // namespace dart |
| OLD | NEW |