Mercurial > hg > graal-compiler
comparison src/share/vm/c1x/c1x_CodeInstaller.cpp @ 2048:177398c6147d
Added unique concrete subtype assumption.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Mon, 10 Jan 2011 10:50:22 +0100 |
parents | cf75612bdaa5 |
children | 7e09ea4a8f36 |
comparison
equal
deleted
inserted
replaced
2047:eb575e79136f | 2048:177398c6147d |
---|---|
26 #include "c1x/c1x_Compiler.hpp" | 26 #include "c1x/c1x_Compiler.hpp" |
27 #include "c1x/c1x_CodeInstaller.hpp" | 27 #include "c1x/c1x_CodeInstaller.hpp" |
28 #include "c1x/c1x_JavaAccess.hpp" | 28 #include "c1x/c1x_JavaAccess.hpp" |
29 #include "c1x/c1x_VmIds.hpp" | 29 #include "c1x/c1x_VmIds.hpp" |
30 #include "c1/c1_Runtime1.hpp" | 30 #include "c1/c1_Runtime1.hpp" |
31 #include "classfile/vmSymbols.hpp" | |
31 #include "vmreg_x86.inline.hpp" | 32 #include "vmreg_x86.inline.hpp" |
32 | 33 |
33 | 34 |
34 // TODO this should be handled in a more robust way - not hard coded... | 35 // TODO this should be handled in a more robust way - not hard coded... |
35 Register CPU_REGS[] = { rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, r15 }; | 36 Register CPU_REGS[] = { rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, r15 }; |
206 void CodeInstaller::initialize_fields(Handle target_method) { | 207 void CodeInstaller::initialize_fields(Handle target_method) { |
207 _citarget_method = HotSpotTargetMethod::targetMethod(target_method); | 208 _citarget_method = HotSpotTargetMethod::targetMethod(target_method); |
208 _hotspot_method = HotSpotTargetMethod::method(target_method); | 209 _hotspot_method = HotSpotTargetMethod::method(target_method); |
209 _name = HotSpotTargetMethod::name(target_method); | 210 _name = HotSpotTargetMethod::name(target_method); |
210 _sites = (arrayOop) HotSpotTargetMethod::sites(target_method); | 211 _sites = (arrayOop) HotSpotTargetMethod::sites(target_method); |
212 oop assumptions = CiTargetMethod::assumptions(_citarget_method); | |
213 if (assumptions != NULL) { | |
214 _assumptions = (arrayOop) CiAssumptions::list(assumptions); | |
215 } else { | |
216 _assumptions = NULL; | |
217 } | |
211 _exception_handlers = (arrayOop) HotSpotTargetMethod::exceptionHandlers(target_method); | 218 _exception_handlers = (arrayOop) HotSpotTargetMethod::exceptionHandlers(target_method); |
212 | 219 |
213 _code = (arrayOop) CiTargetMethod::targetCode(_citarget_method); | 220 _code = (arrayOop) CiTargetMethod::targetCode(_citarget_method); |
214 _code_size = CiTargetMethod::targetCodeSize(_citarget_method); | 221 _code_size = CiTargetMethod::targetCodeSize(_citarget_method); |
215 _frame_size = CiTargetMethod::frameSize(_citarget_method); | 222 _frame_size = CiTargetMethod::frameSize(_citarget_method); |
268 site_Mark(buffer, pc_offset, site); | 275 site_Mark(buffer, pc_offset, site); |
269 } else { | 276 } else { |
270 fatal("unexpected Site subclass"); | 277 fatal("unexpected Site subclass"); |
271 } | 278 } |
272 } | 279 } |
280 | |
281 | |
282 if (_assumptions != NULL) { | |
283 oop* assumptions = (oop*) _assumptions->base(T_OBJECT); | |
284 for (int i = 0; i < _assumptions->length(); ++i) { | |
285 oop assumption = assumptions[i]; | |
286 if (assumption != NULL) { | |
287 if (assumption->is_a(CiAssumptions_ConcreteSubtype::klass())) { | |
288 assumption_ConcreteSubtype(assumption); | |
289 } else if (assumption->is_a(CiAssumptions_ConcreteMethod::klass())) { | |
290 assumption_ConcreteMethod(assumption); | |
291 } else { | |
292 fatal("unexpected Assumption subclass"); | |
293 } | |
294 } | |
295 } | |
296 } | |
297 } | |
298 | |
299 void CodeInstaller::assumption_ConcreteSubtype(oop assumption) { | |
300 oop context_oop = CiAssumptions_ConcreteSubtype::context(assumption); | |
301 oop type_oop = CiAssumptions_ConcreteSubtype::subtype(assumption); | |
302 | |
303 ciKlass* context = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(context_oop))); | |
304 ciKlass* type = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(type_oop))); | |
305 | |
306 if (context == type) { | |
307 _dependencies->assert_leaf_type(type); | |
308 } else { | |
309 assert(context->is_abstract(), ""); | |
310 ThreadToNativeFromVM trans(JavaThread::current()); | |
311 _dependencies->assert_abstract_with_unique_concrete_subtype(context, type); | |
312 } | |
313 } | |
314 | |
315 void CodeInstaller::assumption_ConcreteMethod(oop assumption) { | |
316 fatal("unimplemented"); | |
273 } | 317 } |
274 | 318 |
275 void CodeInstaller::process_exception_handlers() { | 319 void CodeInstaller::process_exception_handlers() { |
276 // allocate some arrays for use by the collection code. | 320 // allocate some arrays for use by the collection code. |
277 const int num_handlers = 5; | 321 const int num_handlers = 5; |