Mercurial > hg > truffle
comparison src/share/vm/graal/graalCompiler.cpp @ 14768:3e9a960f0da1
HSAIL: preliminary deopt support
Contributed-by: Tom Deneau <tom.deneau@amd.com>
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 26 Mar 2014 17:33:54 +0100 |
parents | cd22c8dbda4f |
children | 56704532e1cd |
comparison
equal
deleted
inserted
replaced
14767:ded08e344e4a | 14768:3e9a960f0da1 |
---|---|
95 } | 95 } |
96 } | 96 } |
97 VMToCompiler::finalizeOptions(CITime || CITimeEach); | 97 VMToCompiler::finalizeOptions(CITime || CITimeEach); |
98 | 98 |
99 if (UseCompiler) { | 99 if (UseCompiler) { |
100 _external_deopt_i2c_entry = create_external_deopt_i2c(); | |
100 bool bootstrap = COMPILERGRAAL_PRESENT(BootstrapGraal) NOT_COMPILERGRAAL(false); | 101 bool bootstrap = COMPILERGRAAL_PRESENT(BootstrapGraal) NOT_COMPILERGRAAL(false); |
101 VMToCompiler::startCompiler(bootstrap); | 102 VMToCompiler::startCompiler(bootstrap); |
102 _initialized = true; | 103 _initialized = true; |
103 CompilationPolicy::completed_vm_startup(); | 104 CompilationPolicy::completed_vm_startup(); |
104 if (bootstrap) { | 105 if (bootstrap) { |
124 #endif | 125 #endif |
125 } | 126 } |
126 } | 127 } |
127 } | 128 } |
128 | 129 |
130 address GraalCompiler::create_external_deopt_i2c() { | |
131 ResourceMark rm; | |
132 BufferBlob* buffer = BufferBlob::create("externalDeopt", 1*K); | |
133 CodeBuffer cb(buffer); | |
134 short buffer_locs[20]; | |
135 cb.insts()->initialize_shared_locs((relocInfo*)buffer_locs, sizeof(buffer_locs)/sizeof(relocInfo)); | |
136 MacroAssembler masm(&cb); | |
137 | |
138 int total_args_passed = 5; | |
139 | |
140 BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_args_passed); | |
141 VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, total_args_passed); | |
142 int i = 0; | |
143 sig_bt[i++] = T_INT; | |
144 sig_bt[i++] = T_LONG; | |
145 sig_bt[i++] = T_VOID; // long stakes 2 slots | |
146 sig_bt[i++] = T_INT; | |
147 sig_bt[i++] = T_OBJECT; | |
148 | |
149 int comp_args_on_stack = SharedRuntime::java_calling_convention(sig_bt, regs, total_args_passed, false); | |
150 | |
151 SharedRuntime::gen_i2c_adapter(&masm, total_args_passed, comp_args_on_stack, sig_bt, regs); | |
152 masm.flush(); | |
153 | |
154 return AdapterBlob::create(&cb)->content_begin(); | |
155 } | |
156 | |
157 | |
129 BufferBlob* GraalCompiler::initialize_buffer_blob() { | 158 BufferBlob* GraalCompiler::initialize_buffer_blob() { |
130 JavaThread* THREAD = JavaThread::current(); | 159 JavaThread* THREAD = JavaThread::current(); |
131 BufferBlob* buffer_blob = THREAD->get_buffer_blob(); | 160 BufferBlob* buffer_blob = THREAD->get_buffer_blob(); |
132 if (buffer_blob == NULL) { | 161 if (buffer_blob == NULL) { |
133 buffer_blob = BufferBlob::create("Graal thread-local CodeBuffer", GraalNMethodSizeLimit); | 162 buffer_blob = BufferBlob::create("Graal thread-local CodeBuffer", GraalNMethodSizeLimit); |