Exception work clean up.
Change-Id: Ide71ba25ea70b39651f80d9ff469019898a929e6
diff --git a/src/calling_convention.h b/src/calling_convention.h
index a1d1b32..8f2a79c 100644
--- a/src/calling_convention.h
+++ b/src/calling_convention.h
@@ -141,7 +141,7 @@
// Returns true if the method register will have been clobbered during argument
// set up
- virtual bool IsMethodRegisterCrushedPreCall() = 0;
+ virtual bool IsMethodRegisterClobberedPreCall() = 0;
// Iterator interface
bool HasNext();
diff --git a/src/calling_convention_arm.cc b/src/calling_convention_arm.cc
index 6e664ca..ed876f0 100644
--- a/src/calling_convention_arm.cc
+++ b/src/calling_convention_arm.cc
@@ -171,7 +171,7 @@
}
// Will reg be crushed by an outgoing argument?
-bool ArmJniCallingConvention::IsMethodRegisterCrushedPreCall() {
+bool ArmJniCallingConvention::IsMethodRegisterClobberedPreCall() {
return true; // The method register R0 is always clobbered by the JNIEnv
}
diff --git a/src/calling_convention_arm.h b/src/calling_convention_arm.h
index 4415254..3d513fe 100644
--- a/src/calling_convention_arm.h
+++ b/src/calling_convention_arm.h
@@ -46,7 +46,7 @@
virtual uint32_t FpSpillMask() const {
return 0; // Floats aren't spilled in JNI down call
}
- virtual bool IsMethodRegisterCrushedPreCall();
+ virtual bool IsMethodRegisterClobberedPreCall();
virtual bool IsCurrentParamInRegister();
virtual bool IsCurrentParamOnStack();
virtual ManagedRegister CurrentParamRegister();
diff --git a/src/calling_convention_x86.cc b/src/calling_convention_x86.cc
index a8f5778..9598647 100644
--- a/src/calling_convention_x86.cc
+++ b/src/calling_convention_x86.cc
@@ -86,7 +86,7 @@
return FrameSize() - kPointerSize;
}
-bool X86JniCallingConvention::IsMethodRegisterCrushedPreCall() {
+bool X86JniCallingConvention::IsMethodRegisterClobberedPreCall() {
return GetMethod()->IsSynchronized(); // Monitor enter crushes the method register
}
diff --git a/src/calling_convention_x86.h b/src/calling_convention_x86.h
index 8c55472..c3bdc40 100644
--- a/src/calling_convention_x86.h
+++ b/src/calling_convention_x86.h
@@ -49,7 +49,7 @@
virtual uint32_t FpSpillMask() const {
return 0;
}
- virtual bool IsMethodRegisterCrushedPreCall();
+ virtual bool IsMethodRegisterClobberedPreCall();
virtual bool IsCurrentParamInRegister();
virtual bool IsCurrentParamOnStack();
virtual ManagedRegister CurrentParamRegister();
diff --git a/src/context_arm.cc b/src/context_arm.cc
index 85ada9d..0d25278 100644
--- a/src/context_arm.cc
+++ b/src/context_arm.cc
@@ -9,6 +9,7 @@
ArmContext::ArmContext() {
#ifndef NDEBUG
+ // Initialize registers with easy to spot debug values
for (int i=0; i < 16; i++) {
gprs_[i] = 0xEBAD6070+i;
}
diff --git a/src/context_x86.cc b/src/context_x86.cc
index 04976a5..479b950 100644
--- a/src/context_x86.cc
+++ b/src/context_x86.cc
@@ -8,9 +8,13 @@
namespace x86 {
X86Context::X86Context() {
+#ifndef NDEBUG
+ // Initialize registers with easy to spot debug values
for (int i=0; i < 8; i++) {
gprs_[i] = 0xEBAD6070+i;
}
+ eip_ = 0xEBAD601F;
+#endif
}
void X86Context::FillCalleeSaves(const Frame& fr) {
diff --git a/src/jni_compiler.cc b/src/jni_compiler.cc
index 9624246..4d454cf 100644
--- a/src/jni_compiler.cc
+++ b/src/jni_compiler.cc
@@ -273,7 +273,7 @@
}
// 9. Plant call to native code associated with method
- if (!jni_conv->IsMethodRegisterCrushedPreCall()) {
+ if (!jni_conv->IsMethodRegisterClobberedPreCall()) {
// Method register shouldn't have been crushed by setting up outgoing
// arguments
__ Call(mr_conv->MethodRegister(), Method::NativeMethodOffset(),
diff --git a/src/runtime_support.S b/src/runtime_support.S
index 8b904b8..5372742 100644
--- a/src/runtime_support.S
+++ b/src/runtime_support.S
@@ -127,7 +127,6 @@
.global art_deliver_exception
.extern artDeliverExceptionHelper
- .extern _ZN3art6Thread5self_E
/*
* Called by managed code, saves callee saves and then calls artThrowExceptionHelper
* that will place a mock Method* at the bottom of the stack.
diff --git a/src/runtime_support.h b/src/runtime_support.h
index 4915314..1f8da91 100644
--- a/src/runtime_support.h
+++ b/src/runtime_support.h
@@ -3,13 +3,15 @@
#ifndef ART_SRC_RUNTIME_SUPPORT_H_
#define ART_SRC_RUNTIME_SUPPORT_H_
+/* Helper for both JNI and regular compiled code */
+extern "C" void art_deliver_exception(void*);
+
#if defined(__arm__)
/* Compiler helpers */
extern "C" uint64_t art_shl_long(uint64_t, uint32_t);
extern "C" uint64_t art_shr_long(uint64_t, uint32_t);
extern "C" uint64_t art_ushr_long(uint64_t, uint32_t);
extern "C" void art_invoke_interface_trampoline(void*, void*, void*, void*);
- extern "C" void art_deliver_exception(void*);
/* Conversions */
extern "C" float __aeabi_i2f(int op1); // OP_INT_TO_FLOAT
@@ -45,8 +47,4 @@
#endif
-#if defined(__i386__)
-extern "C" void art_deliver_exception(void*);
-#endif
-
#endif // ART_SRC_RUNTIME_SUPPORT_H_
diff --git a/src/thread.cc b/src/thread.cc
index 92b3d4f..69fb3ba 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -312,11 +312,8 @@
pLdivmod = __aeabi_ldivmod;
pLmul = __aeabi_lmul;
pInvokeInterfaceTrampoline = art_invoke_interface_trampoline;
- pDeliverException = art_deliver_exception;
#endif
-#if defined(__i386__)
pDeliverException = art_deliver_exception;
-#endif
pF2l = F2L;
pD2l = D2L;
pAllocFromCode = Array::AllocFromCode;
@@ -1304,8 +1301,8 @@
if (catch_finder.native_method_count_ == 1) {
PopSirt();
} else {
- // We only expect the stack crawl to have passed 1 native method as its terminated
- // by a up call
+ // We only expect the stack crawl to have passed 1 native method as it's terminated
+ // by an up call
DCHECK_EQ(catch_finder.native_method_count_, 0u);
}
long_jump_context->SetSP(reinterpret_cast<intptr_t>(catch_finder.handler_frame_.GetSP()));