< prev index next >

src/share/vm/ci/ciCallSite.cpp

Print this page




  33   return klass()->is_subclass_of(CURRENT_ENV->ConstantCallSite_klass());
  34 }
  35 bool ciCallSite::is_mutable_call_site() {
  36   return klass()->is_subclass_of(CURRENT_ENV->MutableCallSite_klass());
  37 }
  38 bool ciCallSite::is_volatile_call_site() {
  39   return klass()->is_subclass_of(CURRENT_ENV->VolatileCallSite_klass());
  40 }
  41 
  42 // ------------------------------------------------------------------
  43 // ciCallSite::get_target
  44 //
  45 // Return the target MethodHandle of this CallSite.
  46 ciMethodHandle* ciCallSite::get_target() const {
  47   VM_ENTRY_MARK;
  48   oop method_handle_oop = java_lang_invoke_CallSite::target(get_oop());
  49   return CURRENT_ENV->get_object(method_handle_oop)->as_method_handle();
  50 }
  51 
  52 // ------------------------------------------------------------------






















  53 // ciCallSite::print
  54 //
  55 // Print debugging information about the CallSite.
  56 void ciCallSite::print() {
  57   Unimplemented();
  58 }


  33   return klass()->is_subclass_of(CURRENT_ENV->ConstantCallSite_klass());
  34 }
  35 bool ciCallSite::is_mutable_call_site() {
  36   return klass()->is_subclass_of(CURRENT_ENV->MutableCallSite_klass());
  37 }
  38 bool ciCallSite::is_volatile_call_site() {
  39   return klass()->is_subclass_of(CURRENT_ENV->VolatileCallSite_klass());
  40 }
  41 
  42 // ------------------------------------------------------------------
  43 // ciCallSite::get_target
  44 //
  45 // Return the target MethodHandle of this CallSite.
  46 ciMethodHandle* ciCallSite::get_target() const {
  47   VM_ENTRY_MARK;
  48   oop method_handle_oop = java_lang_invoke_CallSite::target(get_oop());
  49   return CURRENT_ENV->get_object(method_handle_oop)->as_method_handle();
  50 }
  51 
  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   VM_ENTRY_MARK;
  59   InstanceKlass* ctxk = NULL;
  60   {
  61     MutexLocker mu(Compile_lock, THREAD);
  62     oop call_site_oop = get_oop();
  63     ctxk = MethodHandles::get_call_site_context(call_site_oop);
  64     if (ctxk == NULL) {
  65       // The call site doesn't have a context associated. Set it to the default context.
  66       oop def_context_oop = java_lang_invoke_DependencyContext::default_context();
  67       java_lang_invoke_CallSite::set_context_cas(call_site_oop, def_context_oop, /*expected=*/NULL);
  68       ctxk = MethodHandles::get_call_site_context(call_site_oop);
  69     }
  70   }
  71   return (CURRENT_ENV->get_metadata(ctxk))->as_klass();
  72 }
  73 
  74 // ------------------------------------------------------------------
  75 // ciCallSite::print
  76 //
  77 // Print debugging information about the CallSite.
  78 void ciCallSite::print() {
  79   Unimplemented();
  80 }
< prev index next >