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

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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index c0b9241577e3d24ef7342da39158bf3b0c12fdb3..03220b880a4f1a518f7d4af7a635f4e398ad35be 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()) {
Ivan Posva 2015/08/14 05:38:31 Please pass isolate as an argument here.
Cutch 2015/08/14 13:54:36 Done.
Profiler::RecordAllocation(isolate, cls_id);
}
NoSafepointScope no_safepoint;
@@ -2755,14 +2755,19 @@ void Class::DisableCHAOptimizedCode() {
}
+bool Class::TraceAllocation() const {
+ Isolate* isolate = Isolate::Current();
Ivan Posva 2015/08/14 05:38:31 Take from parameter.
Cutch 2015/08/14 13:54:36 Done.
+ 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();
+ const bool changed = trace_allocation != this->TraceAllocation();
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();
}
}
@@ -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());
const Class& superClass = Class::Handle(SuperClass());
if (!superClass.IsNull()) {
jsobj.AddProperty("super", superClass);

Powered by Google App Engine
This is Rietveld 408576698