Mercurial > hg > graal-compiler
comparison src/share/vm/graal/graalRuntime.cpp @ 17033:2d6dd2eebd51
Fixed HSAIL deopt
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Tue, 02 Sep 2014 21:42:37 -0700 |
parents | aa412e64808e |
children | 80d021f12b22 5247c895a6ab |
comparison
equal
deleted
inserted
replaced
17032:8f3ece00da4f | 17033:2d6dd2eebd51 |
---|---|
22 */ | 22 */ |
23 | 23 |
24 #include "precompiled.hpp" | 24 #include "precompiled.hpp" |
25 #include "asm/codeBuffer.hpp" | 25 #include "asm/codeBuffer.hpp" |
26 #include "compiler/compileBroker.hpp" | 26 #include "compiler/compileBroker.hpp" |
27 #include "compiler/disassembler.hpp" | |
27 #include "graal/graalRuntime.hpp" | 28 #include "graal/graalRuntime.hpp" |
28 #include "graal/graalCompilerToVM.hpp" | 29 #include "graal/graalCompilerToVM.hpp" |
29 #include "graal/graalCompiler.hpp" | 30 #include "graal/graalCompiler.hpp" |
30 #include "graal/graalJavaAccess.hpp" | 31 #include "graal/graalJavaAccess.hpp" |
31 #include "graal/graalEnv.hpp" | 32 #include "graal/graalEnv.hpp" |
54 ResourceMark rm; | 55 ResourceMark rm; |
55 HandleMark hm; | 56 HandleMark hm; |
56 | 57 |
57 graal_compute_offsets(); | 58 graal_compute_offsets(); |
58 | 59 |
60 #ifdef TARGET_ARCH_x86 | |
61 #ifdef _LP64 | |
62 // Only supported on x86_64 for now | |
59 _external_deopt_i2c_entry = create_external_deopt_i2c(); | 63 _external_deopt_i2c_entry = create_external_deopt_i2c(); |
64 #endif | |
65 #endif | |
60 | 66 |
61 // Ensure _non_oop_bits is initialized | 67 // Ensure _non_oop_bits is initialized |
62 Universe::non_oop_word(); | 68 Universe::non_oop_word(); |
63 | 69 |
64 env->RegisterNatives(c2vmClass, CompilerToVM_methods, CompilerToVM_methods_count()); | 70 env->RegisterNatives(c2vmClass, CompilerToVM_methods, CompilerToVM_methods_count()); |
86 CodeBuffer cb(buffer); | 92 CodeBuffer cb(buffer); |
87 short buffer_locs[20]; | 93 short buffer_locs[20]; |
88 cb.insts()->initialize_shared_locs((relocInfo*)buffer_locs, sizeof(buffer_locs)/sizeof(relocInfo)); | 94 cb.insts()->initialize_shared_locs((relocInfo*)buffer_locs, sizeof(buffer_locs)/sizeof(relocInfo)); |
89 MacroAssembler masm(&cb); | 95 MacroAssembler masm(&cb); |
90 | 96 |
91 int total_args_passed = 5; | 97 int total_args_passed = 6; |
92 | 98 |
93 BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed); | 99 BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed); |
94 VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed); | 100 VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed); |
95 int i = 0; | 101 int i = 0; |
96 sig_bt[i++] = T_INT; | 102 sig_bt[i++] = T_INT; |
97 sig_bt[i++] = T_LONG; | 103 sig_bt[i++] = T_LONG; |
98 sig_bt[i++] = T_VOID; // long stakes 2 slots | 104 sig_bt[i++] = T_VOID; // long stakes 2 slots |
99 sig_bt[i++] = T_INT; | 105 sig_bt[i++] = T_INT; |
100 sig_bt[i++] = T_OBJECT; | 106 sig_bt[i++] = T_OBJECT; |
107 sig_bt[i++] = T_INT; // The number of actual arguments pass to the method. | |
101 | 108 |
102 int comp_args_on_stack = SharedRuntime::java_calling_convention(sig_bt, regs, total_args_passed, false); | 109 int comp_args_on_stack = SharedRuntime::java_calling_convention(sig_bt, regs, total_args_passed, false); |
103 | 110 |
104 SharedRuntime::gen_i2c_adapter(&masm, total_args_passed, comp_args_on_stack, sig_bt, regs); | 111 SharedRuntime::gen_i2c_adapter(&masm, total_args_passed, comp_args_on_stack, sig_bt, regs, total_args_passed - 1); |
105 masm.flush(); | 112 masm.flush(); |
106 | 113 |
107 return AdapterBlob::create(&cb)->content_begin(); | 114 AdapterBlob* adapter = AdapterBlob::create(&cb); |
115 if (PrintAdapterHandlers) { | |
116 tty->print_cr("Decoding external_deopt_i2c"); | |
117 Disassembler::decode(adapter->code_begin(), adapter->code_end()); | |
118 } | |
119 return adapter->code_begin(); | |
108 } | 120 } |
109 | 121 |
110 BasicType GraalRuntime::kindToBasicType(jchar ch) { | 122 BasicType GraalRuntime::kindToBasicType(jchar ch) { |
111 switch(ch) { | 123 switch(ch) { |
112 case 'z': return T_BOOLEAN; | 124 case 'z': return T_BOOLEAN; |