Change root visitor to use Object**.
Simplifies code and improves the performance of root visiting since
we usually don't need to check to see if the object moved.
Change-Id: Iba998f5a15ae1fa1b53ca5226dd2168a411196cf
diff --git a/runtime/arch/x86/context_x86.cc b/runtime/arch/x86/context_x86.cc
index d7dca64..5cf3001 100644
--- a/runtime/arch/x86/context_x86.cc
+++ b/runtime/arch/x86/context_x86.cc
@@ -26,7 +26,7 @@
static const uintptr_t gZero = 0;
void X86Context::Reset() {
- for (int i = 0; i < kNumberOfCpuRegisters; i++) {
+ for (size_t i = 0; i < kNumberOfCpuRegisters; i++) {
gprs_[i] = NULL;
}
gprs_[ESP] = &esp_;
diff --git a/runtime/arch/x86/context_x86.h b/runtime/arch/x86/context_x86.h
index 598314d..031fc92 100644
--- a/runtime/arch/x86/context_x86.h
+++ b/runtime/arch/x86/context_x86.h
@@ -43,8 +43,12 @@
eip_ = new_pc;
}
+ virtual uintptr_t* GetGPRAddress(uint32_t reg) {
+ DCHECK_LT(reg, kNumberOfCpuRegisters);
+ return gprs_[reg];
+ }
+
virtual uintptr_t GetGPR(uint32_t reg) {
- const uint32_t kNumberOfCpuRegisters = 8;
DCHECK_LT(reg, kNumberOfCpuRegisters);
return *gprs_[reg];
}