hotspot/src/share/vm/ci/ciCallSite.cpp
changeset 30296 95baefac8485
parent 29081 c61eb4914428
child 31037 01a5c5fa5681
equal deleted inserted replaced
30226:5f1a3a275862 30296:95baefac8485
    48   oop method_handle_oop = java_lang_invoke_CallSite::target(get_oop());
    48   oop method_handle_oop = java_lang_invoke_CallSite::target(get_oop());
    49   return CURRENT_ENV->get_object(method_handle_oop)->as_method_handle();
    49   return CURRENT_ENV->get_object(method_handle_oop)->as_method_handle();
    50 }
    50 }
    51 
    51 
    52 // ------------------------------------------------------------------
    52 // ------------------------------------------------------------------
       
    53 // ciCallSite::get_context
       
    54 //
       
    55 // Return the target MethodHandle of this CallSite.
       
    56 ciKlass* ciCallSite::get_context() {
       
    57   assert(!is_constant_call_site(), "");
       
    58 
       
    59   VM_ENTRY_MARK;
       
    60   oop call_site_oop = get_oop();
       
    61   InstanceKlass* ctxk = MethodHandles::get_call_site_context(call_site_oop);
       
    62   if (ctxk == NULL) {
       
    63     // The call site doesn't have a context associated. Set it to the default context.
       
    64     oop def_context_oop = java_lang_invoke_CallSite::default_context();
       
    65     java_lang_invoke_CallSite::set_context_cas(call_site_oop, def_context_oop, /*expected=*/NULL);
       
    66     ctxk = MethodHandles::get_call_site_context(call_site_oop);
       
    67   }
       
    68   return (CURRENT_ENV->get_metadata(ctxk))->as_klass();
       
    69 }
       
    70 
       
    71 // ------------------------------------------------------------------
    53 // ciCallSite::print
    72 // ciCallSite::print
    54 //
    73 //
    55 // Print debugging information about the CallSite.
    74 // Print debugging information about the CallSite.
    56 void ciCallSite::print() {
    75 void ciCallSite::print() {
    57   Unimplemented();
    76   Unimplemented();