< prev index next >

src/share/vm/c1/c1_Runtime1.cpp

Print this page




1472   }
1473   bs->write_ref_array(dst, num);
1474 JRT_END
1475 
1476 
1477 JRT_LEAF(int, Runtime1::is_instance_of(oopDesc* mirror, oopDesc* obj))
1478   // had to return int instead of bool, otherwise there may be a mismatch
1479   // between the C calling convention and the Java one.
1480   // e.g., on x86, GCC may clear only %al when returning a bool false, but
1481   // JVM takes the whole %eax as the return value, which may misinterpret
1482   // the return value as a boolean true.
1483 
1484   assert(mirror != NULL, "should null-check on mirror before calling");
1485   Klass* k = java_lang_Class::as_Klass(mirror);
1486   return (k != NULL && obj != NULL && obj->is_a(k)) ? 1 : 0;
1487 JRT_END
1488 
1489 JRT_ENTRY(void, Runtime1::predicate_failed_trap(JavaThread* thread))
1490   ResourceMark rm;
1491 
1492   assert(!TieredCompilation, "incompatible with tiered compilation");
1493 
1494   RegisterMap reg_map(thread, false);
1495   frame runtime_frame = thread->last_frame();
1496   frame caller_frame = runtime_frame.sender(&reg_map);
1497 
1498   nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
1499   assert (nm != NULL, "no more nmethod?");
1500   nm->make_not_entrant();
1501 
1502   methodHandle m(nm->method());
1503   MethodData* mdo = m->method_data();
1504 
1505   if (mdo == NULL && !HAS_PENDING_EXCEPTION) {
1506     // Build an MDO.  Ignore errors like OutOfMemory;
1507     // that simply means we won't have an MDO to update.
1508     Method::build_interpreter_method_data(m, THREAD);
1509     if (HAS_PENDING_EXCEPTION) {
1510       assert((PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())), "we expect only an OOM error here");
1511       CLEAR_PENDING_EXCEPTION;
1512     }
1513     mdo = m->method_data();




1472   }
1473   bs->write_ref_array(dst, num);
1474 JRT_END
1475 
1476 
1477 JRT_LEAF(int, Runtime1::is_instance_of(oopDesc* mirror, oopDesc* obj))
1478   // had to return int instead of bool, otherwise there may be a mismatch
1479   // between the C calling convention and the Java one.
1480   // e.g., on x86, GCC may clear only %al when returning a bool false, but
1481   // JVM takes the whole %eax as the return value, which may misinterpret
1482   // the return value as a boolean true.
1483 
1484   assert(mirror != NULL, "should null-check on mirror before calling");
1485   Klass* k = java_lang_Class::as_Klass(mirror);
1486   return (k != NULL && obj != NULL && obj->is_a(k)) ? 1 : 0;
1487 JRT_END
1488 
1489 JRT_ENTRY(void, Runtime1::predicate_failed_trap(JavaThread* thread))
1490   ResourceMark rm;
1491 


1492   RegisterMap reg_map(thread, false);
1493   frame runtime_frame = thread->last_frame();
1494   frame caller_frame = runtime_frame.sender(&reg_map);
1495 
1496   nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
1497   assert (nm != NULL, "no more nmethod?");
1498   nm->make_not_entrant();
1499 
1500   methodHandle m(nm->method());
1501   MethodData* mdo = m->method_data();
1502 
1503   if (mdo == NULL && !HAS_PENDING_EXCEPTION) {
1504     // Build an MDO.  Ignore errors like OutOfMemory;
1505     // that simply means we won't have an MDO to update.
1506     Method::build_interpreter_method_data(m, THREAD);
1507     if (HAS_PENDING_EXCEPTION) {
1508       assert((PENDING_EXCEPTION->is_a(SystemDictionary::OutOfMemoryError_klass())), "we expect only an OOM error here");
1509       CLEAR_PENDING_EXCEPTION;
1510     }
1511     mdo = m->method_data();


< prev index next >