Global lock levels.
Introduce the notion of the mutators/GC being a shared-exclusive (aka
reader-writer) lock. Introduce globally ordered locks, analysable by
annotalysis, statically at compile time. Add locking attributes to
methods.
More subtly, remove the heap_lock_ and split between various locks that
are held for smaller periods (where work doesn't get blocked). Remove
buggy Dalvik style thread transitions. Make GC use CMS in all cases when
concurrent is enabled. Fix bug where suspend counts rather than debug
suspend counts were sent to JDWP. Move the PathClassLoader to
WellKnownClasses. In debugger refactor calls to send request and
possibly suspend. Break apart different VmWait thread states. Move
identity hash code to a shared method.
Change-Id: Icdbfc3ce3fcccd14341860ac7305d8e97b51f5c6
diff --git a/src/oat/utils/x86/assembler_x86.cc b/src/oat/utils/x86/assembler_x86.cc
index b7f0c1f..78f2b57 100644
--- a/src/oat/utils/x86/assembler_x86.cc
+++ b/src/oat/utils/x86/assembler_x86.cc
@@ -1862,8 +1862,8 @@
#undef __
}
-void X86Assembler::ExceptionPoll(ManagedRegister /*scratch*/) {
- X86ExceptionSlowPath* slow = new X86ExceptionSlowPath();
+void X86Assembler::ExceptionPoll(ManagedRegister /*scratch*/, size_t stack_adjust) {
+ X86ExceptionSlowPath* slow = new X86ExceptionSlowPath(stack_adjust);
buffer_.EnqueueSlowPath(slow);
fs()->cmpl(Address::Absolute(Thread::ExceptionOffset()), Immediate(0));
j(kNotEqual, slow->Entry());
@@ -1874,6 +1874,9 @@
#define __ sp_asm->
__ Bind(&entry_);
// Note: the return value is dead
+ if (stack_adjust_ != 0) { // Fix up the frame.
+ __ DecreaseFrameSize(stack_adjust_);
+ }
// Pass exception as argument in EAX
__ fs()->movl(EAX, Address::Absolute(Thread::ExceptionOffset()));
__ fs()->call(Address::Absolute(ENTRYPOINT_OFFSET(pDeliverException)));
diff --git a/src/oat/utils/x86/assembler_x86.h b/src/oat/utils/x86/assembler_x86.h
index c8edf44..7291211 100644
--- a/src/oat/utils/x86/assembler_x86.h
+++ b/src/oat/utils/x86/assembler_x86.h
@@ -598,7 +598,7 @@
// Generate code to check if Thread::Current()->exception_ is non-null
// and branch to a ExceptionSlowPath if it is.
- virtual void ExceptionPoll(ManagedRegister scratch);
+ virtual void ExceptionPoll(ManagedRegister scratch, size_t stack_adjust);
private:
inline void EmitUint8(uint8_t value);
@@ -650,8 +650,10 @@
// Slowpath entered when Thread::Current()->_exception is non-null
class X86ExceptionSlowPath : public SlowPath {
public:
- X86ExceptionSlowPath() {}
+ X86ExceptionSlowPath(size_t stack_adjust) : stack_adjust_(stack_adjust) {}
virtual void Emit(Assembler *sp_asm);
+ private:
+ const size_t stack_adjust_;
};
// Slowpath entered when Thread::Current()->_suspend_count is non-zero