Skip to content

Commit

Permalink
Merge branch 'upstream-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Datadog Syncup Service committed Oct 11, 2023
2 parents 0d37f05 + bcafec5 commit e4b2941
Show file tree
Hide file tree
Showing 26 changed files with 1,341 additions and 600 deletions.
7 changes: 5 additions & 2 deletions make/test/BuildMicrobenchmark.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ $(eval $(call SetupJavaCompilation, BUILD_INDIFY, \
#### Compile Targets

# Building microbenchmark requires the jdk.unsupported and java.management modules.
# sun.security.util is required to compile Cache benchmark
# sun.security.util is required to compile Cache benchmark.
# jmh uses annotation processors to generate the benchmark jar and thus
# requires the use of -processor option during benchmark compilation.

# Build microbenchmark suite for the current JDK
$(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
Expand All @@ -106,7 +108,8 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
--add-exports java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED \
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
--add-exports java.base/jdk.internal.event=ALL-UNNAMED \
--enable-preview, \
--enable-preview \
-processor org.openjdk.jmh.generators.BenchmarkProcessor, \
JAVA_FLAGS := --add-modules jdk.unsupported --limit-modules java.management \
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
--enable-preview, \
Expand Down
38 changes: 34 additions & 4 deletions src/hotspot/cpu/s390/interp_masm_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "oops/markWord.hpp"
#include "oops/methodCounters.hpp"
#include "oops/methodData.hpp"
#include "oops/resolvedFieldEntry.hpp"
#include "oops/resolvedIndyEntry.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiThreadState.hpp"
Expand Down Expand Up @@ -349,16 +350,45 @@ void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Regis
}

void InterpreterMacroAssembler::load_resolved_indy_entry(Register cache, Register index) {
// Get index out of bytecode pointer, get_cache_entry_pointer_at_bcp
// Get index out of bytecode pointer.
get_cache_index_at_bcp(index, 1, sizeof(u4));
// Get address of invokedynamic array

// Get the address of the ResolvedIndyEntry array
get_constant_pool_cache(cache);
z_lg(cache, Address(cache, in_bytes(ConstantPoolCache::invokedynamic_entries_offset())));
// Scale the index to be the entry index * sizeof(ResolvedInvokeDynamicInfo)
z_sllg(index, index, exact_log2(sizeof(ResolvedIndyEntry)));

// Scale the index to form a byte offset into the ResolvedIndyEntry array
size_t entry_size = sizeof(ResolvedIndyEntry);
if (is_power_of_2(entry_size)) {
z_sllg(index, index, exact_log2(entry_size));
} else {
z_mghi(index, entry_size);
}

// Calculate the final field address.
z_la(cache, Array<ResolvedIndyEntry>::base_offset_in_bytes(), index, cache);
}

void InterpreterMacroAssembler::load_field_entry(Register cache, Register index, int bcp_offset) {
// Get field index out of bytecode pointer.
get_cache_index_at_bcp(index, bcp_offset, sizeof(u2));

// Get the address of the ResolvedFieldEntry array.
get_constant_pool_cache(cache);
z_lg(cache, Address(cache, in_bytes(ConstantPoolCache::field_entries_offset())));

// Scale the index to form a byte offset into the ResolvedFieldEntry array
size_t entry_size = sizeof(ResolvedFieldEntry);
if (is_power_of_2(entry_size)) {
z_sllg(index, index, exact_log2(entry_size));
} else {
z_mghi(index, entry_size);
}

// Calculate the final field address.
z_la(cache, Array<ResolvedFieldEntry>::base_offset_in_bytes(), index, cache);
}

// Kills Z_R0_scratch.
void InterpreterMacroAssembler::get_cache_and_index_and_bytecode_at_bcp(Register cache,
Register cpe_offset,
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/cpu/s390/interp_masm_s390.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class InterpreterMacroAssembler: public MacroAssembler {

void get_cache_and_index_at_bcp(Register cache, Register cpe_offset, int bcp_offset, size_t index_size = sizeof(u2));
void load_resolved_indy_entry(Register cache, Register index);
void load_field_entry(Register cache, Register index, int bcp_offset = 1);
void get_cache_and_index_and_bytecode_at_bcp(Register cache, Register cpe_offset, Register bytecode,
int byte_no, int bcp_offset, size_t index_size = sizeof(u2));
void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));
Expand Down
Loading

0 comments on commit e4b2941

Please sign in to comment.