annotate graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java @ 10854:e1fcdda22831

SPARC: can compile some stubs now but they don't work yet
author twisti
date Mon, 22 Jul 2013 22:26:49 -0700
parents
children 5124eeec1a7b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
1 /*
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
4 *
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
7 * published by the Free Software Foundation.
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
8 *
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
13 * accompanied this code).
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
14 *
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
18 *
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
21 * questions.
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
22 */
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
23 package com.oracle.graal.hotspot.sparc;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
24
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
25 import static com.oracle.graal.asm.sparc.SPARCMacroAssembler.*;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
26 import static com.oracle.graal.sparc.SPARC.*;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
27 import static com.oracle.graal.api.code.ValueUtil.*;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
28 import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
29 import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
30
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
31 import com.oracle.graal.api.code.*;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
32 import com.oracle.graal.api.meta.*;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
33 import com.oracle.graal.asm.sparc.*;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
34 import com.oracle.graal.lir.*;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
35 import com.oracle.graal.lir.asm.*;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
36
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
37 /**
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
38 * Sets up the arguments for an exception handler in the callers frame, removes the current frame
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
39 * and jumps to the handler.
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
40 */
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
41 @Opcode("JUMP_TO_EXCEPTION_HANDLER_IN_CALLER")
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
42 final class SPARCHotSpotJumpToExceptionHandlerInCallerOp extends SPARCHotSpotEpilogueOp {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
43
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
44 @Use(REG) AllocatableValue handlerInCallerPc;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
45 @Use(REG) AllocatableValue exception;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
46 @Use(REG) AllocatableValue exceptionPc;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
47
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
48 SPARCHotSpotJumpToExceptionHandlerInCallerOp(AllocatableValue handlerInCallerPc, AllocatableValue exception, AllocatableValue exceptionPc) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
49 this.handlerInCallerPc = handlerInCallerPc;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
50 this.exception = exception;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
51 this.exceptionPc = exceptionPc;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
52 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
53
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
54 @Override
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
55 public void emitCode(TargetMethodAssembler tasm, SPARCMacroAssembler masm) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
56 leaveFrame(tasm);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
57
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
58 // Restore SP from L7 if the exception PC is a method handle call site.
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
59 Register thread = graalRuntime().getRuntime().threadRegister();
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
60 int isMethodHandleReturnOffset = graalRuntime().getConfig().threadIsMethodHandleReturnOffset;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
61 SPARCAddress dst = new SPARCAddress(thread, isMethodHandleReturnOffset);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
62 new Lduw(dst, o7).emit(masm);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
63 new Cmp(o7, o7).emit(masm);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
64 new Movcc(ConditionFlag.NotZero, CC.Icc, l7, sp).emit(masm);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
65
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
66 new Jmpl(asRegister(handlerInCallerPc), 0, g0).emit(masm);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
67 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents:
diff changeset
68 }