comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodResolved.java @ 1433:efba53f86c4f

various fixes and enhancements * correct refmap->oopmap conversion (register numbering, stack slot numbering) * fixes for inlining (correct scoping in exception handler lookup, NPE in scope conversion) * support for "jump to runtime stub" (patching code needs to be aware of jmp instruction) * provide more information about methods (to allow inlining: has_balanced_monitors, etc.) * fixes to signature type lookup * isSubTypeOf: correct handling of array classes * RiType: componentType/arrayOf * prologue: inline cache check, icmiss stub * klass state check (resolved but not initialized) in newinstance * card table write barriers * c1x classes are optional (to allow running c1 without them) * correct for stored frame pointer in calling conventions (methods with arguments on stack) * getType(Class<?>) for some basic types, used for optimizations and folding * RiMethod/RiType: throw exception instead of silent failure on unsupported operations * RiType: resolved/unresolved array type support * refactoring: new on-demand template generation mechanism * optimizations: template specialization for no_null_check, given length, etc.
author Lukas Stadler <lukas.stadler@oracle.com>
date Thu, 16 Sep 2010 19:42:20 -0700
parents abc670a709dc
children 20a3896518ac
comparison
equal deleted inserted replaced
1432:b61a43cd1255 1433:efba53f86c4f
14 * are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. 14 * are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries.
15 * 15 *
16 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. 16 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.
17 */ 17 */
18 package com.sun.hotspot.c1x; 18 package com.sun.hotspot.c1x;
19
20 import java.lang.reflect.*;
19 21
20 import com.sun.cri.ri.*; 22 import com.sun.cri.ri.*;
21 23
22 /** 24 /**
23 * Implementation of RiMethod for resolved HotSpot methods. 25 * Implementation of RiMethod for resolved HotSpot methods.
35 private int maxLocals = -1; 37 private int maxLocals = -1;
36 private int maxStackSize = -1; 38 private int maxStackSize = -1;
37 private RiExceptionHandler[] exceptionHandlers; 39 private RiExceptionHandler[] exceptionHandlers;
38 private RiSignature signature; 40 private RiSignature signature;
39 private RiType holder; 41 private RiType holder;
42 private Boolean hasBalancedMonitors;
40 43
41 public HotSpotMethodResolved(long vmId, String name) { 44 public HotSpotMethodResolved(long vmId, String name) {
42 this.vmId = vmId; 45 this.vmId = vmId;
43 this.name = name; 46 this.name = name;
44 } 47 }
51 return accessFlags; 54 return accessFlags;
52 } 55 }
53 56
54 @Override 57 @Override
55 public boolean canBeStaticallyBound() { 58 public boolean canBeStaticallyBound() {
56 // TODO Auto-generated method stub 59 return isLeafMethod() || Modifier.isStatic(accessFlags());
57 return false;
58 } 60 }
59 61
60 @Override 62 @Override
61 public byte[] code() { 63 public byte[] code() {
62 if (code == null) { 64 if (code == null) {
73 return exceptionHandlers; 75 return exceptionHandlers;
74 } 76 }
75 77
76 @Override 78 @Override
77 public boolean hasBalancedMonitors() { 79 public boolean hasBalancedMonitors() {
78 // TODO Auto-generated method stub 80 if (hasBalancedMonitors == null) {
79 return false; 81 hasBalancedMonitors = Compiler.getVMEntries().RiMethod_hasBalancedMonitors(vmId);
82 }
83 return hasBalancedMonitors;
80 } 84 }
81 85
82 @Override 86 @Override
83 public RiType holder() { 87 public RiType holder() {
84 if (holder == null ) { 88 if (holder == null) {
85 holder = Compiler.getVMEntries().RiMethod_holder(vmId); 89 holder = Compiler.getVMEntries().RiMethod_holder(vmId);
86 } 90 }
87 return holder; 91 return holder;
88 } 92 }
89 93
97 return "<init>".equals(name); 101 return "<init>".equals(name);
98 } 102 }
99 103
100 @Override 104 @Override
101 public boolean isLeafMethod() { 105 public boolean isLeafMethod() {
102 // TODO Auto-generated method stub 106 return Modifier.isFinal(accessFlags()) || Modifier.isPrivate(accessFlags());
103 return false;
104 } 107 }
105 108
106 @Override 109 @Override
107 public boolean isOverridden() { 110 public boolean isOverridden() {
108 // TODO Auto-generated method stub 111 throw new UnsupportedOperationException("isOverridden");
109 return false;
110 } 112 }
111 113
112 @Override 114 @Override
113 public boolean isResolved() { 115 public boolean isResolved() {
114 return true; 116 return true;
115 } 117 }
116 118
117 @Override 119 @Override
118 public String jniSymbol() { 120 public String jniSymbol() {
119 // TODO Auto-generated method stub 121 throw new UnsupportedOperationException("jniSymbol");
120 return null;
121 } 122 }
122 123
123 @Override 124 @Override
124 public Object liveness(int bci) { 125 public Object liveness(int bci) {
125 // TODO Auto-generated method stub
126 return null; 126 return null;
127 } 127 }
128 128
129 @Override 129 @Override
130 public int maxLocals() { 130 public int maxLocals() {
142 return maxStackSize; 142 return maxStackSize;
143 } 143 }
144 144
145 @Override 145 @Override
146 public RiMethodProfile methodData() { 146 public RiMethodProfile methodData() {
147 // TODO Auto-generated method stub
148 return null; 147 return null;
149 } 148 }
150 149
151 @Override 150 @Override
152 public String name() { 151 public String name() {