Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8258558: Revert changes for JDK-8252505 and related issues
Reviewed-by: kvn
  • Loading branch information
shipilev committed Jan 6, 2021
1 parent e66187d commit ad456787192c84e1a974394f2066dd7a2cd30900
Showing 33 changed files with 2 additions and 1,662 deletions.
@@ -230,8 +230,6 @@ bool Compiler::is_intrinsic_supported(const methodHandle& method) {
break;
case vmIntrinsics::_getObjectSize:
break;
case vmIntrinsics::_blackhole:
break;
default:
return false; // Intrinsics not on the previous list are not available.
}
@@ -3415,7 +3415,7 @@ bool GraphBuilder::try_inline(ciMethod* callee, bool holder_known, bool ignore_r

// handle intrinsics
if (callee->intrinsic_id() != vmIntrinsics::_none &&
callee->check_intrinsic_candidate()) {
(CheckIntrinsics ? callee->intrinsic_candidate() : true)) {
if (try_inline_intrinsics(callee, ignore_return)) {
print_inlining(callee, "intrinsic");
if (callee->has_reserved_stack_access()) {
@@ -3206,10 +3206,6 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) {
do_vectorizedMismatch(x);
break;

case vmIntrinsics::_blackhole:
do_blackhole(x);
break;

default: ShouldNotReachHere(); break;
}
}
@@ -3629,23 +3625,6 @@ void LIRGenerator::do_RangeCheckPredicate(RangeCheckPredicate *x) {
}
}

void LIRGenerator::do_blackhole(Intrinsic *x) {
// If we have a receiver, then null-check and handle it separately
bool handle_receiver = x->needs_null_check();
if (handle_receiver) {
CodeEmitInfo* info = state_for(x);
LIRItem vitem(x->receiver(), this);
vitem.load_item();
__ null_check(vitem.result(), info);
}

for (int c = (handle_receiver ? 1 : 0); c < x->number_of_arguments(); c++) {
// Load the argument
LIRItem vitem(x->argument_at(c), this);
vitem.load_item();
// ...and leave it unused.
}
}

LIR_Opr LIRGenerator::call_runtime(Value arg1, address entry, ValueType* result_type, CodeEmitInfo* info) {
LIRItemList args(1);
@@ -265,7 +265,6 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
void do_update_CRC32(Intrinsic* x);
void do_update_CRC32C(Intrinsic* x);
void do_vectorizedMismatch(Intrinsic* x);
void do_blackhole(Intrinsic* x);

public:
LIR_Opr call_runtime(BasicTypeArray* signature, LIRItemList* args, address entry, ValueType* result_type, CodeEmitInfo* info);
@@ -155,10 +155,6 @@ ciMethod::ciMethod(const methodHandle& h_m, ciInstanceKlass* holder) :
ciReplay::initialize(this);
}
#endif

if (CompilerOracle::should_blackhole(h_m)) {
h_m->set_intrinsic_id(vmIntrinsics::_blackhole);
}
}


