Path: blob/master/src/hotspot/os_cpu/windows_x86/assembler_windows_x86.cpp
40930 views
/*1* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "asm/macroAssembler.hpp"26#include "asm/macroAssembler.inline.hpp"27#include "runtime/os.hpp"2829void MacroAssembler::int3() {30emit_int8((unsigned char)0xCC);31}3233#ifndef _LP6434// The current scheme to accelerate access to the thread35// pointer is to store the current thread in the os_exception_wrapper36// and reference the current thread from stubs and compiled code37// via the FS register. FS[0] contains a pointer to the structured38// exception block which is actually a stack address. The first time39// we call the os exception wrapper, we calculate and store the40// offset from this exception block and use that offset here.41//42// The last mechanism we used was problematic in that the43// the offset we had hard coded in the VM kept changing as Microsoft44// evolved the OS.45//46// Warning: This mechanism assumes that we only attempt to get the47// thread when we are nested below a call wrapper.48//49// movl reg, fs:[0] Get exeception pointer50// movl reg, [reg + thread_ptr_offset] Load thread51//52void MacroAssembler::get_thread(Register thread) {53prefix(FS_segment);54movptr(thread, ExternalAddress(NULL));55assert(os::win32::get_thread_ptr_offset() != 0,56"Thread Pointer Offset has not been initialized");57movl(thread, Address(thread, os::win32::get_thread_ptr_offset()));58}5960// #else - use shared x86 implementation in cpu/x86/vm/macroAssembler_x86.cpp6162#endif636465