1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2012, 2014 SAP AG. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
384 // pending exception stored in JavaThread that can be tested from
385 // within the VM.
386 //
387 address generate_catch_exception() {
388 StubCodeMark mark(this, "StubRoutines", "catch_exception");
389
390 address start = __ pc();
391
392 // Registers alive
393 //
394 // R16_thread
395 // R3_ARG1 - address of pending exception
396 // R4_ARG2 - return address in call stub
397
398 const Register exception_file = R21_tmp1;
399 const Register exception_line = R22_tmp2;
400
401 __ load_const(exception_file, (void*)__FILE__);
402 __ load_const(exception_line, (void*)__LINE__);
403
404 __ std(R3_ARG1, thread_(pending_exception));
405 // store into `char *'
406 __ std(exception_file, thread_(exception_file));
407 // store into `int'
408 __ stw(exception_line, thread_(exception_line));
409
410 // complete return to VM
411 assert(StubRoutines::_call_stub_return_address != NULL, "must have been generated before");
412
413 __ mtlr(R4_ARG2);
414 // continue in call stub
415 __ blr();
416
417 return start;
418 }
419
420 // Continuation point for runtime calls returning with a pending
421 // exception. The pending exception check happened in the runtime
422 // or native call stub. The pending exception in Thread is
423 // converted into a Java-level exception.
424 //
425 address generate_forward_exception() {
426 StubCodeMark mark(this, "StubRoutines", "forward_exception");
427 address start = __ pc();
428
|
1 /*
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2012, 2014 SAP AG. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
384 // pending exception stored in JavaThread that can be tested from
385 // within the VM.
386 //
387 address generate_catch_exception() {
388 StubCodeMark mark(this, "StubRoutines", "catch_exception");
389
390 address start = __ pc();
391
392 // Registers alive
393 //
394 // R16_thread
395 // R3_ARG1 - address of pending exception
396 // R4_ARG2 - return address in call stub
397
398 const Register exception_file = R21_tmp1;
399 const Register exception_line = R22_tmp2;
400
401 __ load_const(exception_file, (void*)__FILE__);
402 __ load_const(exception_line, (void*)__LINE__);
403
404 __ std(R3_ARG1, in_bytes(JavaThread::pending_exception_offset()), R16_thread);
405 // store into `char *'
406 __ std(exception_file, in_bytes(JavaThread::exception_file_offset()), R16_thread);
407 // store into `int'
408 __ stw(exception_line, in_bytes(JavaThread::exception_line_offset()), R16_thread);
409
410 // complete return to VM
411 assert(StubRoutines::_call_stub_return_address != NULL, "must have been generated before");
412
413 __ mtlr(R4_ARG2);
414 // continue in call stub
415 __ blr();
416
417 return start;
418 }
419
420 // Continuation point for runtime calls returning with a pending
421 // exception. The pending exception check happened in the runtime
422 // or native call stub. The pending exception in Thread is
423 // converted into a Java-level exception.
424 //
425 address generate_forward_exception() {
426 StubCodeMark mark(this, "StubRoutines", "forward_exception");
427 address start = __ pc();
428
|