1 /*
2 * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
168 __ bind(L);
169 }
170 #endif // ASSERT
171
172 // Restore bcp under the assumption that the current frame is still
173 // interpreted
174 __ restore_bcp();
175
176 // expression stack must be empty before entering the VM if an exception
177 // happened
178 __ empty_expression_stack();
179
180 // throw exception
181 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_StackOverflowError));
182
183 __ should_not_reach_here();
184
185 return entry;
186 }
187
188 address TemplateInterpreterGenerator::generate_ArrayIndexOutOfBounds_handler(const char* name) {
189 address entry = __ pc();
190
191 // index is in R4_ArrayIndexOutOfBounds_index
192
193 InlinedString Lname(name);
194
195 // expression stack must be empty before entering the VM if an exception happened
196 __ empty_expression_stack();
197
198 // setup parameters
199 __ ldr_literal(R1, Lname);
200 __ mov(R2, R4_ArrayIndexOutOfBounds_index);
201
202 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException), R1, R2);
203
204 __ nop(); // to avoid filling CPU pipeline with invalid instructions
205 __ nop();
206 __ should_not_reach_here();
207 __ bind_literal(Lname);
208
209 return entry;
210 }
211
212 address TemplateInterpreterGenerator::generate_ClassCastException_handler() {
213 address entry = __ pc();
214
215 // object is in R2_ClassCastException_obj
216
217 // expression stack must be empty before entering the VM if an exception
218 // happened
219 __ empty_expression_stack();
|
1 /*
2 * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
168 __ bind(L);
169 }
170 #endif // ASSERT
171
172 // Restore bcp under the assumption that the current frame is still
173 // interpreted
174 __ restore_bcp();
175
176 // expression stack must be empty before entering the VM if an exception
177 // happened
178 __ empty_expression_stack();
179
180 // throw exception
181 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_StackOverflowError));
182
183 __ should_not_reach_here();
184
185 return entry;
186 }
187
188 address TemplateInterpreterGenerator::generate_ArrayIndexOutOfBounds_handler() {
189 address entry = __ pc();
190
191 // index is in R4_ArrayIndexOutOfBounds_index
192
193 // expression stack must be empty before entering the VM if an exception happened
194 __ empty_expression_stack();
195
196 // setup parameters
197 // Array expected in R1.
198 __ mov(R2, R4_ArrayIndexOutOfBounds_index);
199
200 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException), R1, R2);
201
202 __ nop(); // to avoid filling CPU pipeline with invalid instructions
203 __ nop();
204 __ should_not_reach_here();
205 __ bind_literal(Lname);
206
207 return entry;
208 }
209
210 address TemplateInterpreterGenerator::generate_ClassCastException_handler() {
211 address entry = __ pc();
212
213 // object is in R2_ClassCastException_obj
214
215 // expression stack must be empty before entering the VM if an exception
216 // happened
217 __ empty_expression_stack();
|