Skip to content

Commit 7976151

Browse files
committed
8313438: [s390x] build broken after JDK-8301996
Reviewed-by: mdoerr, lucy
1 parent ca96fd3 commit 7976151

File tree

3 files changed

+402
-265
lines changed

3 files changed

+402
-265
lines changed

src/hotspot/cpu/s390/interp_masm_s390.cpp

+34-4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "oops/markWord.hpp"
3737
#include "oops/methodCounters.hpp"
3838
#include "oops/methodData.hpp"
39+
#include "oops/resolvedFieldEntry.hpp"
3940
#include "oops/resolvedIndyEntry.hpp"
4041
#include "prims/jvmtiExport.hpp"
4142
#include "prims/jvmtiThreadState.hpp"
@@ -349,16 +350,45 @@ void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Regis
349350
}
350351

351352
void InterpreterMacroAssembler::load_resolved_indy_entry(Register cache, Register index) {
352-
// Get index out of bytecode pointer, get_cache_entry_pointer_at_bcp
353+
// Get index out of bytecode pointer.
353354
get_cache_index_at_bcp(index, 1, sizeof(u4));
354-
// Get address of invokedynamic array
355+
356+
// Get the address of the ResolvedIndyEntry array
355357
get_constant_pool_cache(cache);
356358
z_lg(cache, Address(cache, in_bytes(ConstantPoolCache::invokedynamic_entries_offset())));
357-
// Scale the index to be the entry index * sizeof(ResolvedInvokeDynamicInfo)
358-
z_sllg(index, index, exact_log2(sizeof(ResolvedIndyEntry)));
359+
360+
// Scale the index to form a byte offset into the ResolvedIndyEntry array
361+
size_t entry_size = sizeof(ResolvedIndyEntry);
362+
if (is_power_of_2(entry_size)) {
363+
z_sllg(index, index, exact_log2(entry_size));
364+
} else {
365+
z_mghi(index, entry_size);
366+
}
367+
368+
// Calculate the final field address.
359369
z_la(cache, Array<ResolvedIndyEntry>::base_offset_in_bytes(), index, cache);
360370
}
361371

372+
void InterpreterMacroAssembler::load_field_entry(Register cache, Register index, int bcp_offset) {
373+
// Get field index out of bytecode pointer.
374+
get_cache_index_at_bcp(index, bcp_offset, sizeof(u2));
375+
376+
// Get the address of the ResolvedFieldEntry array.
377+
get_constant_pool_cache(cache);
378+
z_lg(cache, Address(cache, in_bytes(ConstantPoolCache::field_entries_offset())));
379+
380+
// Scale the index to form a byte offset into the ResolvedFieldEntry array
381+
size_t entry_size = sizeof(ResolvedFieldEntry);
382+
if (is_power_of_2(entry_size)) {
383+
z_sllg(index, index, exact_log2(entry_size));
384+
} else {
385+
z_mghi(index, entry_size);
386+
}
387+
388+
// Calculate the final field address.
389+
z_la(cache, Array<ResolvedFieldEntry>::base_offset_in_bytes(), index, cache);
390+
}
391+
362392
// Kills Z_R0_scratch.
363393
void InterpreterMacroAssembler::get_cache_and_index_and_bytecode_at_bcp(Register cache,
364394
Register cpe_offset,

src/hotspot/cpu/s390/interp_masm_s390.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
113113

114114
void get_cache_and_index_at_bcp(Register cache, Register cpe_offset, int bcp_offset, size_t index_size = sizeof(u2));
115115
void load_resolved_indy_entry(Register cache, Register index);
116+
void load_field_entry(Register cache, Register index, int bcp_offset = 1);
116117
void get_cache_and_index_and_bytecode_at_bcp(Register cache, Register cpe_offset, Register bytecode,
117118
int byte_no, int bcp_offset, size_t index_size = sizeof(u2));
118119
void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));

0 commit comments

Comments
 (0)