1.1 --- a/src/share/vm/ci/ciStreams.cpp Mon Jul 23 13:04:59 2012 -0700 1.2 +++ b/src/share/vm/ci/ciStreams.cpp Tue Jul 24 10:51:00 2012 -0700 1.3 @@ -364,6 +364,29 @@ 1.4 } 1.5 1.6 // ------------------------------------------------------------------ 1.7 +// ciBytecodeStream::has_appendix 1.8 +// 1.9 +// Returns true if there is an appendix argument stored in the 1.10 +// constant pool cache at the current bci. 1.11 +bool ciBytecodeStream::has_appendix() { 1.12 + VM_ENTRY_MARK; 1.13 + constantPoolHandle cpool(_method->get_methodOop()->constants()); 1.14 + return constantPoolOopDesc::has_appendix_at_if_loaded(cpool, get_method_index()); 1.15 +} 1.16 + 1.17 +// ------------------------------------------------------------------ 1.18 +// ciBytecodeStream::get_appendix 1.19 +// 1.20 +// Return the appendix argument stored in the constant pool cache at 1.21 +// the current bci. 1.22 +ciObject* ciBytecodeStream::get_appendix() { 1.23 + VM_ENTRY_MARK; 1.24 + constantPoolHandle cpool(_method->get_methodOop()->constants()); 1.25 + oop appendix_oop = constantPoolOopDesc::appendix_at_if_loaded(cpool, get_method_index()); 1.26 + return CURRENT_ENV->get_object(appendix_oop); 1.27 +} 1.28 + 1.29 +// ------------------------------------------------------------------ 1.30 // ciBytecodeStream::get_declared_method_holder 1.31 // 1.32 // Get the declared holder of the currently referenced method. 1.33 @@ -378,9 +401,9 @@ 1.34 VM_ENTRY_MARK; 1.35 constantPoolHandle cpool(_method->get_methodOop()->constants()); 1.36 bool ignore; 1.37 - // report as InvokeDynamic for invokedynamic, which is syntactically classless 1.38 + // report as MethodHandle for invokedynamic, which is syntactically classless 1.39 if (cur_bc() == Bytecodes::_invokedynamic) 1.40 - return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_lang_invoke_InvokeDynamic(), false); 1.41 + return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_lang_invoke_MethodHandle(), false); 1.42 return CURRENT_ENV->get_klass_by_index(cpool, get_method_holder_index(), ignore, _holder); 1.43 } 1.44 1.45 @@ -396,6 +419,24 @@ 1.46 } 1.47 1.48 // ------------------------------------------------------------------ 1.49 +// ciBytecodeStream::get_declared_method_signature 1.50 +// 1.51 +// Get the declared signature of the currently referenced method. 1.52 +// 1.53 +// This is always the same as the signature of the resolved method 1.54 +// itself, except for _invokehandle and _invokedynamic calls. 1.55 +// 1.56 +ciSignature* ciBytecodeStream::get_declared_method_signature() { 1.57 + int sig_index = get_method_signature_index(); 1.58 + VM_ENTRY_MARK; 1.59 + ciEnv* env = CURRENT_ENV; 1.60 + constantPoolHandle cpool(_method->get_methodOop()->constants()); 1.61 + Symbol* sig_sym = cpool->symbol_at(sig_index); 1.62 + ciKlass* pool_holder = env->get_object(cpool->pool_holder())->as_klass(); 1.63 + return new (env->arena()) ciSignature(pool_holder, cpool, env->get_symbol(sig_sym)); 1.64 +} 1.65 + 1.66 +// ------------------------------------------------------------------ 1.67 // ciBytecodeStream::get_method_signature_index 1.68 // 1.69 // Get the constant pool index of the signature of the method 1.70 @@ -434,7 +475,7 @@ 1.71 // Get the CallSite from the constant pool cache. 1.72 int method_index = get_method_index(); 1.73 ConstantPoolCacheEntry* cpcache_entry = cpcache->secondary_entry_at(method_index); 1.74 - oop call_site_oop = cpcache_entry->f1(); 1.75 + oop call_site_oop = cpcache_entry->f1_as_instance(); 1.76 1.77 // Create a CallSite object and return it. 1.78 return CURRENT_ENV->get_object(call_site_oop)->as_call_site();