Changed tracer to use an instance to hold state instead of statics.
Change-Id: I2fdcf5de7fbc745273b1a33cb409d13e72d24ab4
diff --git a/src/object.cc b/src/object.cc
index b98235b..f43bec9 100644
--- a/src/object.cc
+++ b/src/object.cc
@@ -447,7 +447,7 @@
return DexFile::kDexNoIndex; // Special no mapping case
}
size_t mapping_table_length = GetMappingTableLength();
- const void* code_offset = Trace::IsMethodTracingActive() ? Trace::GetSavedCodeFromMap(this) : GetCode();
+ const void* code_offset = Runtime::Current()->IsMethodTracingActive() ? Runtime::Current()->GetTracer()->GetSavedCodeFromMap(this) : GetCode();
uint32_t sought_offset = pc - reinterpret_cast<uintptr_t>(code_offset);
uint32_t best_offset = 0;
uint32_t best_dex_offset = 0;
@@ -478,8 +478,9 @@
uint32_t map_offset = mapping_table[i];
uint32_t map_dex_offset = mapping_table[i + 1];
if (map_dex_offset == dex_pc) {
- if (Trace::IsMethodTracingActive()) {
- return reinterpret_cast<uintptr_t>(Trace::GetSavedCodeFromMap(this)) + map_offset;
+ if (Runtime::Current()->IsMethodTracingActive()) {
+ Trace* tracer = Runtime::Current()->GetTracer();
+ return reinterpret_cast<uintptr_t>(tracer->GetSavedCodeFromMap(this)) + map_offset;
} else {
return reinterpret_cast<uintptr_t>(GetCode()) + map_offset;
}