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

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

Issue 2105383003: VM: Don't generate allocation stats code in product mode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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/assembler_x64.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('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/atomic.h" 5 #include "vm/atomic.h"
6 #include "vm/class_table.h" 6 #include "vm/class_table.h"
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/freelist.h" 8 #include "vm/freelist.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 #include "vm/heap.h" 10 #include "vm/heap.h"
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 intptr_t ClassTable::CounterOffsetFor(intptr_t cid, bool is_new_space) { 465 intptr_t ClassTable::CounterOffsetFor(intptr_t cid, bool is_new_space) {
466 const intptr_t class_offset = ClassOffsetFor(cid); 466 const intptr_t class_offset = ClassOffsetFor(cid);
467 const intptr_t count_field_offset = is_new_space 467 const intptr_t count_field_offset = is_new_space
468 ? ClassHeapStats::allocated_since_gc_new_space_offset() 468 ? ClassHeapStats::allocated_since_gc_new_space_offset()
469 : ClassHeapStats::allocated_since_gc_old_space_offset(); 469 : ClassHeapStats::allocated_since_gc_old_space_offset();
470 return class_offset + count_field_offset; 470 return class_offset + count_field_offset;
471 } 471 }
472 472
473 473
474 intptr_t ClassTable::StateOffsetFor(intptr_t cid) { 474 intptr_t ClassTable::StateOffsetFor(intptr_t cid) {
475 return ClassOffsetFor(cid)+ ClassHeapStats::state_offset(); 475 return ClassOffsetFor(cid) + ClassHeapStats::state_offset();
476 } 476 }
477 477
478 478
479 intptr_t ClassTable::SizeOffsetFor(intptr_t cid, bool is_new_space) { 479 intptr_t ClassTable::SizeOffsetFor(intptr_t cid, bool is_new_space) {
480 const uword class_offset = ClassOffsetFor(cid); 480 const uword class_offset = ClassOffsetFor(cid);
481 const uword size_field_offset = is_new_space 481 const uword size_field_offset = is_new_space
482 ? ClassHeapStats::allocated_size_since_gc_new_space_offset() 482 ? ClassHeapStats::allocated_size_since_gc_new_space_offset()
483 : ClassHeapStats::allocated_size_since_gc_old_space_offset(); 483 : ClassHeapStats::allocated_size_since_gc_old_space_offset();
484 return class_offset + size_field_offset; 484 return class_offset + size_field_offset;
485 } 485 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 549
550 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { 550 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) {
551 ClassHeapStats* stats = PreliminaryStatsAt(cid); 551 ClassHeapStats* stats = PreliminaryStatsAt(cid);
552 ASSERT(stats != NULL); 552 ASSERT(stats != NULL);
553 ASSERT(size >= 0); 553 ASSERT(size >= 0);
554 stats->post_gc.AddNew(size); 554 stats->post_gc.AddNew(size);
555 } 555 }
556 556
557 557
558 } // namespace dart 558 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698