< prev index next >
src/cpu/x86/vm/macroAssembler_x86.cpp
Print this page
*** 37,46 ****
--- 37,47 ----
#include "runtime/interfaceSupport.hpp"
#include "runtime/objectMonitor.hpp"
#include "runtime/os.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
+ #include "runtime/thread.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1SATBCardTableModRefBS.hpp"
#include "gc/g1/heapRegion.hpp"
*** 9116,9120 ****
--- 9117,9157 ----
}
SkipIfEqual::~SkipIfEqual() {
_masm->bind(_label);
}
+
+ // 32-bit Windows has its own fast-path implementation
+ // of get_thread
+ #if !defined(WIN32) || defined(_LP64)
+
+ // This is simply a call to Thread::current()
+ void MacroAssembler::get_thread(Register thread) {
+ if (thread != rax) {
+ push(rax);
+ }
+ LP64_ONLY(push(rdi);)
+ LP64_ONLY(push(rsi);)
+ push(rdx);
+ push(rcx);
+ LP64_ONLY(push(r8);)
+ LP64_ONLY(push(r9);)
+ LP64_ONLY(push(r10);)
+ LP64_ONLY(push(r11);)
+
+ call(RuntimeAddress(CAST_FROM_FN_PTR(address, Thread::current)));
+
+ LP64_ONLY(pop(r11);)
+ LP64_ONLY(pop(r10);)
+ LP64_ONLY(pop(r9);)
+ LP64_ONLY(pop(r8);)
+ pop(rcx);
+ pop(rdx);
+ LP64_ONLY(pop(rsi);)
+ LP64_ONLY(pop(rdi);)
+ if (thread != rax) {
+ mov(thread, rax);
+ pop(rax);
+ }
+ }
+
+ #endif
< prev index next >