< prev index next >

src/hotspot/share/jvmci/compilerRuntime.cpp

Print this page




  56 JRT_END
  57 
  58 
  59 
  60 Klass* CompilerRuntime::resolve_klass_helper(JavaThread *thread, const char* name, int len, TRAPS) {
  61   ResourceMark rm(THREAD);
  62   // last java frame on stack (which includes native call frames)
  63   RegisterMap cbl_map(thread, false);
  64   // Skip stub
  65   frame caller_frame = thread->last_frame().sender(&cbl_map);
  66   CodeBlob* caller_cb = caller_frame.cb();
  67   guarantee(caller_cb != NULL && caller_cb->is_compiled(), "must be called from compiled method");
  68   CompiledMethod* caller_nm = caller_cb->as_compiled_method_or_null();
  69   methodHandle caller(THREAD, caller_nm->method());
  70 
  71   // Use class loader of aot method.
  72   Handle loader(THREAD, caller->method_holder()->class_loader());
  73   Handle protection_domain(THREAD, caller->method_holder()->protection_domain());
  74 
  75   // Ignore wrapping L and ;
  76   if (name[0] == 'L') {
  77     assert(len > 2, "small name %s", name);
  78     name++;
  79     len -= 2;
  80   }
  81   TempNewSymbol sym = SymbolTable::new_symbol(name, len, CHECK_NULL);
  82   if (sym == NULL) {
  83     return NULL;
  84   }
  85   Klass* k = SystemDictionary::resolve_or_fail(sym, loader, protection_domain, true, CHECK_NULL);
  86 
  87   return k;
  88 }
  89 
  90 // Resolve Klass
  91 JRT_BLOCK_ENTRY(Klass*, CompilerRuntime::resolve_klass_by_symbol(JavaThread *thread, Klass** klass_result, const char* name))
  92   Klass* k = NULL;
  93   JRT_BLOCK
  94     k = *klass_result; // Is it resolved already?
  95     if (k == NULL) { // Do resolution
  96       // First 2 bytes of name contains length (number of bytes).




  56 JRT_END
  57 
  58 
  59 
  60 Klass* CompilerRuntime::resolve_klass_helper(JavaThread *thread, const char* name, int len, TRAPS) {
  61   ResourceMark rm(THREAD);
  62   // last java frame on stack (which includes native call frames)
  63   RegisterMap cbl_map(thread, false);
  64   // Skip stub
  65   frame caller_frame = thread->last_frame().sender(&cbl_map);
  66   CodeBlob* caller_cb = caller_frame.cb();
  67   guarantee(caller_cb != NULL && caller_cb->is_compiled(), "must be called from compiled method");
  68   CompiledMethod* caller_nm = caller_cb->as_compiled_method_or_null();
  69   methodHandle caller(THREAD, caller_nm->method());
  70 
  71   // Use class loader of aot method.
  72   Handle loader(THREAD, caller->method_holder()->class_loader());
  73   Handle protection_domain(THREAD, caller->method_holder()->protection_domain());
  74 
  75   // Ignore wrapping L and ;
  76   if (name[0] == 'L' || name[0] == 'Q') {
  77     assert(len > 2, "small name %s", name);
  78     name++;
  79     len -= 2;
  80   }
  81   TempNewSymbol sym = SymbolTable::new_symbol(name, len, CHECK_NULL);
  82   if (sym == NULL) {
  83     return NULL;
  84   }
  85   Klass* k = SystemDictionary::resolve_or_fail(sym, loader, protection_domain, true, CHECK_NULL);
  86 
  87   return k;
  88 }
  89 
  90 // Resolve Klass
  91 JRT_BLOCK_ENTRY(Klass*, CompilerRuntime::resolve_klass_by_symbol(JavaThread *thread, Klass** klass_result, const char* name))
  92   Klass* k = NULL;
  93   JRT_BLOCK
  94     k = *klass_result; // Is it resolved already?
  95     if (k == NULL) { // Do resolution
  96       // First 2 bytes of name contains length (number of bytes).


< prev index next >