| Index: runtime/vm/object.cc
|
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
|
| index 1249a5ea2d4d2d5ae71b0d883a220070c1a783bc..4274060f744692799699fa1d821d4330ff7e7647 100644
|
| --- a/runtime/vm/object.cc
|
| +++ b/runtime/vm/object.cc
|
| @@ -34,6 +34,7 @@
|
| #include "vm/intrinsifier.h"
|
| #include "vm/object_store.h"
|
| #include "vm/parser.h"
|
| +#include "vm/profiler.h"
|
| #include "vm/report.h"
|
| #include "vm/reusable_handles.h"
|
| #include "vm/runtime_entry.h"
|
| @@ -1731,10 +1732,15 @@ RawObject* Object::Allocate(intptr_t cls_id,
|
| Exceptions::Throw(thread, exception);
|
| UNREACHABLE();
|
| }
|
| + ClassTable* class_table = isolate->class_table();
|
| if (space == Heap::kNew) {
|
| - isolate->class_table()->UpdateAllocatedNew(cls_id, size);
|
| + class_table->UpdateAllocatedNew(cls_id, size);
|
| } else {
|
| - isolate->class_table()->UpdateAllocatedOld(cls_id, size);
|
| + class_table->UpdateAllocatedOld(cls_id, size);
|
| + }
|
| + const Class& cls = Class::Handle(class_table->At(cls_id));
|
| + if (cls.trace_allocation()) {
|
| + Profiler::RecordAllocation(isolate, cls_id);
|
| }
|
| NoSafepointScope no_safepoint;
|
| InitializeObject(address, cls_id, size);
|
| @@ -2725,6 +2731,16 @@ void Class::DisableCHAOptimizedCode() {
|
| }
|
|
|
|
|
| +void Class::SetTraceAllocation(bool trace_allocation) const {
|
| + const bool changed = trace_allocation != this->trace_allocation();
|
| + set_state_bits(
|
| + TraceAllocationBit::update(trace_allocation, raw_ptr()->state_bits_));
|
| + if (changed) {
|
| + // TODO(johnmccutchan): Deoptimize the world?
|
| + }
|
| +}
|
| +
|
| +
|
| void Class::set_cha_codes(const Array& cache) const {
|
| StorePointer(&raw_ptr()->cha_codes_, cache.raw());
|
| }
|
|
|