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

Unified Diff: runtime/vm/class_table.h

Issue 1213013002: Update Assembler::TryAllocate to support inline allocation tracing (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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/assembler_x64.cc ('k') | runtime/vm/class_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_table.h
diff --git a/runtime/vm/class_table.h b/runtime/vm/class_table.h
index 4781e37555fb81f908ed6c31e25d74b9ffdc5784..384b3d11ae9759922bda686be1f26878b7a6998a 100644
--- a/runtime/vm/class_table.h
+++ b/runtime/vm/class_table.h
@@ -6,6 +6,7 @@
#define VM_CLASS_TABLE_H_
#include "platform/assert.h"
+#include "vm/bitfield.h"
#include "vm/globals.h"
namespace dart {
@@ -102,6 +103,12 @@ class ClassHeapStats {
return OFFSET_OF(ClassHeapStats, recent) +
OFFSET_OF(AllocStats<intptr_t>, old_size);
}
+ static intptr_t state_offset() {
+ return OFFSET_OF(ClassHeapStats, state_);
+ }
+ static intptr_t TraceAllocationMask() {
+ return (1 << kTraceAllocationBit);
+ }
void Initialize();
void ResetAtNewGC();
@@ -112,10 +119,25 @@ class ClassHeapStats {
void PrintToJSONObject(const Class& cls, JSONObject* obj) const;
void Verify();
+ bool trace_allocation() const {
+ return TraceAllocationBit::decode(state_);
+ }
+
+ void set_trace_allocation(bool trace_allocation) {
+ state_ = TraceAllocationBit::update(trace_allocation, state_);
+ }
+
private:
+ enum StateBits {
+ kTraceAllocationBit = 0,
+ };
+
+ class TraceAllocationBit : public BitField<bool, kTraceAllocationBit, 1> {};
+
// Recent old at start of last new GC (used to compute promoted_*).
intptr_t old_pre_new_gc_count_;
intptr_t old_pre_new_gc_size_;
+ intptr_t state_;
};
@@ -194,6 +216,8 @@ class ClassTable {
// Deallocates table copies. Do not call during concurrent access to table.
void FreeOldTables();
+ void TraceAllocationsFor(intptr_t cid, bool trace);
+
private:
friend class MarkingVisitor;
friend class ScavengerVisitor;
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/class_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698