Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java @ 21673:5024c80224c7
moved com.oracle.graal.[amd64|sparc] to com.oracle.jvmci.[amd64|sparc] (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 02 Jun 2015 22:11:52 +0200 |
parents | 48c1ebd24120 |
children | 6df25b1418be |
rev | line source |
---|---|
15104 | 1 /* |
2 * Copyright (c) 2013, 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 */ | |
23 package com.oracle.graal.hotspot.amd64; | |
24 | |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21551
diff
changeset
|
25 import com.oracle.jvmci.code.Register; |
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21551
diff
changeset
|
26 import com.oracle.jvmci.meta.AllocatableValue; |
21673
5024c80224c7
moved com.oracle.graal.[amd64|sparc] to com.oracle.jvmci.[amd64|sparc] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21556
diff
changeset
|
27 |
5024c80224c7
moved com.oracle.graal.[amd64|sparc] to com.oracle.jvmci.[amd64|sparc] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21556
diff
changeset
|
28 import static com.oracle.jvmci.amd64.AMD64.*; |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21551
diff
changeset
|
29 import static com.oracle.jvmci.code.ValueUtil.*; |
15104 | 30 import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; |
31 | |
32 import com.oracle.graal.asm.amd64.*; | |
33 import com.oracle.graal.lir.*; | |
34 import com.oracle.graal.lir.amd64.*; | |
35 import com.oracle.graal.lir.asm.*; | |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21526
diff
changeset
|
36 import com.oracle.jvmci.hotspot.*; |
15104 | 37 |
38 /** | |
39 * Pushes an interpreter frame to the stack. | |
40 */ | |
41 @Opcode("PUSH_INTERPRETER_FRAME") | |
42 final class AMD64HotSpotPushInterpreterFrameOp extends AMD64LIRInstruction { | |
19529
8fc336a04d77
Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18525
diff
changeset
|
43 public static final LIRInstructionClass<AMD64HotSpotPushInterpreterFrameOp> TYPE = LIRInstructionClass.create(AMD64HotSpotPushInterpreterFrameOp.class); |
15104 | 44 |
45 @Alive(REG) AllocatableValue frameSize; | |
46 @Alive(REG) AllocatableValue framePc; | |
47 @Alive(REG) AllocatableValue senderSp; | |
48 @Alive(REG) AllocatableValue initialInfo; | |
18525
be44c1ca8f00
removed static access to HotSpotGraalRuntime from some AMD64 HotSpot classes
Doug Simon <doug.simon@oracle.com>
parents:
15104
diff
changeset
|
49 private final HotSpotVMConfig config; |
15104 | 50 |
18525
be44c1ca8f00
removed static access to HotSpotGraalRuntime from some AMD64 HotSpot classes
Doug Simon <doug.simon@oracle.com>
parents:
15104
diff
changeset
|
51 AMD64HotSpotPushInterpreterFrameOp(AllocatableValue frameSize, AllocatableValue framePc, AllocatableValue senderSp, AllocatableValue initialInfo, HotSpotVMConfig config) { |
19529
8fc336a04d77
Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18525
diff
changeset
|
52 super(TYPE); |
15104 | 53 this.frameSize = frameSize; |
54 this.framePc = framePc; | |
55 this.senderSp = senderSp; | |
56 this.initialInfo = initialInfo; | |
18525
be44c1ca8f00
removed static access to HotSpotGraalRuntime from some AMD64 HotSpot classes
Doug Simon <doug.simon@oracle.com>
parents:
15104
diff
changeset
|
57 this.config = config; |
15104 | 58 } |
59 | |
60 @Override | |
61 public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { | |
62 final Register frameSizeRegister = asRegister(frameSize); | |
63 final Register framePcRegister = asRegister(framePc); | |
64 final Register senderSpRegister = asRegister(senderSp); | |
65 final Register initialInfoRegister = asRegister(initialInfo); | |
18525
be44c1ca8f00
removed static access to HotSpotGraalRuntime from some AMD64 HotSpot classes
Doug Simon <doug.simon@oracle.com>
parents:
15104
diff
changeset
|
66 final int wordSize = 8; |
15104 | 67 |
68 // We'll push PC and BP by hand. | |
69 masm.subq(frameSizeRegister, 2 * wordSize); | |
70 | |
71 // Push return address. | |
72 masm.push(framePcRegister); | |
73 | |
74 // Prolog | |
75 masm.push(initialInfoRegister); | |
76 masm.movq(initialInfoRegister, rsp); | |
77 masm.subq(rsp, frameSizeRegister); | |
78 | |
79 // This value is corrected by layout_activation_impl. | |
80 masm.movptr(new AMD64Address(initialInfoRegister, config.frameInterpreterFrameLastSpOffset * wordSize), 0); | |
81 | |
82 // Make the frame walkable. | |
83 masm.movq(new AMD64Address(initialInfoRegister, config.frameInterpreterFrameSenderSpOffset * wordSize), senderSpRegister); | |
84 } | |
85 } |