Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(946)

Side by Side Diff: runtime/vm/heap.cc

Issue 3004563003: Refactor Isolate name format, storage and log (Closed)
Patch Set: Make Dart_DebugName unique again Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 intptr_t max_new_gen_words, 543 intptr_t max_new_gen_words,
544 intptr_t max_old_gen_words, 544 intptr_t max_old_gen_words,
545 intptr_t max_external_words) { 545 intptr_t max_external_words) {
546 ASSERT(isolate->heap() == NULL); 546 ASSERT(isolate->heap() == NULL);
547 Heap* heap = new Heap(isolate, max_new_gen_words, max_old_gen_words, 547 Heap* heap = new Heap(isolate, max_new_gen_words, max_old_gen_words,
548 max_external_words); 548 max_external_words);
549 isolate->set_heap(heap); 549 isolate->set_heap(heap);
550 } 550 }
551 551
552 void Heap::RegionName(Heap* heap, Space space, char* name, intptr_t name_size) { 552 void Heap::RegionName(Heap* heap, Space space, char* name, intptr_t name_size) {
553 #if defined(PRODUCT)
554 const bool no_isolate_name = (heap == NULL) || (heap->isolate() == NULL) || 553 const bool no_isolate_name = (heap == NULL) || (heap->isolate() == NULL) ||
555 (heap->isolate()->name() == NULL); 554 (heap->isolate()->name() == NULL);
556 const char* isolate_name = 555 const char* isolate_name =
557 no_isolate_name ? "<unknown>" : heap->isolate()->name(); 556 no_isolate_name ? "<unknown>" : heap->isolate()->name();
558 #else
559 const bool no_isolate_name = (heap == NULL) || (heap->isolate() == NULL) ||
560 (heap->isolate()->debugger_name() == NULL);
561 const char* isolate_name =
562 no_isolate_name ? "<unknown>" : heap->isolate()->debugger_name();
563 #endif // !defined(PRODUCT)
564 const char* space_name = NULL; 557 const char* space_name = NULL;
565 switch (space) { 558 switch (space) {
566 case kNew: 559 case kNew:
567 space_name = "newspace"; 560 space_name = "newspace";
568 break; 561 break;
569 case kOld: 562 case kOld:
570 space_name = "oldspace"; 563 space_name = "oldspace";
571 break; 564 break;
572 case kCode: 565 case kCode:
573 space_name = "codespace"; 566 space_name = "codespace";
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 : StackResource(thread) { 889 : StackResource(thread) {
897 Dart::vm_isolate()->heap()->WriteProtect(false); 890 Dart::vm_isolate()->heap()->WriteProtect(false);
898 } 891 }
899 892
900 WritableVMIsolateScope::~WritableVMIsolateScope() { 893 WritableVMIsolateScope::~WritableVMIsolateScope() {
901 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); 894 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0);
902 Dart::vm_isolate()->heap()->WriteProtect(true); 895 Dart::vm_isolate()->heap()->WriteProtect(true);
903 } 896 }
904 897
905 } // namespace dart 898 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698