annotate c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java @ 1419:7bf6a77b9c5a

implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
author Lukas Stadler <lukas.stadler@oracle.com>
date Mon, 12 Jul 2010 15:05:17 -0700
parents 2c41834aa270
children 44efca8a02d6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
1 /*
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
2 * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
3 *
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
5 * that is described in this document. In particular, and without limitation, these intellectual property
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
6 * rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
7 * more additional patents or pending patent applications in the U.S. and in other countries.
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
8 *
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
9 * U.S. Government Rights - Commercial software. Government users are subject to the Sun
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
10 * Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
11 * supplements.
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
12 *
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
13 * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
14 * registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
15 * are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
16 * U.S. and other countries.
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
17 *
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
18 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
19 * Company, Ltd.
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
20 */
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
21 package com.sun.hotspot.c1x;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
22
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
23 import java.io.ByteArrayOutputStream;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
24 import java.io.OutputStream;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
25 import java.lang.reflect.Constructor;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
26 import java.lang.reflect.Field;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
27 import java.lang.reflect.Method;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
28
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
29 import com.sun.cri.ci.CiConstant;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
30 import com.sun.cri.ci.CiMethodInvokeArguments;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
31 import com.sun.cri.ci.CiTargetMethod;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
32 import com.sun.cri.ci.CiTargetMethod.Call;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
33 import com.sun.cri.ci.CiTargetMethod.DataPatch;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
34 import com.sun.cri.ci.CiTargetMethod.Safepoint;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
35 import com.sun.cri.ri.RiConstantPool;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
36 import com.sun.cri.ri.RiField;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
37 import com.sun.cri.ri.RiMethod;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
38 import com.sun.cri.ri.RiOsrFrame;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
39 import com.sun.cri.ri.RiRuntime;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
40 import com.sun.cri.ri.RiSnippets;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
41 import com.sun.cri.ri.RiType;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
42 import com.sun.max.asm.InstructionSet;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
43 import com.sun.max.asm.dis.DisassembledObject;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
44 import com.sun.max.asm.dis.Disassembler;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
45 import com.sun.max.asm.dis.DisassemblyPrinter;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
46
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
47 /**
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
48 *
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
49 * @author Thomas Wuerthinger
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
50 *
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
51 * CRI runtime implementation for the HotSpot VM.
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
52 *
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
53 */
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
54 public class HotSpotRuntime implements RiRuntime {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
55
1419
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
56 private final HotSpotVMConfig config;
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
57
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
58 public HotSpotRuntime(HotSpotVMConfig config) {
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
59 this.config = config;
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
60 }
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
61
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
62 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
63 public int basicObjectLockOffsetInBytes() {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
64 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
65 return 0;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
66 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
67
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
68 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
69 public int codeOffset() {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
70 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
71 return 0;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
72 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
73
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
74 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
75 public void codePrologue(RiMethod method, OutputStream out) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
76 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
77
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
78 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
79
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
80 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
81 public String disassemble(byte[] code) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
82 return disassemble(code, new DisassemblyPrinter(false));
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
83 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
84
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
85 private String disassemble(byte[] code, DisassemblyPrinter disassemblyPrinter) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
86 final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
87 final InstructionSet instructionSet = InstructionSet.AMD64;
1417
2c41834aa270 Small adaptations
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1416
diff changeset
88 Disassembler.disassemble(byteArrayOutputStream, code, instructionSet, null, 0, null, disassemblyPrinter);
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
89 return byteArrayOutputStream.toString();
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
90 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
91
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
92 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
93 public String disassemble(final CiTargetMethod targetMethod) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
94
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
95 final DisassemblyPrinter disassemblyPrinter = new DisassemblyPrinter(false) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
96
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
97 private String toString(Call call) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
98 if (call.runtimeCall != null) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
99 return "{" + call.runtimeCall.name() + "}";
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
100 } else if (call.symbol != null) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
101 return "{" + call.symbol + "}";
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
102 } else if (call.globalStubID != null) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
103 return "{" + call.globalStubID + "}";
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
104 } else {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
105 return "{" + call.method + "}";
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
106 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
107 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
108
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
109 private String siteInfo(int pcOffset) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
110 for (Call call : targetMethod.directCalls) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
111 if (call.pcOffset == pcOffset) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
112 return toString(call);
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
113 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
114 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
115 for (Call call : targetMethod.indirectCalls) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
116 if (call.pcOffset == pcOffset) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
117 return toString(call);
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
118 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
119 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
120 for (Safepoint site : targetMethod.safepoints) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
121 if (site.pcOffset == pcOffset) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
122 return "{safepoint}";
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
123 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
124 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
125 for (DataPatch site : targetMethod.dataReferences) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
126 if (site.pcOffset == pcOffset) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
127 return "{" + site.data + "}";
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
128 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
129 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
130 return null;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
131 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
132
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
133 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
134 protected String disassembledObjectString(Disassembler disassembler, DisassembledObject disassembledObject) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
135 final String string = super.disassembledObjectString(disassembler, disassembledObject);
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
136
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
137 String site = siteInfo(disassembledObject.startPosition());
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
138 if (site != null) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
139 return string + " " + site;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
140 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
141 return string;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
142 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
143 };
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
144 return disassemble(targetMethod.targetCode(), disassemblyPrinter);
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
145 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
146
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
147 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
148 public String disassemble(RiMethod method) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
149 return "No disassembler available";
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
150 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
151
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
152 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
153 public RiConstantPool getConstantPool(RiMethod method) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
154 return VMEntries.RiRuntime_getConstantPool(((HotSpotType)method.holder()).klassOop);
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
155 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
156
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
157 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
158 public RiOsrFrame getOsrFrame(RiMethod method, int bci) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
159 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
160 return null;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
161 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
162
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
163 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
164 public RiType getRiType(Class<?> javaClass) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
165 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
166 return null;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
167 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
168
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
169 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
170 public RiSnippets getSnippets() {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
171 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
172 return null;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
173 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
174
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
175 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
176 public boolean mustInline(RiMethod method) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
177 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
178 return false;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
179 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
180
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
181 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
182 public boolean mustNotCompile(RiMethod method) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
183 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
184 return false;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
185 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
186
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
187 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
188 public boolean mustNotInline(RiMethod method) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
189 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
190 return false;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
191 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
192
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
193 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
194 public Object registerTargetMethod(CiTargetMethod targetMethod, String name) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
195 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
196 return null;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
197 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
198
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
199 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
200 public int sizeofBasicObjectLock() {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
201 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
202 return 0;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
203 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
204
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
205 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
206 public RiField getRiField(Field javaField) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
207 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
208 return null;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
209 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
210
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
211 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
212 public RiMethod getRiMethod(Method javaMethod) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
213 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
214 return null;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
215 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
216
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
217 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
218 public RiMethod getRiMethod(Constructor<?> javaConstructor) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
219 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
220 return null;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
221 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
222
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
223 @Override
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
224 public CiConstant invoke(RiMethod method, CiMethodInvokeArguments args) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
225 // TODO Auto-generated method stub
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
226 return null;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
227 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
228
1417
2c41834aa270 Small adaptations
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1416
diff changeset
229 @Override
2c41834aa270 Small adaptations
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1416
diff changeset
230 public CiConstant foldWordOperation(int opcode, CiMethodInvokeArguments args) {
2c41834aa270 Small adaptations
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1416
diff changeset
231 // TODO Auto-generated method stub
2c41834aa270 Small adaptations
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1416
diff changeset
232 return null;
2c41834aa270 Small adaptations
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1416
diff changeset
233 }
2c41834aa270 Small adaptations
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1416
diff changeset
234
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
235 }