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/class_table.h" | 5 #include "vm/class_table.h" |
6 #include "vm/flags.h" | 6 #include "vm/flags.h" |
7 #include "vm/freelist.h" | 7 #include "vm/freelist.h" |
8 #include "vm/growable_array.h" | 8 #include "vm/growable_array.h" |
9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 | 76 |
77 | 77 |
78 void ClassTable::FreeOldTables() { | 78 void ClassTable::FreeOldTables() { |
79 while (old_tables_->length() > 0) { | 79 while (old_tables_->length() > 0) { |
80 free(old_tables_->RemoveLast()); | 80 free(old_tables_->RemoveLast()); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 | 84 |
85 void ClassTable::TraceAllocationsFor(intptr_t cid, bool trace) { | 85 void ClassTable::SetTraceAllocationFor(intptr_t cid, bool trace) { |
86 ClassHeapStats* stats = PreliminaryStatsAt(cid); | 86 ClassHeapStats* stats = PreliminaryStatsAt(cid); |
87 stats->set_trace_allocation(trace); | 87 stats->set_trace_allocation(trace); |
88 } | 88 } |
89 | 89 |
90 | 90 |
| 91 bool ClassTable::TraceAllocationFor(intptr_t cid) { |
| 92 ClassHeapStats* stats = PreliminaryStatsAt(cid); |
| 93 return stats->trace_allocation(); |
| 94 } |
| 95 |
| 96 |
91 void ClassTable::Register(const Class& cls) { | 97 void ClassTable::Register(const Class& cls) { |
92 intptr_t index = cls.id(); | 98 intptr_t index = cls.id(); |
93 if (index != kIllegalCid) { | 99 if (index != kIllegalCid) { |
94 ASSERT(index > 0); | 100 ASSERT(index > 0); |
95 ASSERT(index < kNumPredefinedCids); | 101 ASSERT(index < kNumPredefinedCids); |
96 ASSERT(table_[index] == 0); | 102 ASSERT(table_[index] == 0); |
97 ASSERT(index < capacity_); | 103 ASSERT(index < capacity_); |
98 table_[index] = cls.raw(); | 104 table_[index] = cls.raw(); |
99 // Add the vtable for this predefined class into the static vtable registry | 105 // Add the vtable for this predefined class into the static vtable registry |
100 // if it has not been setup yet. | 106 // if it has not been setup yet. |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 | 530 |
525 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { | 531 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { |
526 ClassHeapStats* stats = PreliminaryStatsAt(cid); | 532 ClassHeapStats* stats = PreliminaryStatsAt(cid); |
527 ASSERT(stats != NULL); | 533 ASSERT(stats != NULL); |
528 ASSERT(size >= 0); | 534 ASSERT(size >= 0); |
529 stats->post_gc.AddNew(size); | 535 stats->post_gc.AddNew(size); |
530 } | 536 } |
531 | 537 |
532 | 538 |
533 } // namespace dart | 539 } // namespace dart |
OLD | NEW |