Mercurial > hg > truffle
comparison src/share/vm/graal/graalCodeInstaller.cpp @ 3672:5e331d5f760e
removed transition to vm in ci interface
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 18 Nov 2011 17:01:32 +0100 |
parents | f198b24093f3 |
children | 7958ebb561b0 |
comparison
equal
deleted
inserted
replaced
3671:415aa4a73b95 | 3672:5e331d5f760e |
---|---|
209 if (cur_second != NULL) { | 209 if (cur_second != NULL) { |
210 sv->field_values()->append(cur_second); | 210 sv->field_values()->append(cur_second); |
211 } | 211 } |
212 sv->field_values()->append(value); | 212 sv->field_values()->append(value); |
213 } | 213 } |
214 | |
215 // uint first_ind = spobj->first_index(); | |
216 // for (uint i = 0; i < spobj->n_fields(); i++) { | |
217 // Node* fld_node = sfn->in(first_ind+i); | |
218 // (void)FillLocArray(sv->field_values()->length(), sfn, fld_node, sv->field_values(), objs); | |
219 // } | |
220 // scval = sv; | |
221 | |
222 objects->append(sv); | 214 objects->append(sv); |
223 return sv; | 215 return sv; |
224 } else { | 216 } else { |
225 value->klass()->print(); | 217 value->klass()->print(); |
226 value->print(); | 218 value->print(); |
236 _dependencies = new Dependencies(_env); | 228 _dependencies = new Dependencies(_env); |
237 Handle assumptions_handle = CiTargetMethod::assumptions(HotSpotTargetMethod::targetMethod(target_method)); | 229 Handle assumptions_handle = CiTargetMethod::assumptions(HotSpotTargetMethod::targetMethod(target_method)); |
238 if (!assumptions_handle.is_null()) { | 230 if (!assumptions_handle.is_null()) { |
239 objArrayHandle assumptions(Thread::current(), (objArrayOop)CiAssumptions::list(assumptions_handle())); | 231 objArrayHandle assumptions(Thread::current(), (objArrayOop)CiAssumptions::list(assumptions_handle())); |
240 int length = assumptions->length(); | 232 int length = assumptions->length(); |
241 jobject assumptions_handle = JNIHandles::make_local(assumptions()); | |
242 for (int i = 0; i < length; ++i) { | 233 for (int i = 0; i < length; ++i) { |
243 oop assumption = assumptions->obj_at(i); | 234 Handle assumption = assumptions->obj_at(i); |
244 if (assumption != NULL) { | 235 if (!assumption.is_null()) { |
245 if (assumption->klass() == CiAssumptions_ConcreteSubtype::klass()) { | 236 if (assumption->klass() == CiAssumptions_ConcreteSubtype::klass()) { |
246 assumption_ConcreteSubtype(JNIHandles::make_local(assumption)); | 237 assumption_ConcreteSubtype(assumption); |
247 } else if (assumption->klass() == CiAssumptions_ConcreteMethod::klass()) { | 238 } else if (assumption->klass() == CiAssumptions_ConcreteMethod::klass()) { |
248 assumption_ConcreteMethod(JNIHandles::make_local(assumption)); | 239 assumption_ConcreteMethod(assumption); |
249 } else { | 240 } else { |
250 assumption->print(); | 241 assumption->print(); |
251 fatal("unexpected Assumption subclass"); | 242 fatal("unexpected Assumption subclass"); |
252 } | 243 } |
253 } | 244 } |
365 fatal("unexpected Site subclass"); | 356 fatal("unexpected Site subclass"); |
366 } | 357 } |
367 } | 358 } |
368 } | 359 } |
369 | 360 |
370 void CodeInstaller::assumption_ConcreteSubtype(jobject assumption) { | 361 void CodeInstaller::assumption_ConcreteSubtype(Handle assumption) { |
371 Handle context_handle = CiAssumptions_ConcreteSubtype::context(JNIHandles::resolve(assumption)); | 362 Handle context_handle = CiAssumptions_ConcreteSubtype::context(assumption()); |
372 ciKlass* context = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(context_handle))); | 363 ciKlass* context = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(context_handle))); |
373 | 364 |
374 Handle type_handle = CiAssumptions_ConcreteSubtype::subtype(JNIHandles::resolve(assumption)); | 365 Handle type_handle = CiAssumptions_ConcreteSubtype::subtype(assumption()); |
375 ciKlass* type = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(type_handle))); | 366 ciKlass* type = (ciKlass*) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(type_handle))); |
376 | 367 |
377 _dependencies->assert_leaf_type(type); | 368 _dependencies->assert_leaf_type(type); |
378 if (context != type) { | 369 if (context != type) { |
379 // Once you removed the transition to native here | |
380 // and have realized what a terrible mistake that was, | |
381 // please increment the following counter as a warning | |
382 // to the next guy: | |
383 // | |
384 // total_hours_wasted_here = 8 | |
385 ThreadToNativeFromVM trans(JavaThread::current()); | |
386 assert(context->is_abstract(), ""); | 370 assert(context->is_abstract(), ""); |
387 _dependencies->assert_abstract_with_unique_concrete_subtype(context, type); | 371 _dependencies->assert_abstract_with_unique_concrete_subtype(context, type); |
388 } | 372 } |
389 } | 373 } |
390 | 374 |
391 void CodeInstaller::assumption_ConcreteMethod(jobject assumption) { | 375 void CodeInstaller::assumption_ConcreteMethod(Handle assumption) { |
392 Handle method_handle = CiAssumptions_ConcreteMethod::method(JNIHandles::resolve(assumption)); | 376 Handle method_handle = CiAssumptions_ConcreteMethod::method(assumption()); |
393 methodHandle method = getMethodFromHotSpotMethod(method_handle()); | 377 methodHandle method = getMethodFromHotSpotMethod(method_handle()); |
394 ciMethod* m = (ciMethod*) CURRENT_ENV->get_object(method()); | 378 ciMethod* m = (ciMethod*) CURRENT_ENV->get_object(method()); |
395 | 379 |
396 Handle context_handle = CiAssumptions_ConcreteMethod::context(JNIHandles::resolve(assumption)); | 380 Handle context_handle = CiAssumptions_ConcreteMethod::context(assumption()); |
397 methodHandle context = getMethodFromHotSpotMethod(context_handle()); | 381 methodHandle context = getMethodFromHotSpotMethod(context_handle()); |
398 ciMethod* c = (ciMethod*) CURRENT_ENV->get_object(context()); | 382 ciMethod* c = (ciMethod*) CURRENT_ENV->get_object(context()); |
399 ciKlass* context_klass = c->holder(); | 383 ciKlass* context_klass = c->holder(); |
400 { | 384 _dependencies->assert_unique_concrete_method(context_klass, m); |
401 // Once you removed the transition to native here | |
402 // and have realized what a terrible mistake that was, | |
403 // please increment the following counter as a warning | |
404 // to the next guy: | |
405 // | |
406 // total_hours_wasted_here = 8 | |
407 ThreadToNativeFromVM trans(JavaThread::current()); | |
408 _dependencies->assert_unique_concrete_method(context_klass, m); | |
409 } | |
410 } | 385 } |
411 | 386 |
412 void CodeInstaller::process_exception_handlers() { | 387 void CodeInstaller::process_exception_handlers() { |
413 // allocate some arrays for use by the collection code. | 388 // allocate some arrays for use by the collection code. |
414 const int num_handlers = 5; | 389 const int num_handlers = 5; |