42 // the offset we had hard coded in the VM kept changing as Microsoft
43 // evolved the OS.
44 //
45 // Warning: This mechanism assumes that we only attempt to get the
46 // thread when we are nested below a call wrapper.
47 //
48 // movl reg, fs:[0] Get exeception pointer
49 // movl reg, [reg + thread_ptr_offset] Load thread
50 //
51 void MacroAssembler::get_thread(Register thread) {
52 // can't use ExternalAddress because it can't take NULL
53 AddressLiteral null(0, relocInfo::none);
54
55 prefix(FS_segment);
56 movptr(thread, null);
57 assert(ThreadLocalStorage::get_thread_ptr_offset() != 0,
58 "Thread Pointer Offset has not been initialized");
59 movl(thread, Address(thread, ThreadLocalStorage::get_thread_ptr_offset()));
60 }
61
62 bool MacroAssembler::needs_explicit_null_check(int offset) {
63 return offset < 0 || (int)os::vm_page_size() <= offset;
64 }
|
42 // the offset we had hard coded in the VM kept changing as Microsoft
43 // evolved the OS.
44 //
45 // Warning: This mechanism assumes that we only attempt to get the
46 // thread when we are nested below a call wrapper.
47 //
48 // movl reg, fs:[0] Get exeception pointer
49 // movl reg, [reg + thread_ptr_offset] Load thread
50 //
51 void MacroAssembler::get_thread(Register thread) {
52 // can't use ExternalAddress because it can't take NULL
53 AddressLiteral null(0, relocInfo::none);
54
55 prefix(FS_segment);
56 movptr(thread, null);
57 assert(ThreadLocalStorage::get_thread_ptr_offset() != 0,
58 "Thread Pointer Offset has not been initialized");
59 movl(thread, Address(thread, ThreadLocalStorage::get_thread_ptr_offset()));
60 }
61
62 bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
63 return offset < 0 || (int)os::vm_page_size() <= offset;
64 }
|