@@ -201,15 +201,6 @@ class ciMethod : public ciMetadata {
bool intrinsic_candidate() const { return get_Method()->intrinsic_candidate(); }
bool is_static_initializer() const { return get_Method()->is_static_initializer(); }

bool check_intrinsic_candidate() const {
if (intrinsic_id() == vmIntrinsics::_blackhole) {
// This is the intrinsic without an associated method, so no intrinsic_candidate
// flag is set. The intrinsic is still correct.
return true;
}
return (CheckIntrinsics ? intrinsic_candidate() : true);
}

int highest_osr_comp_level();

Bytecodes::Code java_code_at_bci(int bci) {
@@ -5308,11 +5308,6 @@ static void check_methods_for_intrinsics(const InstanceKlass* ik,
// is defined for it.
continue;
}
if (vmIntrinsics::_blackhole == id) {
// The _blackhole intrinsic is a special marker. No explicit method
// is defined for it.
continue;
}

if (vmIntrinsics::class_for(id) == klass_id) {
// Check if the current class contains a method with the same
@@ -151,7 +151,6 @@ bool vmIntrinsics::should_be_pinned(vmIntrinsics::ID id) {
#endif
case vmIntrinsics::_currentTimeMillis:
case vmIntrinsics::_nanoTime:
case vmIntrinsics::_blackhole:
return true;
default:
return false;
@@ -534,9 +534,6 @@ class methodHandle;
do_name( getObjectSize_name, "getObjectSize0") \
do_alias( getObjectSize_signature, long_object_long_signature) \
\
/* special marker for blackholed methods: */ \
do_intrinsic(_blackhole, java_lang_Object, blackhole_name, star_name, F_S) \
\
/* unsafe memory references (there are a lot of them...) */ \
do_signature(getReference_signature, "(Ljava/lang/Object;J)Ljava/lang/Object;") \
do_signature(putReference_signature, "(Ljava/lang/Object;JLjava/lang/Object;)V") \
@@ -283,7 +283,6 @@
template(signature_name, "signature") \
template(slot_name, "slot") \
template(trusted_final_name, "trustedFinal") \
template(blackhole_name, "<blackhole>") /*fake name*/ \
\
/* Support for annotations (JDK 1.5 and above) */ \
\
@@ -286,11 +286,6 @@ static void register_command(TypedMethodOptionMatcher* matcher,
}
assert(CompilerOracle::option_matches_type(option, value), "Value must match option type");

if (option == CompileCommand::Blackhole && !UnlockDiagnosticVMOptions) {
warning("Blackhole compile option is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions");
return;
}

matcher->init(option, option_list);
matcher->set_value<T>(value);
option_list = matcher;
@@ -414,19 +409,6 @@ bool CompilerOracle::should_break_at(const methodHandle& method) {
return check_predicate(CompileCommand::Break, method);
}

bool CompilerOracle::should_blackhole(const methodHandle& method) {
if (!check_predicate(CompileCommand::Blackhole, method)) {
return false;
}
guarantee(UnlockDiagnosticVMOptions, "Checked during initial parsing");
if (method->result_type() != T_VOID) {
warning("Blackhole compile option only works for methods with void type: %s",
method->name_and_sig_as_C_string());
return false;
}
return true;
}

static enum CompileCommand parse_option_name(const char* line, int* bytes_read, char* errorbuf, int bufsize) {
assert(ARRAY_SIZE(option_names) == static_cast<int>(CompileCommand::Count), "option_names size mismatch");

@@ -51,7 +51,6 @@ class methodHandle;
option(Print, "print", Bool) \
option(Inline, "inline", Bool) \
option(DontInline, "dontinline", Bool) \
option(Blackhole, "blackhole", Bool) \
option(CompileOnly, "compileonly", Bool)\
option(Exclude, "exclude", Bool) \
option(Break, "break", Bool) \
@@ -142,9 +141,6 @@ class CompilerOracle : AllStatic {
// Tells whether to break when compiling method
static bool should_break_at(const methodHandle& method);

// Tells whether to blackhole when compiling method
static bool should_blackhole(const methodHandle& method);

// Tells whether there are any methods to print for print_method_statistics()
static bool should_print_methods();

@@ -675,8 +675,6 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt
case vmIntrinsics::_VectorInsert:
case vmIntrinsics::_VectorExtract:
return EnableVectorSupport;
case vmIntrinsics::_blackhole:
break;

default:
return false;
@@ -44,7 +44,6 @@ macro(ArrayCopy)
macro(AryEq)
macro(AtanD)
macro(Binary)
macro(Blackhole)
macro(Bool)
macro(BoxLock)
macro(ReverseBytesI)
@@ -3561,8 +3561,6 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f
}
break;
}
case Op_Blackhole:
break;
case Op_RangeCheck: {
RangeCheckNode* rc = n->as_RangeCheck();
Node* iff = new IfNode(rc->in(0), rc->in(1), rc->_prob, rc->_fcnt);
@@ -110,7 +110,7 @@ JVMState* LibraryIntrinsic::generate(JVMState* jvms) {
const int bci = kit.bci();

// Try to inline the intrinsic.
if (callee->check_intrinsic_candidate() &&
if ((CheckIntrinsics ? callee->intrinsic_candidate() : true) &&
kit.try_to_inline(_last_predicate)) {
const char *inline_msg = is_virtual() ? "(intrinsic, virtual)"
: "(intrinsic)";
@@ -667,9 +667,6 @@ bool LibraryCallKit::try_to_inline(int predicate) {
case vmIntrinsics::_getObjectSize:
return inline_getObjectSize();

case vmIntrinsics::_blackhole:
return inline_blackhole();

default:
// If you get here, it may be that someone has added a new intrinsic
// to the list in vmSymbols.hpp without implementing it here.
@@ -6851,33 +6848,3 @@ bool LibraryCallKit::inline_getObjectSize() {

return true;
}

//------------------------------- inline_blackhole --------------------------------------
//
// Make sure all arguments to this node are alive.
// This matches methods that were requested to be blackholed through compile commands.
//
bool LibraryCallKit::inline_blackhole() {
// To preserve the semantics of Java call, we need to null-check the receiver,
// if present. Shortcut if receiver is unconditionally null.
Node* receiver = NULL;
bool has_receiver = !callee()->is_static();
if (has_receiver) {
receiver = null_check_receiver();
if (stopped()) {
return true;
}
}

// Bind call arguments as blackhole arguments to keep them alive
Node* bh = insert_mem_bar(Op_Blackhole);
if (has_receiver) {
bh->add_req(receiver);
}
uint nargs = callee()->arg_size();
for (uint i = has_receiver ? 1 : 0; i < nargs; i++) {
bh->add_req(argument(i));
}

return true;
}
@@ -344,7 +344,5 @@ class LibraryCallKit : public GraphKit {
}

bool inline_getObjectSize();

bool inline_blackhole();
};

@@ -33,7 +33,6 @@
#include "opto/addnode.hpp"
#include "opto/arraycopynode.hpp"
#include "opto/cfgnode.hpp"
#include "opto/regalloc.hpp"
#include "opto/compile.hpp"
#include "opto/connode.hpp"
#include "opto/convertnode.hpp"
@@ -3222,7 +3221,6 @@ MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) {
case Op_OnSpinWait: return new OnSpinWaitNode(C, atp, pn);
case Op_Initialize: return new InitializeNode(C, atp, pn);
case Op_MemBarStoreStore: return new MemBarStoreStoreNode(C, atp, pn);
case Op_Blackhole: return new BlackholeNode(C, atp, pn);
default: ShouldNotReachHere(); return NULL;
}
}
@@ -3457,27 +3455,6 @@ MemBarNode* MemBarNode::leading_membar() const {
return mb;
}

#ifndef PRODUCT
void BlackholeNode::format(PhaseRegAlloc* ra, outputStream* st) const {
st->print("blackhole ");
bool first = true;
for (uint i = 0; i < req(); i++) {
Node* n = in(i);
if (n != NULL && OptoReg::is_valid(ra->get_reg_first(n))) {
if (first) {
first = false;
} else {
st->print(", ");
}
char buf[128];
ra->dump_register(n, buf);
st->print("%s", buf);
}
}
st->cr();
}
#endif

//===========================InitializeNode====================================
// SUMMARY:
// This node acts as a memory barrier on raw memory, after some raw stores.
@@ -1335,26 +1335,6 @@ class OnSpinWaitNode: public MemBarNode {
virtual int Opcode() const;
};

//------------------------------BlackholeNode----------------------------
// Blackhole all arguments. This node would survive through the compiler
// the effects on its arguments, and would be finally matched to nothing.
class BlackholeNode : public MemBarNode {
public:
BlackholeNode(Compile* C, int alias_idx, Node* precedent)
: MemBarNode(C, alias_idx, precedent) {}
virtual int Opcode() const;
virtual uint ideal_reg() const { return 0; } // not matched in the AD file
const RegMask &in_RegMask(uint idx) const {
// Fake the incoming arguments mask for blackholes: accept all registers
// and all stack slots. This would avoid moving the arguments for the
// call that never happens.
return RegMask::All;
}
#ifndef PRODUCT
virtual void format(PhaseRegAlloc* ra, outputStream* st) const;
#endif
};

// Isolation of object setup after an AllocateNode and before next safepoint.
// (See comment in memnode.cpp near InitializeNode::InitializeNode for semantics.)
class InitializeNode: public MemBarNode {
@@ -44,7 +44,6 @@ class AllocateNode;
class ArrayCopyNode;
class BaseCountedLoopNode;
class BaseCountedLoopEndNode;
class BlackholeNode;
class Block;
class BoolNode;
class BoxLockNode;
@@ -51,13 +51,6 @@ void OptoReg::dump(int r, outputStream *st) {
//=============================================================================
const RegMask RegMask::Empty;

const RegMask RegMask::All(
# define BODY(I) -1,
FORALL_BODY
# undef BODY
0
);

//=============================================================================
bool RegMask::is_vector(uint ireg) {
return (ireg == Op_VecA || ireg == Op_VecS || ireg == Op_VecD ||
@@ -356,7 +356,6 @@ class RegMask {
#endif

static const RegMask Empty; // Common empty mask
static const RegMask All; // Common all mask

static bool can_represent(OptoReg::Name reg) {
// NOTE: -1 in computation reflects the usage of the last
@@ -1596,7 +1596,6 @@ typedef HashtableEntry<InstanceKlass*, mtClass> KlassHashtableEntry;
declare_c2_type(MemBarVolatileNode, MemBarNode) \
declare_c2_type(MemBarCPUOrderNode, MemBarNode) \
declare_c2_type(OnSpinWaitNode, MemBarNode) \
declare_c2_type(BlackholeNode, MemBarNode) \
declare_c2_type(InitializeNode, MemBarNode) \
declare_c2_type(ThreadLocalNode, Node) \
declare_c2_type(Opaque1Node, Node) \
@@ -28,26 +28,3 @@
#############################################################################

vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw001/TestDescription.java 8205957 generic-all

compiler/blackhole/BlackholeDiagnosticUnlockTest.java 8258101 generic-all
compiler/blackhole/BlackholeInstanceReturnTest.java#c1 8258101 generic-all
compiler/blackhole/BlackholeInstanceReturnTest.java#c1-no-coops 8258101 generic-all
compiler/blackhole/BlackholeInstanceReturnTest.java#c2 8258101 generic-all
compiler/blackhole/BlackholeInstanceReturnTest.java#c2-no-coops 8258101 generic-all
compiler/blackhole/BlackholeInstanceTest.java#c1 8258101 generic-all
compiler/blackhole/BlackholeInstanceTest.java#c1-no-coops 8258101 generic-all
compiler/blackhole/BlackholeInstanceTest.java#c2 8258101 generic-all
compiler/blackhole/BlackholeInstanceTest.java#c2-no-coops 8258101 generic-all
compiler/blackhole/BlackholeNonVoidWarningTest.java 8258101 generic-all
compiler/blackhole/BlackholeNullCheckTest.java#c1 8258101 generic-all
compiler/blackhole/BlackholeNullCheckTest.java#c1-no-coops 8258101 generic-all
compiler/blackhole/BlackholeNullCheckTest.java#c2 8258101 generic-all
compiler/blackhole/BlackholeNullCheckTest.java#c2-no-coops 8258101 generic-all
compiler/blackhole/BlackholeStaticReturnTest.java#c1 8258101 generic-all
compiler/blackhole/BlackholeStaticReturnTest.java#c1-no-coops 8258101 generic-all
compiler/blackhole/BlackholeStaticReturnTest.java#c2 8258101 generic-all
compiler/blackhole/BlackholeStaticReturnTest.java#c2-no-coops 8258101 generic-all
compiler/blackhole/BlackholeStaticTest.java#c1 8258101 generic-all
compiler/blackhole/BlackholeStaticTest.java#c1-no-coops 8258101 generic-all
compiler/blackhole/BlackholeStaticTest.java#c2 8258101 generic-all
compiler/blackhole/BlackholeStaticTest.java#c2-no-coops 8258101 generic-all

1 comment on commit ad45678

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on ad45678 Jan 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.