1879N/A * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// The current scheme to accelerate access to the thread 0N/A// pointer is to store the current thread in the os_exception_wrapper 0N/A// and reference the current thread from stubs and compiled code 0N/A// via the FS register. FS[0] contains a pointer to the structured 0N/A// exception block which is actually a stack address. The first time 0N/A// we call the os exception wrapper, we calculate and store the 0N/A// offset from this exception block and use that offset here. 0N/A// The last mechanism we used was problematic in that the 0N/A// the offset we had hard coded in the VM kept changing as Microsoft 0N/A// Warning: This mechanism assumes that we only attempt to get the 0N/A// thread when we are nested below a call wrapper. 0N/A// movl reg, fs:[0] Get exeception pointer 0N/A// movl reg, [reg + thread_ptr_offset] Load thread 0N/A // can't use ExternalAddress because it can't take NULL 0N/A "Thread Pointer Offset has not been initialized");
304N/A// call (Thread*)TlsGetValue(thread_index());