8233328: fix minimal VM build on Linux s390x

Reviewed-by: lucy, mdoerr
This commit is contained in:
Matthias Baesken 2019-11-06 14:04:07 +01:00
parent 3b5b596f4b
commit 6e3be7fbf7
7 changed files with 18 additions and 109 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* Copyright (c) 2016, 2019, SAP SE. 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
@ -75,6 +75,7 @@ address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark/*
return stub;
#else
ShouldNotReachHere();
return NULL;
#endif
}

View File

@ -28,8 +28,6 @@
#include "code/codeCache.hpp"
#include "compiler/disassembler.hpp"
#include "depChecker_s390.hpp"
#include "gc/cms/concurrentMarkSweepGeneration.inline.hpp"
#include "gc/cms/parOopClosures.inline.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
#include "gc/shared/genOopClosures.inline.hpp"

View File

@ -37,9 +37,11 @@
#include "oops/accessDecorators.hpp"
#include "oops/compressedOops.inline.hpp"
#include "oops/klass.inline.hpp"
#ifdef COMPILER2
#include "opto/compile.hpp"
#include "opto/intrinsicnode.hpp"
#include "opto/matcher.hpp"
#endif
#include "prims/methodHandles.hpp"
#include "registerSaver_s390.hpp"
#include "runtime/biasedLocking.hpp"
@ -2925,7 +2927,7 @@ unsigned int MacroAssembler::call_ic_miss_handler(Label& ICM, int trapMarker, in
}
void MacroAssembler::nmethod_UEP(Label& ic_miss) {
Register ic_reg = as_Register(Matcher::inline_cache_reg_encode());
Register ic_reg = Z_inline_cache;
int klass_offset = oopDesc::klass_offset_in_bytes();
if (!ImplicitNullChecks || MacroAssembler::needs_explicit_null_check(klass_offset)) {
if (VM_Version::has_CompareBranch()) {
@ -4590,6 +4592,7 @@ unsigned int MacroAssembler::CopyRawMemory_AlignedDisjoint(Register src_reg, Reg
return block_end - block_start;
}
#ifdef COMPILER2
//------------------------------------------------------
// Special String Intrinsics. Implementation
//------------------------------------------------------
@ -5837,7 +5840,7 @@ unsigned int MacroAssembler::string_indexof_char(Register result, Register hayst
return offset() - block_start;
}
#endif
//-------------------------------------------------
// Constants (scalar and oop) in constant pool
@ -6150,96 +6153,6 @@ void MacroAssembler::translate_tt(Register r1, Register r2, uint m3) {
Assembler::z_brc(Assembler::bcondOverflow /* CC==3 (iterate) */, retry);
}
void MacroAssembler::generate_type_profiling(const Register Rdata,
const Register Rreceiver_klass,
const Register Rwanted_receiver_klass,
const Register Rmatching_row,
bool is_virtual_call) {
const int row_size = in_bytes(ReceiverTypeData::receiver_offset(1)) -
in_bytes(ReceiverTypeData::receiver_offset(0));
const int num_rows = ReceiverTypeData::row_limit();
NearLabel found_free_row;
NearLabel do_increment;
NearLabel found_no_slot;
BLOCK_COMMENT("type profiling {");
// search for:
// a) The type given in Rwanted_receiver_klass.
// b) The *first* empty row.
// First search for a) only, just running over b) with no regard.
// This is possible because
// wanted_receiver_class == receiver_class && wanted_receiver_class == 0
// is never true (receiver_class can't be zero).
for (int row_num = 0; row_num < num_rows; row_num++) {
// Row_offset should be a well-behaved positive number. The generated code relies
// on that wrt constant code size. Add2reg can handle all row_offset values, but
// will have to vary generated code size.
int row_offset = in_bytes(ReceiverTypeData::receiver_offset(row_num));
assert(Displacement::is_shortDisp(row_offset), "Limitation of generated code");
// Is Rwanted_receiver_klass in this row?
if (VM_Version::has_CompareBranch()) {
z_lg(Rwanted_receiver_klass, row_offset, Z_R0, Rdata);
// Rmatching_row = Rdata + row_offset;
add2reg(Rmatching_row, row_offset, Rdata);
// if (*row_recv == (intptr_t) receiver_klass) goto fill_existing_slot;
compare64_and_branch(Rwanted_receiver_klass, Rreceiver_klass, Assembler::bcondEqual, do_increment);
} else {
add2reg(Rmatching_row, row_offset, Rdata);
z_cg(Rreceiver_klass, row_offset, Z_R0, Rdata);
z_bre(do_increment);
}
}
// Now that we did not find a match, let's search for b).
// We could save the first calculation of Rmatching_row if we woud search for a) in reverse order.
// We would then end up here with Rmatching_row containing the value for row_num == 0.
// We would not see much benefit, if any at all, because the CPU can schedule
// two instructions together with a branch anyway.
for (int row_num = 0; row_num < num_rows; row_num++) {
int row_offset = in_bytes(ReceiverTypeData::receiver_offset(row_num));
// Has this row a zero receiver_klass, i.e. is it empty?
if (VM_Version::has_CompareBranch()) {
z_lg(Rwanted_receiver_klass, row_offset, Z_R0, Rdata);
// Rmatching_row = Rdata + row_offset
add2reg(Rmatching_row, row_offset, Rdata);
// if (*row_recv == (intptr_t) 0) goto found_free_row
compare64_and_branch(Rwanted_receiver_klass, (intptr_t)0, Assembler::bcondEqual, found_free_row);
} else {
add2reg(Rmatching_row, row_offset, Rdata);
load_and_test_long(Rwanted_receiver_klass, Address(Rdata, row_offset));
z_bre(found_free_row); // zero -> Found a free row.
}
}
// No match, no empty row found.
// Increment total counter to indicate polymorphic case.
if (is_virtual_call) {
add2mem_64(Address(Rdata, CounterData::count_offset()), 1, Rmatching_row);
}
z_bru(found_no_slot);
// Here we found an empty row, but we have not found Rwanted_receiver_klass.
// Rmatching_row holds the address to the first empty row.
bind(found_free_row);
// Store receiver_klass into empty slot.
z_stg(Rreceiver_klass, 0, Z_R0, Rmatching_row);
// Increment the counter of Rmatching_row.
bind(do_increment);
ByteSize counter_offset = ReceiverTypeData::receiver_count_offset(0) - ReceiverTypeData::receiver_offset(0);
add2mem_64(Address(Rmatching_row, counter_offset), 1, Rdata);
bind(found_no_slot);
BLOCK_COMMENT("} type profiling");
}
//---------------------------------------
// Helpers for Intrinsic Emitters
//---------------------------------------

