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

Unified Diff: runtime/vm/object.cc

Issue 1292723002: Enable allocation tracing for classes owned by vm isolate (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/stub_code_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index c0b9241577e3d24ef7342da39158bf3b0c12fdb3..918f6528bb7e0bb4730141beb8a54470df2390fa 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -1753,7 +1753,7 @@ RawObject* Object::Allocate(intptr_t cls_id,
class_table->UpdateAllocatedOld(cls_id, size);
}
const Class& cls = Class::Handle(class_table->At(cls_id));
- if (cls.trace_allocation()) {
+ if (cls.TraceAllocation(isolate)) {
Profiler::RecordAllocation(isolate, cls_id);
}
NoSafepointScope no_safepoint;
@@ -2755,14 +2755,18 @@ void Class::DisableCHAOptimizedCode() {
}
+bool Class::TraceAllocation(Isolate* isolate) const {
+ ClassTable* class_table = isolate->class_table();
+ return class_table->TraceAllocationFor(id());
+}
+
+
void Class::SetTraceAllocation(bool trace_allocation) const {
- const bool changed = trace_allocation != this->trace_allocation();
+ Isolate* isolate = Isolate::Current();
+ const bool changed = trace_allocation != this->TraceAllocation(isolate);
if (changed) {
- set_state_bits(
- TraceAllocationBit::update(trace_allocation, raw_ptr()->state_bits_));
- Isolate* isolate = Isolate::Current();
ClassTable* class_table = isolate->class_table();
- class_table->TraceAllocationsFor(id(), trace_allocation);
+ class_table->SetTraceAllocationFor(id(), trace_allocation);
DisableAllocationStub();
}
}
@@ -4207,6 +4211,7 @@ const char* Class::ToCString() const {
void Class::PrintJSONImpl(JSONStream* stream, bool ref) const {
+ Isolate* isolate = Isolate::Current();
JSONObject jsobj(stream);
if ((raw() == Class::null()) || (id() == kFreeListElement)) {
// TODO(turnidge): This is weird and needs to be changed.
@@ -4231,7 +4236,7 @@ void Class::PrintJSONImpl(JSONStream* stream, bool ref) const {
jsobj.AddProperty("_finalized", is_finalized());
jsobj.AddProperty("_implemented", is_implemented());
jsobj.AddProperty("_patch", is_patch());
- jsobj.AddProperty("_traceAllocations", trace_allocation());
+ jsobj.AddProperty("_traceAllocations", TraceAllocation(isolate));
const Class& superClass = Class::Handle(SuperClass());
if (!superClass.IsNull()) {
jsobj.AddProperty("super", superClass);
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/stub_code_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698