8250042: Clean up methodOop and method_oop names from the code

Reviewed-by: dholmes, sspitsyn, cjplummer, chagedorn
This commit is contained in:
Coleen Phillimore 2020-07-28 07:33:51 -04:00
parent 0ebcf5c59d
commit 42ac8e1856
26 changed files with 137 additions and 137 deletions

View file

@ -3702,7 +3702,7 @@ frame %{
// These three registers define part of the calling convention
// between compiled code and the interpreter.
// Inline Cache Register or methodOop for I2C.
// Inline Cache Register or Method for I2C.
inline_cache_reg(R12);
// Method Oop Register when calling interpreter.
@ -15570,13 +15570,13 @@ instruct CallLeafNoFPDirect(method meth)
// Also known as an 'interprocedural jump'.
// Target of jump will eventually return to caller.
// TailJump below removes the return address.
instruct TailCalljmpInd(iRegPNoSp jump_target, inline_cache_RegP method_oop)
instruct TailCalljmpInd(iRegPNoSp jump_target, inline_cache_RegP method_ptr)
%{
match(TailCall jump_target method_oop);
match(TailCall jump_target method_ptr);
ins_cost(CALL_COST);
format %{ "br $jump_target\t# $method_oop holds method oop" %}
format %{ "br $jump_target\t# $method_ptr holds method" %}
ins_encode(aarch64_enc_tail_call(jump_target));

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -50,7 +50,7 @@
// [padding ]
// [methodData ] = mdp() mdx_offset
// [methodOop ] = method() method_offset
// [Method ] = method() method_offset
// [last esp ] = last_sp() last_sp_offset
// [old stack pointer ] (sender_sp) sender_sp_offset

View file

@ -3286,7 +3286,7 @@ void TemplateTable::invokevirtual_helper(Register index,
const Register method = index; // method must be rmethod
assert(method == rmethod,
"methodOop must be rmethod for interpreter calling convention");
"Method must be rmethod for interpreter calling convention");
// do the call - the index is actually the method to call
// that is, f2 is a vtable index if !is_vfinal, else f2 is a Method*
@ -3309,7 +3309,7 @@ void TemplateTable::invokevirtual_helper(Register index,
// profile this call
__ profile_virtual_call(r0, rlocals, r3);
// get target methodOop & entry point
// get target Method & entry point
__ lookup_virtual_method(r0, index, method);
__ profile_arguments_type(r3, method, r4, true);
// FIXME -- this looks completely redundant. is it?
@ -3444,7 +3444,7 @@ void TemplateTable::invokeinterface(int byte_no) {
rmethod, r13,
no_such_interface);
// rmethod,: methodOop to call
// rmethod,: Method to call
// r2: receiver
// Check for abstract method error
// Note: This should be done more efficiently via a throw_abstract_method_error
@ -3456,7 +3456,7 @@ void TemplateTable::invokeinterface(int byte_no) {
// do the call
// r2: receiver
// rmethod,: methodOop
// rmethod,: Method
__ jump_from_interpreted(rmethod, r3);
__ should_not_reach_here();

View file

@ -8869,12 +8869,12 @@ instruct CallLeafNoFPDirect(method meth) %{
// Also known as an 'interprocedural jump'.
// Target of jump will eventually return to caller.
// TailJump below removes the return address.
instruct TailCalljmpInd(IPRegP jump_target, inline_cache_regP method_oop) %{
match(TailCall jump_target method_oop );
instruct TailCalljmpInd(IPRegP jump_target, inline_cache_regP method_ptr) %{
match(TailCall jump_target method_ptr);
ins_cost(CALL_COST);
format %{ "MOV Rexception_pc, LR\n\t"
"jump $jump_target \t! $method_oop holds method oop" %}
"jump $jump_target \t! $method_ptr holds method" %}
ins_encode %{
__ mov(Rexception_pc, LR); // this is used only to call
// StubRoutines::forward_exception_entry()

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -42,7 +42,7 @@ public:
// Similar to InterpreterMacroAssembler::jump_from_interpreted.
// Takes care of special dispatch from single stepping too.
// Rmethod should contain target methodOop.
// Rmethod should contain target Method.
static void jump_from_method_handle(MacroAssembler* _masm, bool for_compiler_entry);
static void jump_to_lambda_form(MacroAssembler* _masm,

View file

@ -3940,7 +3940,7 @@ encode %{
int entry_offset = in_bytes(Klass::vtable_start_offset()) + _vtable_index * vtableEntry::size_in_bytes();
int v_off = entry_offset + vtableEntry::method_offset_in_bytes();
__ li(R19_method, v_off);
__ ldx(R19_method/*method oop*/, R19_method/*method offset*/, R11_scratch1/*class*/);
__ ldx(R19_method/*method*/, R19_method/*method offset*/, R11_scratch1/*class*/);
// NOTE: for vtable dispatches, the vtable entry will never be
// null. However it may very well end up in handle_wrong_method
// if the method is abstract for the particular class.
@ -15124,11 +15124,11 @@ instruct CallLeafNoFPDirect_Ex(method meth) %{
// Also known as an 'interprocedural jump'.
// Target of jump will eventually return to caller.
// TailJump below removes the return address.
instruct TailCalljmpInd(iRegPdstNoScratch jump_target, inline_cache_regP method_oop) %{
match(TailCall jump_target method_oop);
instruct TailCalljmpInd(iRegPdstNoScratch jump_target, inline_cache_regP method_ptr) %{
match(TailCall jump_target method_ptr);
ins_cost(CALL_COST);
format %{ "MTCTR $jump_target \t// $method_oop holds method oop\n\t"
format %{ "MTCTR $jump_target \t// $method_ptr holds method\n\t"
"BCTR \t// tail call" %}
size(8);
ins_encode %{

View file

@ -9830,11 +9830,11 @@ instruct CallLeafNoFPDirect(method meth) %{
// Also known as an 'interprocedural jump'.
// Target of jump will eventually return to caller.
// TailJump below removes the return address.
instruct TailCalljmpInd(iRegP jump_target, inline_cache_regP method_oop) %{
match(TailCall jump_target method_oop);
instruct TailCalljmpInd(iRegP jump_target, inline_cache_regP method_ptr) %{
match(TailCall jump_target method_ptr);
ins_cost(CALL_COST);
size(2);
format %{ "Jmp $jump_target\t # $method_oop holds method oop" %}
format %{ "Jmp $jump_target\t # $method_ptr holds method" %}
ins_encode %{ __ z_br($jump_target$$Register); %}
ins_pipe(pipe_class_dummy);
%}

View file

@ -2625,10 +2625,10 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
}
// Jump to the compiled code just as if compiled code was doing it.
// load target address from method oop:
// load target address from method:
__ z_lg(Z_R1_scratch, Address(Z_method, Method::from_compiled_offset()));
// Store method oop into thread->callee_target.
// Store method into thread->callee_target.
// 6243940: We might end up in handle_wrong_method if
// the callee is deoptimized as we race thru here. If that
// happens we don't want to take a safepoint because the

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2018 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -117,14 +117,14 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
// Set method (in case of interpreted method), and destination address.
// Duplicate safety code from enc_class Java_Dynamic_Call_dynTOC.
if (Displacement::is_validDisp(v_off)) {
__ z_lg(Z_method/*method oop*/, v_off, rcvr_klass/*class oop*/);
__ z_lg(Z_method/*method*/, v_off, rcvr_klass/*class*/);
// Account for the load_const in the else path.
slop_delta = __ load_const_size();
} else {
// Worse case, offset does not fit in displacement field.
// worst case actual size
slop_delta = __ load_const_size() - __ load_const_optimized_rtn_len(Z_method, v_off, true);
__ z_lg(Z_method/*method oop*/, 0, Z_method/*method offset*/, rcvr_klass/*class oop*/);
__ z_lg(Z_method/*method*/, 0, Z_method/*method offset*/, rcvr_klass/*class*/);
}
slop_bytes += slop_delta;

View file

@ -953,7 +953,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
assert(InterpreterRuntime::SignatureHandlerGenerator::temp() == NOT_LP64(t) LP64_ONLY(rscratch1),
"adjust this code");
// The generated handlers do not touch RBX (the method oop).
// The generated handlers do not touch RBX (the method).
// However, large signatures cannot be cached and are generated
// each time here. The slow-path generator can do a GC on return,
// so we must reload it after the call.

View file

@ -1934,9 +1934,9 @@ encode %{
// // int imo_reg = Matcher::interpreter_method_oop_reg();
// // int imo_encode = Matcher::_regEncode[imo_reg];
//
// // // Interpreter expects method_oop in EBX, currently a callee-saved register,
// // // Interpreter expects method_ptr in EBX, currently a callee-saved register,
// // // so we load it immediately before the call
// // emit_opcode(cbuf, 0x8B); // MOV imo_reg,ic_reg # method_oop
// // emit_opcode(cbuf, 0x8B); // MOV imo_reg,ic_reg # method_ptr
// // emit_rm(cbuf, 0x03, imo_encode, ic_encode ); // R/M byte
//
// // xor rbp,ebp
@ -13317,10 +13317,10 @@ instruct Ret() %{
// Also known as an 'interprocedural jump'.
// Target of jump will eventually return to caller.
// TailJump below removes the return address.
instruct TailCalljmpInd(eRegP_no_EBP jump_target, eBXRegP method_oop) %{
match(TailCall jump_target method_oop );
instruct TailCalljmpInd(eRegP_no_EBP jump_target, eBXRegP method_ptr) %{
match(TailCall jump_target method_ptr);
ins_cost(300);
format %{ "JMP $jump_target \t# EBX holds method oop" %}
format %{ "JMP $jump_target \t# EBX holds method" %}
opcode(0xFF, 0x4); /* Opcode FF /4 */
ins_encode( OpcP, RegOpc(jump_target) );
ins_pipe( pipe_jmp );

View file

@ -12587,12 +12587,12 @@ instruct Ret()
// Also known as an 'interprocedural jump'.
// Target of jump will eventually return to caller.
// TailJump below removes the return address.
instruct TailCalljmpInd(no_rbp_RegP jump_target, rbx_RegP method_oop)
instruct TailCalljmpInd(no_rbp_RegP jump_target, rbx_RegP method_ptr)
%{
match(TailCall jump_target method_oop);
match(TailCall jump_target method_ptr);
ins_cost(300);
format %{ "jmp $jump_target\t# rbx holds method oop" %}
format %{ "jmp $jump_target\t# rbx holds method" %}
opcode(0xFF, 0x4); /* Opcode FF /4 */
ins_encode(REX_reg(jump_target), OpcP, reg_opc(jump_target));
ins_pipe(pipe_jmp);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1150,7 +1150,7 @@ void ADLParser::inline_cache_parse(FrameForm *frame, bool native) {
//------------------------------interpreter_method_oop_parse------------------
void ADLParser::interpreter_method_oop_parse(FrameForm *frame, bool native) {
frame->_interpreter_method_oop_reg = parse_one_arg("method oop reg entry");
frame->_interpreter_method_oop_reg = parse_one_arg("method reg entry");
}
//------------------------------cisc_spilling_operand_parse---------------------

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -383,7 +383,7 @@ class PatchingStub: public CodeStub {
Label _patch_site_continuation;
Register _obj;
CodeEmitInfo* _info;
int _index; // index of the patchable oop or Klass* in nmethod oop or metadata table if needed
int _index; // index of the patchable oop or Klass* in nmethod or metadata table if needed
static int _patch_info_offset;
void align_patch_site(MacroAssembler* masm);

View file

@ -429,7 +429,7 @@ JRT_END
// counter_overflow() is called from within C1-compiled methods. The enclosing method is the method
// associated with the top activation record. The inlinee (that is possibly included in the enclosing
// method) method oop is passed as an argument. In order to do that it is embedded in the code as
// method) method is passed as an argument. In order to do that it is embedded in the code as
// a constant.
static nmethod* counter_overflow_helper(JavaThread* THREAD, int branch_bci, Method* m) {
nmethod* osr_nm = NULL;

View file

@ -627,7 +627,7 @@ class CompileReplay : public StackObj {
// method to be rewritten (number of arguments at a call for
// instance)
method->method_holder()->link_class(CHECK);
// methodOopDesc::build_interpreter_method_data(method, CHECK);
// Method::build_interpreter_method_data(method, CHECK);
{
// Grab a lock here to prevent multiple
// MethodData*s from being created.

View file

@ -2330,7 +2330,7 @@ void GenerateOopMap::rewrite_refval_conflict(int from, int to) {
bool startOver;
do {
// Make sure that the BytecodeStream is constructed in the loop, since
// during rewriting a new method oop is going to be used, and the next time
// during rewriting a new method is going to be used, and the next time
// around we want to use that.
BytecodeStream bcs(_method);
startOver = false;
@ -2467,7 +2467,7 @@ void GenerateOopMap::expand_current_instr(int bci, int ilen, int newIlen, u_char
return;
}
// Relocator returns a new method oop.
// Relocator returns a new method.
_did_relocation = true;
_method = m;
}

View file

@ -350,7 +350,7 @@ void Method::metaspace_pointers_do(MetaspaceClosure* it) {
it->push_method_entry(&this_ptr, (intptr_t*)&_from_interpreted_entry);
}
// Attempt to return method oop to original state. Clear any pointers
// Attempt to return method to original state. Clear any pointers
// (to objects outside the shared spaces). We won't be able to predict
// where they should point in a new JVM. Further initialize some
// entries now in order allow them to be write protected later.

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1955,7 +1955,7 @@ bool Matcher::clone_base_plus_offset_address(AddPNode* m, Matcher::MStack& mstac
}
// A method-klass-holder may be passed in the inline_cache_reg
// and then expanded into the inline_cache_reg and a method_oop register
// and then expanded into the inline_cache_reg and a method_ptr register
// defined in ad_<arch>.cpp
//------------------------------find_shared------------------------------------

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -408,7 +408,7 @@ public:
static int number_of_saved_registers();
// The Method-klass-holder may be passed in the inline_cache_reg
// and then expanded into the inline_cache_reg and a method_oop register
// and then expanded into the inline_cache_reg and a method_ptr register
static OptoReg::Name interpreter_method_oop_reg();
static int interpreter_method_oop_reg_encode();

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
@ -887,10 +887,10 @@ static jvmtiError JNICALL
<xsl:template match="jmethodID" mode="dochecks">
<xsl:param name="name"/>
<xsl:text> Method* method_oop = Method::checked_resolve_jmethod_id(</xsl:text>
<xsl:text> Method* checked_method = Method::checked_resolve_jmethod_id(</xsl:text>
<xsl:value-of select="$name"/>
<xsl:text>);&#xA;</xsl:text>
<xsl:text> if (method_oop == NULL) {&#xA;</xsl:text>
<xsl:text> if (checked_method == NULL) {&#xA;</xsl:text>
<xsl:apply-templates select=".." mode="traceError">
<xsl:with-param name="err">JVMTI_ERROR_INVALID_METHODID</xsl:with-param>
<xsl:with-param name="comment"></xsl:with-param>
@ -899,7 +899,7 @@ static jvmtiError JNICALL
<xsl:text>&#xA;</xsl:text>
<xsl:text> }&#xA;</xsl:text>
<xsl:if test="count(@native)=1 and contains(@native,'error')">
<xsl:text> if (method_oop->is_native()) {&#xA;</xsl:text>
<xsl:text> if (checked_method->is_native()) {&#xA;</xsl:text>
<xsl:text> return JVMTI_ERROR_NATIVE_METHOD;&#xA;</xsl:text>
<xsl:text> }&#xA;</xsl:text>
</xsl:if>
@ -1152,8 +1152,8 @@ static jvmtiError JNICALL
<xsl:template match="jmethodID" mode="traceInValue">
<xsl:param name="name"/>
<xsl:text>,
method_oop == NULL? "NULL" : method_oop->klass_name()->as_C_string(),
method_oop == NULL? "NULL" : method_oop->name()->as_C_string()
checked_method == NULL? "NULL" : checked_method->klass_name()->as_C_string(),
checked_method == NULL? "NULL" : checked_method->name()->as_C_string()
</xsl:text>
</xsl:template>

View file

@ -2250,20 +2250,20 @@ JvmtiEnv::SetLocalDouble(JavaThread* java_thread, jint depth, jint slot, jdouble
// Breakpoint functions
//
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
jvmtiError
JvmtiEnv::SetBreakpoint(Method* method_oop, jlocation location) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
JvmtiEnv::SetBreakpoint(Method* method, jlocation location) {
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
if (location < 0) { // simple invalid location check first
return JVMTI_ERROR_INVALID_LOCATION;
}
// verify that the breakpoint is not past the end of the method
if (location >= (jlocation) method_oop->code_size()) {
if (location >= (jlocation) method->code_size()) {
return JVMTI_ERROR_INVALID_LOCATION;
}
ResourceMark rm;
JvmtiBreakpoint bp(method_oop, location);
JvmtiBreakpoint bp(method, location);
JvmtiBreakpoints& jvmti_breakpoints = JvmtiCurrentBreakpoints::get_jvmti_breakpoints();
if (jvmti_breakpoints.set(bp) == JVMTI_ERROR_DUPLICATE)
return JVMTI_ERROR_DUPLICATE;
@ -2276,21 +2276,21 @@ JvmtiEnv::SetBreakpoint(Method* method_oop, jlocation location) {
} /* end SetBreakpoint */
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
jvmtiError
JvmtiEnv::ClearBreakpoint(Method* method_oop, jlocation location) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
JvmtiEnv::ClearBreakpoint(Method* method, jlocation location) {
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
if (location < 0) { // simple invalid location check first
return JVMTI_ERROR_INVALID_LOCATION;
}
// verify that the breakpoint is not past the end of the method
if (location >= (jlocation) method_oop->code_size()) {
if (location >= (jlocation) method->code_size()) {
return JVMTI_ERROR_INVALID_LOCATION;
}
JvmtiBreakpoint bp(method_oop, location);
JvmtiBreakpoint bp(method, location);
JvmtiBreakpoints& jvmti_breakpoints = JvmtiCurrentBreakpoints::get_jvmti_breakpoints();
if (jvmti_breakpoints.clear(bp) == JVMTI_ERROR_NOT_FOUND)
@ -2945,34 +2945,34 @@ JvmtiEnv::IsFieldSynthetic(fieldDescriptor* fdesc_ptr, jboolean* is_synthetic_pt
// Method functions
//
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
// name_ptr - NULL is a valid value, must be checked
// signature_ptr - NULL is a valid value, must be checked
// generic_ptr - NULL is a valid value, must be checked
jvmtiError
JvmtiEnv::GetMethodName(Method* method_oop, char** name_ptr, char** signature_ptr, char** generic_ptr) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
JvmtiEnv::GetMethodName(Method* method, char** name_ptr, char** signature_ptr, char** generic_ptr) {
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
JavaThread* current_thread = JavaThread::current();
ResourceMark rm(current_thread); // get the utf8 name and signature
if (name_ptr == NULL) {
// just don't return the name
} else {
const char* utf8_name = (const char *) method_oop->name()->as_utf8();
const char* utf8_name = (const char *) method->name()->as_utf8();
*name_ptr = (char *) jvmtiMalloc(strlen(utf8_name)+1);
strcpy(*name_ptr, utf8_name);
}
if (signature_ptr == NULL) {
// just don't return the signature
} else {
const char* utf8_signature = (const char *) method_oop->signature()->as_utf8();
const char* utf8_signature = (const char *) method->signature()->as_utf8();
*signature_ptr = (char *) jvmtiMalloc(strlen(utf8_signature) + 1);
strcpy(*signature_ptr, utf8_signature);
}
if (generic_ptr != NULL) {
*generic_ptr = NULL;
Symbol* soop = method_oop->generic_signature();
Symbol* soop = method->generic_signature();
if (soop != NULL) {
const char* gen_sig = soop->as_C_string();
if (gen_sig != NULL) {
@ -2988,56 +2988,56 @@ JvmtiEnv::GetMethodName(Method* method_oop, char** name_ptr, char** signature_pt
} /* end GetMethodName */
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
// declaring_class_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::GetMethodDeclaringClass(Method* method_oop, jclass* declaring_class_ptr) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
(*declaring_class_ptr) = get_jni_class_non_null(method_oop->method_holder());
JvmtiEnv::GetMethodDeclaringClass(Method* method, jclass* declaring_class_ptr) {
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
(*declaring_class_ptr) = get_jni_class_non_null(method->method_holder());
return JVMTI_ERROR_NONE;
} /* end GetMethodDeclaringClass */
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
// modifiers_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::GetMethodModifiers(Method* method_oop, jint* modifiers_ptr) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
(*modifiers_ptr) = method_oop->access_flags().as_int() & JVM_RECOGNIZED_METHOD_MODIFIERS;
JvmtiEnv::GetMethodModifiers(Method* method, jint* modifiers_ptr) {
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
(*modifiers_ptr) = method->access_flags().as_int() & JVM_RECOGNIZED_METHOD_MODIFIERS;
return JVMTI_ERROR_NONE;
} /* end GetMethodModifiers */
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
// max_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::GetMaxLocals(Method* method_oop, jint* max_ptr) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
JvmtiEnv::GetMaxLocals(Method* method, jint* max_ptr) {
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
// get max stack
(*max_ptr) = method_oop->max_locals();
(*max_ptr) = method->max_locals();
return JVMTI_ERROR_NONE;
} /* end GetMaxLocals */
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
// size_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::GetArgumentsSize(Method* method_oop, jint* size_ptr) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
JvmtiEnv::GetArgumentsSize(Method* method, jint* size_ptr) {
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
// get size of arguments
(*size_ptr) = method_oop->size_of_parameters();
(*size_ptr) = method->size_of_parameters();
return JVMTI_ERROR_NONE;
} /* end GetArgumentsSize */
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
// entry_count_ptr - pre-checked for NULL
// table_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::GetLineNumberTable(Method* method_oop, jint* entry_count_ptr, jvmtiLineNumberEntry** table_ptr) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
if (!method_oop->has_linenumber_table()) {
JvmtiEnv::GetLineNumberTable(Method* method, jint* entry_count_ptr, jvmtiLineNumberEntry** table_ptr) {
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
if (!method->has_linenumber_table()) {
return (JVMTI_ERROR_ABSENT_INFORMATION);
}
@ -3046,7 +3046,7 @@ JvmtiEnv::GetLineNumberTable(Method* method_oop, jint* entry_count_ptr, jvmtiLin
// Compute size of table
jint num_entries = 0;
CompressedLineNumberReadStream stream(method_oop->compressed_linenumber_table());
CompressedLineNumberReadStream stream(method->compressed_linenumber_table());
while (stream.read_pair()) {
num_entries++;
}
@ -3056,7 +3056,7 @@ JvmtiEnv::GetLineNumberTable(Method* method_oop, jint* entry_count_ptr, jvmtiLin
// Fill jvmti table
if (num_entries > 0) {
int index = 0;
CompressedLineNumberReadStream stream(method_oop->compressed_linenumber_table());
CompressedLineNumberReadStream stream(method->compressed_linenumber_table());
while (stream.read_pair()) {
jvmti_table[index].start_location = (jlocation) stream.bci();
jvmti_table[index].line_number = (jint) stream.line();
@ -3073,16 +3073,16 @@ JvmtiEnv::GetLineNumberTable(Method* method_oop, jint* entry_count_ptr, jvmtiLin
} /* end GetLineNumberTable */
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
// start_location_ptr - pre-checked for NULL
// end_location_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::GetMethodLocation(Method* method_oop, jlocation* start_location_ptr, jlocation* end_location_ptr) {
JvmtiEnv::GetMethodLocation(Method* method, jlocation* start_location_ptr, jlocation* end_location_ptr) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
// get start and end location
(*end_location_ptr) = (jlocation) (method_oop->code_size() - 1);
if (method_oop->code_size() == 0) {
(*end_location_ptr) = (jlocation) (method->code_size() - 1);
if (method->code_size() == 0) {
// there is no code so there is no start location
(*start_location_ptr) = (jlocation)(-1);
} else {
@ -3093,33 +3093,33 @@ JvmtiEnv::GetMethodLocation(Method* method_oop, jlocation* start_location_ptr, j
} /* end GetMethodLocation */
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
// entry_count_ptr - pre-checked for NULL
// table_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::GetLocalVariableTable(Method* method_oop, jint* entry_count_ptr, jvmtiLocalVariableEntry** table_ptr) {
JvmtiEnv::GetLocalVariableTable(Method* method, jint* entry_count_ptr, jvmtiLocalVariableEntry** table_ptr) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
JavaThread* current_thread = JavaThread::current();
// does the klass have any local variable information?
InstanceKlass* ik = method_oop->method_holder();
InstanceKlass* ik = method->method_holder();
if (!ik->access_flags().has_localvariable_table()) {
return (JVMTI_ERROR_ABSENT_INFORMATION);
}
ConstantPool* constants = method_oop->constants();
ConstantPool* constants = method->constants();
NULL_CHECK(constants, JVMTI_ERROR_ABSENT_INFORMATION);
// in the vm localvariable table representation, 6 consecutive elements in the table
// represent a 6-tuple of shorts
// [start_pc, length, name_index, descriptor_index, signature_index, index]
jint num_entries = method_oop->localvariable_table_length();
jint num_entries = method->localvariable_table_length();
jvmtiLocalVariableEntry *jvmti_table = (jvmtiLocalVariableEntry *)
jvmtiMalloc(num_entries * (sizeof(jvmtiLocalVariableEntry)));
if (num_entries > 0) {
LocalVariableTableElement* table = method_oop->localvariable_table_start();
LocalVariableTableElement* table = method->localvariable_table_start();
for (int i = 0; i < num_entries; i++) {
// get the 5 tuple information from the vm table
jlocation start_location = (jlocation) table[i].start_bci;
@ -3170,16 +3170,16 @@ JvmtiEnv::GetLocalVariableTable(Method* method_oop, jint* entry_count_ptr, jvmti
} /* end GetLocalVariableTable */
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
// bytecode_count_ptr - pre-checked for NULL
// bytecodes_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::GetBytecodes(Method* method_oop, jint* bytecode_count_ptr, unsigned char** bytecodes_ptr) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
JvmtiEnv::GetBytecodes(Method* method, jint* bytecode_count_ptr, unsigned char** bytecodes_ptr) {
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
HandleMark hm;
methodHandle method(Thread::current(), method_oop);
jint size = (jint)method->code_size();
methodHandle mh(Thread::current(), method);
jint size = (jint)mh->code_size();
jvmtiError err = allocate(size, bytecodes_ptr);
if (err != JVMTI_ERROR_NONE) {
return err;
@ -3187,36 +3187,36 @@ JvmtiEnv::GetBytecodes(Method* method_oop, jint* bytecode_count_ptr, unsigned ch
(*bytecode_count_ptr) = size;
// get byte codes
JvmtiClassFileReconstituter::copy_bytecodes(method, *bytecodes_ptr);
JvmtiClassFileReconstituter::copy_bytecodes(mh, *bytecodes_ptr);
return JVMTI_ERROR_NONE;
} /* end GetBytecodes */
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
// is_native_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::IsMethodNative(Method* method_oop, jboolean* is_native_ptr) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
(*is_native_ptr) = method_oop->is_native();
JvmtiEnv::IsMethodNative(Method* method, jboolean* is_native_ptr) {
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
(*is_native_ptr) = method->is_native();
return JVMTI_ERROR_NONE;
} /* end IsMethodNative */
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
// is_synthetic_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::IsMethodSynthetic(Method* method_oop, jboolean* is_synthetic_ptr) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
(*is_synthetic_ptr) = method_oop->is_synthetic();
JvmtiEnv::IsMethodSynthetic(Method* method, jboolean* is_synthetic_ptr) {
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
(*is_synthetic_ptr) = method->is_synthetic();
return JVMTI_ERROR_NONE;
} /* end IsMethodSynthetic */
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
// method - pre-checked for validity, but may be NULL meaning obsolete method
// is_obsolete_ptr - pre-checked for NULL
jvmtiError
JvmtiEnv::IsMethodObsolete(Method* method_oop, jboolean* is_obsolete_ptr) {
JvmtiEnv::IsMethodObsolete(Method* method, jboolean* is_obsolete_ptr) {
if (use_version_1_0_semantics() &&
get_capabilities()->can_redefine_classes == 0) {
// This JvmtiEnv requested version 1.0 semantics and this function
@ -3225,7 +3225,7 @@ JvmtiEnv::IsMethodObsolete(Method* method_oop, jboolean* is_obsolete_ptr) {
return JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
}
if (method_oop == NULL || method_oop->is_obsolete()) {
if (method == NULL || method->is_obsolete()) {
*is_obsolete_ptr = true;
} else {
*is_obsolete_ptr = false;

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!--
Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
@ -139,7 +139,7 @@ JvmtiEnv::</xsl:text>
<xsl:template match="jmethodID" mode="advice">
<xsl:param name="name"/>
<xsl:text>
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method</xsl:text>
// method - pre-checked for validity, but may be NULL meaning obsolete method</xsl:text>
</xsl:template>
<xsl:template match="jfieldID" mode="advice">

View file

@ -531,15 +531,15 @@ bool VM_GetOrSetLocal::is_assignable(const char* ty_sign, Klass* klass, Thread*
// Returns: 'true' - everything is Ok, 'false' - error code
bool VM_GetOrSetLocal::check_slot_type_lvt(javaVFrame* jvf) {
Method* method_oop = jvf->method();
jint num_entries = method_oop->localvariable_table_length();
Method* method = jvf->method();
jint num_entries = method->localvariable_table_length();
if (num_entries == 0) {
_result = JVMTI_ERROR_INVALID_SLOT;
return false; // There are no slots
}
int signature_idx = -1;
int vf_bci = jvf->bci();
LocalVariableTableElement* table = method_oop->localvariable_table_start();
LocalVariableTableElement* table = method->localvariable_table_start();
for (int i = 0; i < num_entries; i++) {
int start_bci = table[i].start_bci;
int end_bci = start_bci + table[i].length;
@ -555,7 +555,7 @@ bool VM_GetOrSetLocal::check_slot_type_lvt(javaVFrame* jvf) {
_result = JVMTI_ERROR_INVALID_SLOT;
return false; // Incorrect slot index
}
Symbol* sign_sym = method_oop->constants()->symbol_at(signature_idx);
Symbol* sign_sym = method->constants()->symbol_at(signature_idx);
BasicType slot_type = Signature::basic_type(sign_sym);
switch (slot_type) {
@ -597,10 +597,10 @@ bool VM_GetOrSetLocal::check_slot_type_lvt(javaVFrame* jvf) {
}
bool VM_GetOrSetLocal::check_slot_type_no_lvt(javaVFrame* jvf) {
Method* method_oop = jvf->method();
Method* method = jvf->method();
jint extra_slot = (_type == T_LONG || _type == T_DOUBLE) ? 1 : 0;
if (_index < 0 || _index + extra_slot >= method_oop->max_locals()) {
if (_index < 0 || _index + extra_slot >= method->max_locals()) {
_result = JVMTI_ERROR_INVALID_SLOT;
return false;
}
@ -633,16 +633,16 @@ bool VM_GetOrSetLocal::doit_prologue() {
_jvf = get_java_vframe();
NULL_CHECK(_jvf, false);
Method* method_oop = _jvf->method();
Method* method = _jvf->method();
if (getting_receiver()) {
if (method_oop->is_static()) {
if (method->is_static()) {
_result = JVMTI_ERROR_INVALID_SLOT;
return false;
}
return true;
}
if (method_oop->is_native()) {
if (method->is_native()) {
_result = JVMTI_ERROR_OPAQUE_FRAME;
return false;
}
@ -650,7 +650,7 @@ bool VM_GetOrSetLocal::doit_prologue() {
if (!check_slot_type_no_lvt(_jvf)) {
return false;
}
if (method_oop->has_localvariable_table()) {
if (method->has_localvariable_table()) {
return check_slot_type_lvt(_jvf);
}
return true;

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
@ -932,7 +932,7 @@ typedef </xsl:text>
</xsl:template>
<xsl:template match="jmethodID" mode="HotSpotName">
<xsl:text>method_oop</xsl:text>
<xsl:text>checked_method</xsl:text>
</xsl:template>
<xsl:template match="jfieldID" mode="HotSpotName">

View file

@ -868,7 +868,7 @@ const size_t minimumSymbolTableSize = 1024;
"Time calls to GenerateOopMap::compute_map() individually") \
\
develop(bool, TraceOopMapRewrites, false, \
"Trace rewriting of method oops during oop map generation") \
"Trace rewriting of methods during oop map generation") \
\
develop(bool, TraceICBuffer, false, \
"Trace usage of IC buffer") \