2539N/A * Copyright (c) 1998, 2011, 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//------------------------------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// 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// rdx: 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// Only register rax, rdx, rcx are not callee saved. 0N/A // Capture info about frame layout 0N/A // The frame sender code expects that rbp will be in the "natural" place and 0N/A // will override any oopMap setting for it. We must therefore force the layout 0N/A // so that it agrees with the frame sender code. 0N/A // allocate space for the code 0N/A // setup code generation tools 0N/A // rbp, location is implicitly known 0N/A // Store exception in Thread object. We cannot pass any arguments to the 0N/A // handle_exception call, since we do not want to make any assumption 0N/A // about the size of the frame where the exception happened in. 0N/A // This call does all the hard work. It checks if an exception handler 0N/A // exists in the method. 0N/A // If so, it returns the handler address. 0N/A // If not, it prepares for stack-unwinding, restoring the callee-save 0N/A // registers of the frame being removed. 0N/A // No registers to map, rbp is known implicitly 0N/A // Restore callee-saved registers 1368N/A // Restore SP from BP if the exception PC is a MethodHandle call site. 0N/A // We have a handler in rax, (could be deopt blob) 0N/A // rdx - throwing pc, deopt blob will need it. 0N/A // Get the exception 0N/A // Get the exception pc in case we are deoptimized 0N/A // Clear the exception oop so GC no longer processes it as a root. 0N/A // rcx: exception handler 0N/A // rdx: exception pc 0N/A // make sure all code is generated