예제 #1
0
//
// Object operations
//
KNIEXPORT void KNI_GetObjectClass(jobject objectHandle, jclass classHandle) {
  OopDesc* object = kni_read_handle(objectHandle);
  SETUP_ERROR_CHECKER_ARG;

  if (object == 0) {
    kni_clear_handle(classHandle);
  } else {
    UsingFastOops fast_oops;
    JavaClass::Fast blueprint = (OopDesc*)object->blueprint();
    JavaClassObj::Fast m = blueprint().get_or_allocate_java_mirror(JVM_SINGLE_ARG_NO_CHECK);
    kni_set_handle(classHandle, m.obj());
  }
}
예제 #2
0
파일: ROM.cpp 프로젝트: sfsy1989/j2me
void ROM::relocate_heap_block() {
  OopDesc* q = (OopDesc*)_romized_heap_top;
  int offset = _heap_relocation_offset;

  while (q < (OopDesc*)_inline_allocation_top) { 
    relocate_pointer_to_heap((OopDesc**)q);
    FarClassDesc* blueprint = q->blueprint();
    if (heap_src_block_contains((address)blueprint)) { 
      blueprint = DERIVED(FarClassDesc*, blueprint, offset);
    }
    q->oops_do_for(blueprint, relocate_pointer_to_heap);
    q = DERIVED(OopDesc*, q, q->object_size_for(blueprint));
  }