comparison src/share/vm/c1x/c1x_VMExits.cpp @ 1421:6223633ce7dd

changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
author Lukas Stadler <lukas.stadler@oracle.com>
date Fri, 23 Jul 2010 15:53:02 -0700
parents e1a275dbc8cd
children 3483ec571caf
comparison
equal deleted inserted replaced
1420:44efca8a02d6 1421:6223633ce7dd
22 * 22 *
23 */ 23 */
24 24
25 # include "incls/_precompiled.incl" 25 # include "incls/_precompiled.incl"
26 # include "incls/_c1x_VMExits.cpp.incl" 26 # include "incls/_c1x_VMExits.cpp.incl"
27 27 /*
28 KlassHandle VMExits::_vmExitsKlass; 28 jobject OopCache::handles = NULL;
29 jobject OopCache::mirrors = NULL;
30 int OopCache::capacity = 0;
31 int OopCache::used = 0;
32
33 void initialize() {
34
35 }
36 static Handle mirror(oop internal_object);
37 static Handle resolve(oop mirror);
38
39 */
40 KlassHandle VMExits::_vmExitsKlass;
41 Handle VMExits::_vmExitsObject;
29 42
30 KlassHandle &VMExits::vmExitsKlass() { 43 KlassHandle &VMExits::vmExitsKlass() {
31 44 if (_vmExitsKlass.is_null()) {
32 //if (_vmExitsKlass.is_null()) { 45 _vmExitsKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_VMExits(), SystemDictionary::java_system_loader(), NULL, Thread::current());
33 Handle nullh;
34 _vmExitsKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_VMExits(), SystemDictionary::java_system_loader(), nullh, Thread::current());
35 if (_vmExitsKlass.is_null()) { 46 if (_vmExitsKlass.is_null()) {
36 fatal("Could not find class com.sun.hotspot.c1x.VMExits"); 47 fatal("Could not find class com.sun.hotspot.c1x.VMExits");
37 } 48 }
38 //} 49 }
39 return _vmExitsKlass; 50 return _vmExitsKlass;
51 }
52
53 Handle &VMExits::instance() {
54 if (_vmExitsObject.is_null()) {
55 KlassHandle compiler_klass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_Compiler(), SystemDictionary::java_system_loader(), NULL, Thread::current());
56 JavaValue result(T_OBJECT);
57 JavaCallArguments args;
58 JavaCalls::call_static(&result, compiler_klass(), vmSymbols::getVMExits_name(), vmSymbols::getVMExits_signature(), &args, Thread::current());
59 check_pending_exception("Couldn't get VMExits");
60 oop res = (oop)result.get_jobject();
61 _vmExitsObject = res;
62 }
63 return _vmExitsObject;
40 } 64 }
41 65
42 void VMExits::compileMethod(oop method, int entry_bci) { 66 void VMExits::compileMethod(oop method, int entry_bci) {
43 assert(method != NULL, "just checking"); 67 assert(method != NULL, "just checking");
44 JavaValue result(T_VOID); 68 JavaValue result(T_VOID);
45 JavaCallArguments args; 69 JavaCallArguments args;
70 args.push_oop(instance());
46 args.push_oop(method); 71 args.push_oop(method);
47 args.push_int(entry_bci); 72 args.push_int(entry_bci);
48 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::compileMethod_name(), vmSymbols::compileMethod_signature(), &args, Thread::current()); 73 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::compileMethod_name(), vmSymbols::compileMethod_signature(), &args, Thread::current());
74 check_pending_exception("Error while calling compileMethod");
49 } 75 }
50 76
51 oop VMExits::createRiMethod(methodOop m) { 77 oop VMExits::createRiMethod(methodOop m) {
52 assert(m != NULL, "just checking"); 78 assert(m != NULL, "just checking");
53 JavaValue result(T_OBJECT); 79 JavaValue result(T_OBJECT);
54 JavaCallArguments args; 80 JavaCallArguments args;
81 args.push_oop(instance());
55 args.push_oop(m); 82 args.push_oop(m);
56 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createRiMethod_name(), vmSymbols::createRiMethod_signature(), &args, Thread::current()); 83 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiMethod_name(), vmSymbols::createRiMethod_signature(), &args, Thread::current());
57 if(Thread::current()->pending_exception() != NULL) { 84 check_pending_exception("Error while calling createRiMethod");
58 tty->print_cr("exc pending");
59 }
60 return (oop)result.get_jobject(); 85 return (oop)result.get_jobject();
61 } 86 }
62 87
63 oop VMExits::createRiField(oop field_holder, symbolOop field_name, oop field_type, int index) { 88 oop VMExits::createRiField(oop field_holder, symbolOop field_name, oop field_type, int index) {
64 assert(field_holder != NULL && field_name != NULL && field_type != NULL, "just checking"); 89 assert(field_holder != NULL && field_name != NULL && field_type != NULL, "just checking");
65 JavaValue result(T_OBJECT); 90 JavaValue result(T_OBJECT);
66 JavaCallArguments args; 91 JavaCallArguments args;
92 args.push_oop(instance());
67 args.push_oop(field_holder); 93 args.push_oop(field_holder);
68 args.push_oop(field_name); 94 args.push_oop(field_name);
69 args.push_oop(field_type); 95 args.push_oop(field_type);
70 args.push_int(index); 96 args.push_int(index);
71 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createRiField_name(), vmSymbols::createRiField_signature(), &args, Thread::current()); 97 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiField_name(), vmSymbols::createRiField_signature(), &args, Thread::current());
98 check_pending_exception("Error while calling createRiField");
72 return (oop)result.get_jobject(); 99 return (oop)result.get_jobject();
73 } 100 }
74 101
75 oop VMExits::createRiType(klassOop k) { 102 oop VMExits::createRiType(klassOop k) {
76 assert(k != NULL, "just checking"); 103 assert(k != NULL, "just checking");
77 JavaValue result(T_OBJECT); 104 JavaValue result(T_OBJECT);
78 JavaCallArguments args; 105 JavaCallArguments args;
106 args.push_oop(instance());
79 args.push_oop(k); 107 args.push_oop(k);
80 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createRiType_name(), vmSymbols::createRiType_signature(), &args, Thread::current()); 108 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiType_name(), vmSymbols::createRiType_signature(), &args, Thread::current());
109 check_pending_exception("Error while calling createRiType");
81 return (oop)result.get_jobject(); 110 return (oop)result.get_jobject();
82 } 111 }
83 112
84 oop VMExits::createRiTypePrimitive(int basic_type) { 113 oop VMExits::createRiTypePrimitive(int basic_type) {
85 JavaValue result(T_OBJECT); 114 JavaValue result(T_OBJECT);
86 JavaCallArguments args; 115 JavaCallArguments args;
116 args.push_oop(instance());
87 args.push_int(basic_type); 117 args.push_int(basic_type);
88 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createRiTypePrimitive_name(), vmSymbols::createRiTypePrimitive_signature(), &args, Thread::current()); 118 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypePrimitive_name(), vmSymbols::createRiTypePrimitive_signature(), &args, Thread::current());
119 check_pending_exception("Error while calling createRiTypePrimitive");
89 return (oop)result.get_jobject(); 120 return (oop)result.get_jobject();
90 } 121 }
91 122
92 oop VMExits::createRiTypeUnresolved(symbolOop name, klassOop accessor) { 123 oop VMExits::createRiTypeUnresolved(symbolOop name, klassOop accessor) {
93 assert(name != NULL && accessor != NULL, "just checking"); 124 // assert(name != NULL && accessor != NULL, "just checking");
94 JavaValue result(T_OBJECT); 125 JavaValue result(T_OBJECT);
95 JavaCallArguments args; 126 JavaCallArguments args;
127 args.push_oop(instance());
96 args.push_oop(name); 128 args.push_oop(name);
97 args.push_oop(accessor); 129 args.push_oop(accessor);
98 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createRiTypeUnresolved_name(), vmSymbols::createRiTypeUnresolved_signature(), &args, Thread::current()); 130 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypeUnresolved_name(), vmSymbols::createRiTypeUnresolved_signature(), &args, Thread::current());
131 check_pending_exception("Error while calling createRiTypeUnresolved");
99 return (oop)result.get_jobject(); 132 return (oop)result.get_jobject();
100 } 133 }
101 134
102 oop VMExits::createRiConstantPool(constantPoolOop cp) { 135 oop VMExits::createRiConstantPool(constantPoolOop cp) {
103 assert(cp != NULL, "just checking"); 136 assert(cp != NULL, "just checking");
104 JavaValue result(T_OBJECT); 137 JavaValue result(T_OBJECT);
105 JavaCallArguments args; 138 JavaCallArguments args;
139 args.push_oop(instance());
106 args.push_oop(cp); 140 args.push_oop(cp);
107 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createRiConstantPool_name(), vmSymbols::createRiConstantPool_signature(), &args, Thread::current()); 141 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiConstantPool_name(), vmSymbols::createRiConstantPool_signature(), &args, Thread::current());
142 check_pending_exception("Error while calling createRiConstantPool");
108 return (oop)result.get_jobject(); 143 return (oop)result.get_jobject();
109 } 144 }
110 145
111 oop VMExits::createRiSignature(symbolOop symbol) { 146 oop VMExits::createRiSignature(symbolOop symbol) {
112 assert(symbol != NULL, "just checking"); 147 assert(symbol != NULL, "just checking");
113 JavaValue result(T_OBJECT); 148 JavaValue result(T_OBJECT);
114 JavaCallArguments args; 149 JavaCallArguments args;
150 args.push_oop(instance());
115 args.push_oop(symbol); 151 args.push_oop(symbol);
116 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createRiSignature_name(), vmSymbols::createRiSignature_signature(), &args, Thread::current()); 152 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiSignature_name(), vmSymbols::createRiSignature_signature(), &args, Thread::current());
153 check_pending_exception("Error while calling createRiSignature");
117 return (oop)result.get_jobject(); 154 return (oop)result.get_jobject();
118 } 155 }
119 156
120 oop VMExits::createCiConstantInt(jint value) { 157 oop VMExits::createCiConstantInt(jint value) {
121 JavaValue result(T_OBJECT); 158 JavaValue result(T_OBJECT);
122 JavaCallArguments args; 159 JavaCallArguments args;
160 args.push_oop(instance());
123 args.push_int(value); 161 args.push_int(value);
124 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createCiConstantInt_name(), vmSymbols::createCiConstantInt_signature(), &args, Thread::current()); 162 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantInt_name(), vmSymbols::createCiConstantInt_signature(), &args, Thread::current());
163 check_pending_exception("Error while calling createCiConstantInt");
125 return (oop)result.get_jobject(); 164 return (oop)result.get_jobject();
126 165
127 } 166 }
128 167
129 oop VMExits::createCiConstantLong(jlong value) { 168 oop VMExits::createCiConstantLong(jlong value) {
130 JavaValue result(T_OBJECT); 169 JavaValue result(T_OBJECT);
131 JavaCallArguments args; 170 JavaCallArguments args;
171 args.push_oop(instance());
132 args.push_long(value); 172 args.push_long(value);
133 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createCiConstantLong_name(), vmSymbols::createCiConstantLong_signature(), &args, Thread::current()); 173 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantLong_name(), vmSymbols::createCiConstantLong_signature(), &args, Thread::current());
174 check_pending_exception("Error while calling createCiConstantFloat");
134 return (oop)result.get_jobject(); 175 return (oop)result.get_jobject();
135 176
136 } 177 }
137 178
138 oop VMExits::createCiConstantFloat(jfloat value) { 179 oop VMExits::createCiConstantFloat(jfloat value) {
139 JavaValue result(T_OBJECT); 180 JavaValue result(T_OBJECT);
140 JavaCallArguments args; 181 JavaCallArguments args;
182 args.push_oop(instance());
141 args.push_float(value); 183 args.push_float(value);
142 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createCiConstantFloat_name(), vmSymbols::createCiConstantFloat_signature(), &args, Thread::current()); 184 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantFloat_name(), vmSymbols::createCiConstantFloat_signature(), &args, Thread::current());
185 check_pending_exception("Error while calling createCiConstantFloat");
143 return (oop)result.get_jobject(); 186 return (oop)result.get_jobject();
144 187
145 } 188 }
146 189
147 oop VMExits::createCiConstantDouble(jdouble value) { 190 oop VMExits::createCiConstantDouble(jdouble value) {
148 JavaValue result(T_OBJECT); 191 JavaValue result(T_OBJECT);
149 JavaCallArguments args; 192 JavaCallArguments args;
193 args.push_oop(instance());
150 args.push_double(value); 194 args.push_double(value);
151 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createCiConstantDouble_name(), vmSymbols::createCiConstantDouble_signature(), &args, Thread::current()); 195 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantDouble_name(), vmSymbols::createCiConstantDouble_signature(), &args, Thread::current());
196 check_pending_exception("Error while calling createCiConstantDouble");
152 return (oop)result.get_jobject(); 197 return (oop)result.get_jobject();
153 } 198 }
154 199
155 oop VMExits::createCiConstantObject(oop value) { 200 oop VMExits::createCiConstantObject(oop value) {
156 JavaValue result(T_OBJECT); 201 JavaValue result(T_OBJECT);
157 JavaCallArguments args; 202 JavaCallArguments args;
203 args.push_oop(instance());
158 args.push_oop(value); 204 args.push_oop(value);
159 JavaCalls::call_static(&result, vmExitsKlass(), vmSymbols::createCiConstantObject_name(), vmSymbols::createCiConstantObject_signature(), &args, Thread::current()); 205 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantObject_name(), vmSymbols::createCiConstantObject_signature(), &args, Thread::current());
160 return (oop)result.get_jobject(); 206 check_pending_exception("Error while calling createCiConstantObject");
161 } 207 return (oop)result.get_jobject();
208 }