runtime_sparc.cpp revision 1487
1487N/A * Copyright 1998-2010 Sun Microsystems, Inc. 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. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A#
include "incls/_precompiled.incl" 0N/A//------------------------------ generate_exception_blob --------------------------- 0N/A// creates exception blob at the end 0N/A// Using exception blob, this code is jumped from a compiled method. 0N/A// (see emit_exception_handler in sparc.ad file) 0N/A// Given an exception pc at a call we call into the runtime for the 0N/A// handler in this method. This handler might merely restore state 0N/A// (i.e. callee save registers) unwind the frame and jump to the 0N/A// exception handler for the nmethod if there is no Java level handler 0N/A// This code is entered with a jmp. 0N/A// O1: exception pc in caller or ??? 0N/A// destination: exception handler of caller 0N/A// Note: the exception pc MUST be at a call (precise debug information) 0N/A // allocate space for code 0N/A // setup code generation tools 0N/A // Measured 8/7/03 at 256 in 32bit debug build (no VerifyThread) 0N/A // Measured 8/7/03 at 528 in 32bit debug build (VerifyThread) 0N/A // This call does all the hard work. It checks if an exception catch 0N/A // exists in the method. 0N/A // If so, it returns the handler address. 0N/A // If the nmethod has been deoptimized and it had a handler the handler 0N/A // address is the deopt blob unpack_with_exception entry. 0N/A // If no handler exists it prepares for stack-unwinding, restoring the callee-save 0N/A // registers of the frame being removed. 0N/A // This call can block at exit and nmethod can be deoptimized at that 0N/A // point. If the nmethod had a catch point we would jump to the 0N/A // now deoptimized catch point and fall thru the vanilla deopt 0N/A // path and lose the exception 0N/A // Sure would be simpler if this call didn't block! 0N/A // Set an oopmap for the call site. This oopmap will only be used if we 0N/A // are unwinding the stack. Hence, all locations will be dead. 0N/A // Callee-saved registers will be the same as the frame above (i.e., 0N/A // handle_exception_stub), since they were restored when we got the 1487N/A // Restore SP from L7 if the exception PC is a MethodHandle call site. 0N/A // G3_scratch contains handler address 0N/A // Since this may be the deopt blob we must set O7 to look like we returned 0N/A // from the original pc that threw the exception 0N/A // Clear the exception oop so GC no longer processes it as a root. 0N/A // make sure all code is generated