Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java @ 5242:f46d82be6e19
ExceptionObjectNode is now lowered without XIR
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 13 Apr 2012 23:28:20 +0200 |
parents | f9aae727d035 |
children | 467de393651a |
rev | line source |
---|---|
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.hotspot.target.amd64; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
25 import static com.oracle.graal.hotspot.ri.HotSpotXirGenerator.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
26 import static com.oracle.max.asm.target.amd64.AMD64.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
27 import static com.oracle.max.cri.ci.CiCallingConvention.Type.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
28 import static com.oracle.max.cri.ci.CiValueUtil.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
30 import java.lang.reflect.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
31 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
32 import com.oracle.graal.compiler.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
33 import com.oracle.graal.compiler.gen.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
34 import com.oracle.graal.compiler.target.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
35 import com.oracle.graal.compiler.target.amd64.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
36 import com.oracle.graal.graph.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
37 import com.oracle.graal.hotspot.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
38 import com.oracle.graal.hotspot.ri.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
39 import com.oracle.graal.lir.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
40 import com.oracle.graal.lir.amd64.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
41 import com.oracle.graal.lir.asm.*; |
5236
f9aae727d035
removed XIR safepoint operation
Doug Simon <doug.simon@oracle.com>
parents:
5235
diff
changeset
|
42 import com.oracle.graal.nodes.*; |
5242
f46d82be6e19
ExceptionObjectNode is now lowered without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5236
diff
changeset
|
43 import com.oracle.graal.nodes.java.*; |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
44 import com.oracle.max.asm.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
45 import com.oracle.max.asm.target.amd64.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
46 import com.oracle.max.asm.target.amd64.AMD64Assembler.ConditionFlag; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
47 import com.oracle.max.cri.ci.*; |
5235
15c857decc43
fixed bug in call to unwindExceptionStub (exceptionOop arg was not be passed correctly)
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
48 import com.oracle.max.cri.ci.CiCallingConvention.Type; |
15c857decc43
fixed bug in call to unwindExceptionStub (exceptionOop arg was not be passed correctly)
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
49 import com.oracle.max.cri.ci.CiRegister.*; |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
50 import com.oracle.max.cri.ri.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
51 import com.oracle.max.cri.xir.*; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
52 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
53 public class HotSpotAMD64Backend extends Backend { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
54 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
55 public HotSpotAMD64Backend(RiRuntime runtime, CiTarget target) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
56 super(runtime, target); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
57 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
58 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
59 @Override |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
60 public LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir) { |
5236
f9aae727d035
removed XIR safepoint operation
Doug Simon <doug.simon@oracle.com>
parents:
5235
diff
changeset
|
61 return new AMD64LIRGenerator(graph, runtime, target, frameMap, method, lir, xir) { |
f9aae727d035
removed XIR safepoint operation
Doug Simon <doug.simon@oracle.com>
parents:
5235
diff
changeset
|
62 @Override |
f9aae727d035
removed XIR safepoint operation
Doug Simon <doug.simon@oracle.com>
parents:
5235
diff
changeset
|
63 public void visitLoopEnd(LoopEndNode x) { |
f9aae727d035
removed XIR safepoint operation
Doug Simon <doug.simon@oracle.com>
parents:
5235
diff
changeset
|
64 if (GraalOptions.GenLoopSafepoints && x.hasSafepointPolling()) { |
f9aae727d035
removed XIR safepoint operation
Doug Simon <doug.simon@oracle.com>
parents:
5235
diff
changeset
|
65 LIRDebugInfo info = state(); |
f9aae727d035
removed XIR safepoint operation
Doug Simon <doug.simon@oracle.com>
parents:
5235
diff
changeset
|
66 if (!info.topFrame.method.noSafepointPolls()) { |
f9aae727d035
removed XIR safepoint operation
Doug Simon <doug.simon@oracle.com>
parents:
5235
diff
changeset
|
67 append(new AMD64SafepointOp(info, ((HotSpotRuntime) runtime).config)); |
f9aae727d035
removed XIR safepoint operation
Doug Simon <doug.simon@oracle.com>
parents:
5235
diff
changeset
|
68 } |
f9aae727d035
removed XIR safepoint operation
Doug Simon <doug.simon@oracle.com>
parents:
5235
diff
changeset
|
69 } |
f9aae727d035
removed XIR safepoint operation
Doug Simon <doug.simon@oracle.com>
parents:
5235
diff
changeset
|
70 } |
5242
f46d82be6e19
ExceptionObjectNode is now lowered without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5236
diff
changeset
|
71 @Override |
f46d82be6e19
ExceptionObjectNode is now lowered without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5236
diff
changeset
|
72 public void visitExceptionObject(ExceptionObjectNode x) { |
f46d82be6e19
ExceptionObjectNode is now lowered without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5236
diff
changeset
|
73 HotSpotVMConfig config = ((HotSpotRuntime) runtime).config; |
f46d82be6e19
ExceptionObjectNode is now lowered without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5236
diff
changeset
|
74 CiRegisterValue thread = r15.asValue(); |
f46d82be6e19
ExceptionObjectNode is now lowered without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5236
diff
changeset
|
75 CiAddress exceptionAddress = new CiAddress(CiKind.Object, thread, config.threadExceptionOopOffset); |
f46d82be6e19
ExceptionObjectNode is now lowered without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5236
diff
changeset
|
76 CiAddress pcAddress = new CiAddress(CiKind.Long, thread, config.threadExceptionPcOffset); |
f46d82be6e19
ExceptionObjectNode is now lowered without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5236
diff
changeset
|
77 CiValue exception = emitLoad(exceptionAddress, false); |
f46d82be6e19
ExceptionObjectNode is now lowered without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5236
diff
changeset
|
78 emitStore(exceptionAddress, CiConstant.NULL_OBJECT, false); |
f46d82be6e19
ExceptionObjectNode is now lowered without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5236
diff
changeset
|
79 emitStore(pcAddress, CiConstant.LONG_0, false); |
f46d82be6e19
ExceptionObjectNode is now lowered without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5236
diff
changeset
|
80 setResult(x, exception); |
f46d82be6e19
ExceptionObjectNode is now lowered without XIR
Doug Simon <doug.simon@oracle.com>
parents:
5236
diff
changeset
|
81 } |
5236
f9aae727d035
removed XIR safepoint operation
Doug Simon <doug.simon@oracle.com>
parents:
5235
diff
changeset
|
82 }; |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
83 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
84 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
85 @Override |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
86 public AMD64XirAssembler newXirAssembler() { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
87 return new AMD64XirAssembler(target); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
88 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
89 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
90 class HotSpotFrameContext implements FrameContext { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
91 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
92 private final LIR lir; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
93 private boolean needsLeave; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
94 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
95 public HotSpotFrameContext(LIR lir) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
96 this.lir = lir; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
97 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
98 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
99 @Override |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
100 public void enter(TargetMethodAssembler tasm) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
101 FrameMap frameMap = tasm.frameMap; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
102 int frameSize = frameMap.frameSize(); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
103 if (frameSize != 0) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
104 AMD64MacroAssembler asm = (AMD64MacroAssembler) tasm.asm; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
105 emitStackOverflowCheck(tasm, lir, false); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
106 asm.push(rbp); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
107 asm.movq(rbp, rsp); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
108 asm.decrementq(rsp, frameSize - 8); // account for the push of RBP above |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
109 if (GraalOptions.ZapStackOnMethodEntry) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
110 final int intSize = 4; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
111 for (int i = 0; i < frameSize / intSize; ++i) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
112 asm.movl(new CiAddress(CiKind.Int, rsp.asValue(), i * intSize), 0xC1C1C1C1); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
113 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
114 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
115 CiCalleeSaveLayout csl = frameMap.registerConfig.getCalleeSaveLayout(); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
116 if (csl != null && csl.size != 0) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
117 int frameToCSA = frameMap.offsetToCalleeSaveArea(); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
118 assert frameToCSA >= 0; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
119 asm.save(csl, frameToCSA); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
120 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
121 needsLeave = true; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
122 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
123 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
124 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
125 @Override |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
126 public void leave(TargetMethodAssembler tasm) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
127 if (!needsLeave) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
128 return; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
129 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
130 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
131 int frameSize = tasm.frameMap.frameSize(); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
132 AMD64MacroAssembler asm = (AMD64MacroAssembler) tasm.asm; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
133 CiCalleeSaveLayout csl = tasm.frameMap.registerConfig.getCalleeSaveLayout(); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
134 RiRegisterConfig regConfig = tasm.frameMap.registerConfig; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
135 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
136 if (csl != null && csl.size != 0) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
137 tasm.targetMethod.setRegisterRestoreEpilogueOffset(asm.codeBuffer.position()); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
138 // saved all registers, restore all registers |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
139 int frameToCSA = tasm.frameMap.offsetToCalleeSaveArea(); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
140 asm.restore(csl, frameToCSA); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
141 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
142 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
143 asm.incrementq(rsp, frameSize - 8); // account for the pop of RBP below |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
144 asm.pop(rbp); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
145 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
146 if (GraalOptions.GenSafepoints) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
147 HotSpotVMConfig config = ((HotSpotRuntime) runtime).config; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
148 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
149 // If at the return point, then the frame has already been popped |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
150 // so deoptimization cannot be performed here. The HotSpot runtime |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
151 // detects this case - see the definition of frame::should_be_deoptimized() |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
152 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
153 CiRegister scratch = regConfig.getScratchRegister(); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
154 if (config.isPollingPageFar) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
155 asm.movq(scratch, config.safepointPollingAddress); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
156 tasm.recordMark(MARK_POLL_RETURN_FAR); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
157 asm.movq(scratch, new CiAddress(tasm.target.wordKind, scratch.asValue())); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
158 } else { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
159 tasm.recordMark(MARK_POLL_RETURN_NEAR); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
160 asm.movq(scratch, new CiAddress(tasm.target.wordKind, rip.asValue())); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
161 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
162 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
163 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
164 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
165 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
166 @Override |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
167 public TargetMethodAssembler newAssembler(FrameMap frameMap, LIR lir) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
168 AbstractAssembler masm = new AMD64MacroAssembler(target, frameMap.registerConfig); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
169 HotSpotFrameContext frameContext = new HotSpotFrameContext(lir); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
170 TargetMethodAssembler tasm = new TargetMethodAssembler(target, runtime, frameMap, masm, frameContext); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
171 tasm.setFrameSize(frameMap.frameSize()); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
172 tasm.targetMethod.setCustomStackAreaOffset(frameMap.offsetToCustomArea()); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
173 return tasm; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
174 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
175 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
176 @Override |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
177 public void emitCode(TargetMethodAssembler tasm, RiResolvedMethod method, LIR lir) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
178 AMD64MacroAssembler asm = (AMD64MacroAssembler) tasm.asm; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
179 FrameMap frameMap = tasm.frameMap; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
180 RiRegisterConfig regConfig = frameMap.registerConfig; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
181 HotSpotVMConfig config = ((HotSpotRuntime) runtime).config; |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
182 Label unverifiedStub = new Label(); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
183 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
184 // Emit the prefix |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
185 tasm.recordMark(MARK_OSR_ENTRY); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
186 tasm.recordMark(MARK_UNVERIFIED_ENTRY); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
187 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
188 boolean isStatic = Modifier.isStatic(method.accessFlags()); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
189 if (!isStatic) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
190 CiCallingConvention cc = regConfig.getCallingConvention(JavaCallee, new CiKind[] {CiKind.Object}, target, false); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
191 CiRegister inlineCacheKlass = rax; // see definition of IC_Klass in c1_LIRAssembler_x86.cpp |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
192 CiRegister receiver = asRegister(cc.locations[0]); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
193 CiAddress src = new CiAddress(target.wordKind, receiver.asValue(), config.hubOffset); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
194 |
5235
15c857decc43
fixed bug in call to unwindExceptionStub (exceptionOop arg was not be passed correctly)
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
195 asm.cmpq(inlineCacheKlass, src); |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
196 asm.jcc(ConditionFlag.notEqual, unverifiedStub); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
197 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
198 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
199 asm.align(config.codeEntryAlignment); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
200 tasm.recordMark(MARK_VERIFIED_ENTRY); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
201 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
202 // Emit code for the LIR |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
203 lir.emitCode(tasm); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
204 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
205 // Emit the suffix (i.e. out-of-line stubs) |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
206 CiRegister thread = r15; |
5235
15c857decc43
fixed bug in call to unwindExceptionStub (exceptionOop arg was not be passed correctly)
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
207 CiRegister exceptionOop = regConfig.getCallingConventionRegisters(Type.RuntimeCall, RegisterFlag.CPU)[0]; |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
208 Label unwind = new Label(); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
209 asm.bind(unwind); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
210 tasm.recordMark(MARK_UNWIND_ENTRY); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
211 CiAddress exceptionOopField = new CiAddress(CiKind.Object, thread.asValue(), config.threadExceptionOopOffset); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
212 CiAddress exceptionPcField = new CiAddress(CiKind.Object, thread.asValue(), config.threadExceptionPcOffset); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
213 asm.movq(exceptionOop, exceptionOopField); |
5235
15c857decc43
fixed bug in call to unwindExceptionStub (exceptionOop arg was not be passed correctly)
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
214 asm.movslq(exceptionOopField, 0); |
15c857decc43
fixed bug in call to unwindExceptionStub (exceptionOop arg was not be passed correctly)
Doug Simon <doug.simon@oracle.com>
parents:
5233
diff
changeset
|
215 asm.movslq(exceptionPcField, 0); |
5233
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
216 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
217 AMD64Call.directCall(tasm, asm, config.unwindExceptionStub, null); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
218 AMD64Call.shouldNotReachHere(tasm, asm); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
219 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
220 tasm.recordMark(MARK_EXCEPTION_HANDLER_ENTRY); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
221 AMD64Call.directCall(tasm, asm, config.handleExceptionStub, null); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
222 AMD64Call.shouldNotReachHere(tasm, asm); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
223 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
224 tasm.recordMark(MARK_DEOPT_HANDLER_ENTRY); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
225 AMD64Call.directCall(tasm, asm, config.handleDeoptStub, null); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
226 AMD64Call.shouldNotReachHere(tasm, asm); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
227 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
228 if (!isStatic) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
229 asm.bind(unverifiedStub); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
230 AMD64Call.directJmp(tasm, asm, config.inlineCacheMissStub); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
231 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
232 |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
233 for (int i = 0; i < GraalOptions.MethodEndBreakpointGuards; ++i) { |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
234 asm.int3(); |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
235 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
236 } |
efbb1e33e2f3
removed XIR prologue and epilogues - architecture and runtime specific subclass of Backend is now used instead
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
237 } |