View File

@ -850,6 +850,7 @@ class MacroAssembler: public Assembler {
// Kills: tmp, Z_R0, Z_R1.
// Early clobber: result.
// Boolean precise controls accuracy of result value.
#ifdef COMPILER2
unsigned int string_compress(Register result, Register src, Register dst, Register cnt,
Register tmp, bool precise);
@ -885,6 +886,7 @@ class MacroAssembler: public Assembler {
unsigned int string_indexof_char(Register result, Register haystack, Register haycnt,
Register needle, jchar needleChar, Register odd_reg, Register even_reg, bool is_byte);
#endif
// Emit an oop const to the constant pool and set a relocation info
// with address current_pc. Return the TOC offset of the constant.
@ -918,13 +920,6 @@ class MacroAssembler: public Assembler {
// Offset is +/- 2**32 -> use long.
static long get_load_const_from_toc_offset(address a);
void generate_type_profiling(const Register Rdata,
const Register Rreceiver_klass,
const Register Rwanted_receiver_klass,
const Register Rmatching_row,
bool is_virtual_call);
// Bit operations for single register operands.
inline void lshift(Register r, int places, bool doubl = true); // <<
inline void rshift(Register r, int places, bool doubl = true); // >>

View File

@ -32,6 +32,7 @@
#include "interpreter/interpreter.hpp"
#include "interpreter/interp_masm.hpp"
#include "memory/resourceArea.hpp"
#include "nativeInst_s390.hpp"
#include "oops/compiledICHolder.hpp"
#include "oops/klass.inline.hpp"
#include "registerSaver_s390.hpp"
@ -1521,7 +1522,6 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
VMRegPair *in_regs,
BasicType ret_type,
address critical_entry) {
#ifdef COMPILER2
int total_in_args = method->size_of_parameters();
if (method->is_method_handle_intrinsic()) {
vmIntrinsics::ID iid = method->intrinsic_id();
@ -2401,10 +2401,6 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
}
return nm;
#else
ShouldNotReachHere();
return NULL;
#endif // COMPILER2
}
static address gen_c2i_adapter(MacroAssembler *masm,
@ -2880,7 +2876,7 @@ void SharedRuntime::generate_deopt_blob() {
// to Deoptimization::fetch_unroll_info below.
// The (int) cast is necessary, because -((unsigned int)14)
// is an unsigned int.
__ add2reg(Z_R14, -(int)HandlerImpl::size_deopt_handler());
__ add2reg(Z_R14, -(int)NativeCall::max_instruction_size());
const Register exec_mode_reg = Z_tmp_1;

View File

@ -61,7 +61,9 @@ void VM_Version::initialize() {
intx cache_line_size = Dcache_lineSize(0);
#ifdef COMPILER2
MaxVectorSize = 8;
#endif
if (has_PrefetchRaw()) {
if (FLAG_IS_DEFAULT(AllocatePrefetchStyle)) { // not preset
@ -217,6 +219,7 @@ void VM_Version::initialize() {
FLAG_SET_DEFAULT(UseSHA, false);
}
#ifdef COMPILER2
if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) {
FLAG_SET_DEFAULT(UseMultiplyToLenIntrinsic, true);
}
@ -226,6 +229,7 @@ void VM_Version::initialize() {
if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) {
FLAG_SET_DEFAULT(UseMontgomerySquareIntrinsic, true);
}
#endif
if (FLAG_IS_DEFAULT(UsePopCountInstruction)) {
FLAG_SET_DEFAULT(UsePopCountInstruction, true);
}

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2018 SAP SE. All rights reserved.
* Copyright (c) 2016, 2019 SAP SE. 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
@ -426,6 +426,7 @@ JVM_handle_linux_signal(int sig,
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
}
#ifdef COMPILER2
// SIGTRAP-based implicit range check in compiled code.
else if (sig == SIGFPE && TrapBasedRangeChecks &&
(trap_pc != NULL) &&
@ -435,6 +436,7 @@ JVM_handle_linux_signal(int sig,
}
stub = SharedRuntime::continuation_for_implicit_exception(thread, trap_pc, SharedRuntime::IMPLICIT_NULL);
}
#endif
else if (sig == SIGFPE && info->si_code == FPE_INTDIV) {
stub = SharedRuntime::continuation_for_implicit_exception(thread, trap_pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);