Skip to content

Commit

Permalink
8307312: Replace "int which" with "int cp_index" in constantPool
Browse files Browse the repository at this point in the history
Reviewed-by: coleenp, dholmes, iklam
  • Loading branch information
Matias Saavedra Silva committed Jul 31, 2023
1 parent 6af0af5 commit c91a300
Show file tree
Hide file tree
Showing 8 changed files with 329 additions and 329 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/c1/c1_GraphBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -998,8 +998,8 @@ void GraphBuilder::load_constant() {
// Unbox the value at runtime, if needed.
// ConstantDynamic entry can be of a primitive type, but it is cached in boxed form.
if (patch_state != nullptr) {
int index = stream()->get_constant_pool_index();
BasicType type = stream()->get_basic_type_for_constant_at(index);
int cp_index = stream()->get_constant_pool_index();
BasicType type = stream()->get_basic_type_for_constant_at(cp_index);
if (is_java_primitive(type)) {
ciInstanceKlass* box_klass = ciEnv::current()->get_box_klass_for_primitive_type(type);
assert(box_klass->is_loaded(), "sanity");
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/ci/ciStreams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ ciConstant ciBytecodeStream::get_constant() {
//
// If this bytecode is one of the ldc variants, get the referenced
// constant.
constantTag ciBytecodeStream::get_constant_pool_tag(int index) const {
constantTag ciBytecodeStream::get_constant_pool_tag(int cp_index) const {
VM_ENTRY_MARK;
return _method->get_Method()->constants()->constant_tag_at(index);
return _method->get_Method()->constants()->constant_tag_at(cp_index);
}

// ------------------------------------------------------------------
Expand All @@ -283,9 +283,9 @@ constantTag ciBytecodeStream::get_raw_pool_tag_at(int index) const {
// ------------------------------------------------------------------
// ciBytecodeStream::get_basic_type_for_constant_at
//
BasicType ciBytecodeStream::get_basic_type_for_constant_at(int index) const {
BasicType ciBytecodeStream::get_basic_type_for_constant_at(int cp_index) const {
VM_ENTRY_MARK;
return _method->get_Method()->constants()->basic_type_for_constant_at(index);
return _method->get_Method()->constants()->basic_type_for_constant_at(cp_index);
}

// ------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/ci/ciStreams.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class ciBytecodeStream : StackObj {
// object (ciConstant.as_object()->is_loaded() == false).
ciConstant get_constant();
constantTag get_constant_pool_tag(int index) const;
BasicType get_basic_type_for_constant_at(int index) const;
BasicType get_basic_type_for_constant_at(int cp_index) const;

constantTag get_raw_pool_tag_at(int index) const;

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/ci/ciTypeFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@ void ciTypeFlow::StateVector::do_ldc(ciBytecodeStream* str) {
}
ciConstant con = str->get_constant();
if (con.is_valid()) {
int index = str->get_constant_pool_index();
BasicType basic_type = str->get_basic_type_for_constant_at(index);
int cp_index = str->get_constant_pool_index();
BasicType basic_type = str->get_basic_type_for_constant_at(cp_index);
if (is_reference_type(basic_type)) {
ciObject* obj = con.as_object();
if (obj->is_null_object()) {
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/interpreter/bytecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ int Bytecode_loadconstant::pool_index() const {
}

BasicType Bytecode_loadconstant::result_type() const {
int index = pool_index();
return _method->constants()->basic_type_for_constant_at(index);
int cp_index = pool_index();
return _method->constants()->basic_type_for_constant_at(cp_index);
}

oop Bytecode_loadconstant::resolve_constant(TRAPS) const {
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/interpreter/interpreterRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ JRT_ENTRY(void, InterpreterRuntime::ldc(JavaThread* current, bool wide))
// access constant pool
LastFrameAccessor last_frame(current);
ConstantPool* pool = last_frame.method()->constants();
int index = wide ? last_frame.get_index_u2(Bytecodes::_ldc_w) : last_frame.get_index_u1(Bytecodes::_ldc);
constantTag tag = pool->tag_at(index);
int cp_index = wide ? last_frame.get_index_u2(Bytecodes::_ldc_w) : last_frame.get_index_u1(Bytecodes::_ldc);
constantTag tag = pool->tag_at(cp_index);

assert (tag.is_unresolved_klass() || tag.is_klass(), "wrong ldc call");
Klass* klass = pool->klass_at(index, CHECK);
Klass* klass = pool->klass_at(cp_index, CHECK);
oop java_class = klass->java_mirror();
current->set_vm_result(java_class);
JRT_END
Expand Down
Loading

0 comments on commit c91a300

Please sign in to comment.