| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |