Skip to content

Commit ad45678

Browse files
committedJan 6, 2021
8258558: Revert changes for JDK-8252505 and related issues
Reviewed-by: kvn
1 parent e66187d commit ad45678

33 files changed

+2
-1662
lines changed
 

‎src/hotspot/share/c1/c1_Compiler.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,6 @@ bool Compiler::is_intrinsic_supported(const methodHandle& method) {
230230
break;
231231
case vmIntrinsics::_getObjectSize:
232232
break;
233-
case vmIntrinsics::_blackhole:
234-
break;
235233
default:
236234
return false; // Intrinsics not on the previous list are not available.
237235
}

‎src/hotspot/share/c1/c1_GraphBuilder.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3415,7 +3415,7 @@ bool GraphBuilder::try_inline(ciMethod* callee, bool holder_known, bool ignore_r
34153415

34163416
// handle intrinsics
34173417
if (callee->intrinsic_id() != vmIntrinsics::_none &&
3418-
callee->check_intrinsic_candidate()) {
3418+
(CheckIntrinsics ? callee->intrinsic_candidate() : true)) {
34193419
if (try_inline_intrinsics(callee, ignore_return)) {
34203420
print_inlining(callee, "intrinsic");
34213421
if (callee->has_reserved_stack_access()) {

‎src/hotspot/share/c1/c1_LIRGenerator.cpp

-21
Original file line numberDiff line numberDiff line change
@@ -3206,10 +3206,6 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) {
32063206
do_vectorizedMismatch(x);
32073207
break;
32083208

3209-
case vmIntrinsics::_blackhole:
3210-
do_blackhole(x);
3211-
break;
3212-
32133209
default: ShouldNotReachHere(); break;
32143210
}
32153211
}
@@ -3629,23 +3625,6 @@ void LIRGenerator::do_RangeCheckPredicate(RangeCheckPredicate *x) {
36293625
}
36303626
}
36313627

3632-
void LIRGenerator::do_blackhole(Intrinsic *x) {
3633-
// If we have a receiver, then null-check and handle it separately
3634-
bool handle_receiver = x->needs_null_check();
3635-
if (handle_receiver) {
3636-
CodeEmitInfo* info = state_for(x);
3637-
LIRItem vitem(x->receiver(), this);
3638-
vitem.load_item();
3639-
__ null_check(vitem.result(), info);
3640-
}
3641-
3642-
for (int c = (handle_receiver ? 1 : 0); c < x->number_of_arguments(); c++) {
3643-
// Load the argument
3644-
LIRItem vitem(x->argument_at(c), this);
3645-
vitem.load_item();
3646-
// ...and leave it unused.
3647-
}
3648-
}
36493628

36503629
LIR_Opr LIRGenerator::call_runtime(Value arg1, address entry, ValueType* result_type, CodeEmitInfo* info) {
36513630
LIRItemList args(1);

‎src/hotspot/share/c1/c1_LIRGenerator.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
265265
void do_update_CRC32(Intrinsic* x);
266266
void do_update_CRC32C(Intrinsic* x);
267267
void do_vectorizedMismatch(Intrinsic* x);
268-
void do_blackhole(Intrinsic* x);
269268

270269
public:
271270
LIR_Opr call_runtime(BasicTypeArray* signature, LIRItemList* args, address entry, ValueType* result_type, CodeEmitInfo* info);

‎src/hotspot/share/ci/ciMethod.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,6 @@ ciMethod::ciMethod(const methodHandle& h_m, ciInstanceKlass* holder) :
155155
ciReplay::initialize(this);
156156
}
157157
#endif
158-
159-
if (CompilerOracle::should_blackhole(h_m)) {
160-
h_m->set_intrinsic_id(vmIntrinsics::_blackhole);
161-
}
162158
}
163159

164160

‎src/hotspot/share/ci/ciMethod.hpp

-9
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,6 @@ class ciMethod : public ciMetadata {
201201
bool intrinsic_candidate() const { return get_Method()->intrinsic_candidate(); }
202202
bool is_static_initializer() const { return get_Method()->is_static_initializer(); }
203203

204-
bool check_intrinsic_candidate() const {
205-
if (intrinsic_id() == vmIntrinsics::_blackhole) {
206-
// This is the intrinsic without an associated method, so no intrinsic_candidate
207-
// flag is set. The intrinsic is still correct.
208-
return true;
209-
}
210-
return (CheckIntrinsics ? intrinsic_candidate() : true);
211-
}
212-
213204
int highest_osr_comp_level();
214205

215206
Bytecodes::Code java_code_at_bci(int bci) {

‎src/hotspot/share/classfile/classFileParser.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -5308,11 +5308,6 @@ static void check_methods_for_intrinsics(const InstanceKlass* ik,
53085308
// is defined for it.
53095309
continue;
53105310
}
5311-
if (vmIntrinsics::_blackhole == id) {
5312-
// The _blackhole intrinsic is a special marker. No explicit method
5313-
// is defined for it.
5314-
continue;
5315-
}
53165311

53175312
if (vmIntrinsics::class_for(id) == klass_id) {
53185313
// Check if the current class contains a method with the same

‎src/hotspot/share/classfile/vmIntrinsics.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ bool vmIntrinsics::should_be_pinned(vmIntrinsics::ID id) {
151151
#endif
152152
case vmIntrinsics::_currentTimeMillis:
153153
case vmIntrinsics::_nanoTime:
154-
case vmIntrinsics::_blackhole:
155154
return true;
156155
default:
157156
return false;

‎src/hotspot/share/classfile/vmIntrinsics.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,6 @@ class methodHandle;
534534
do_name( getObjectSize_name, "getObjectSize0") \
535535
do_alias( getObjectSize_signature, long_object_long_signature) \
536536
\
537-
/* special marker for blackholed methods: */ \
538-
do_intrinsic(_blackhole, java_lang_Object, blackhole_name, star_name, F_S) \
539-
\
540537
/* unsafe memory references (there are a lot of them...) */ \
541538
do_signature(getReference_signature, "(Ljava/lang/Object;J)Ljava/lang/Object;") \
542539
do_signature(putReference_signature, "(Ljava/lang/Object;JLjava/lang/Object;)V") \

‎src/hotspot/share/classfile/vmSymbols.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@
283283
template(signature_name, "signature") \
284284
template(slot_name, "slot") \
285285
template(trusted_final_name, "trustedFinal") \
286-
template(blackhole_name, "<blackhole>") /*fake name*/ \
287286
\
288287
/* Support for annotations (JDK 1.5 and above) */ \
289288
\

‎src/hotspot/share/compiler/compilerOracle.cpp

-18
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,6 @@ static void register_command(TypedMethodOptionMatcher* matcher,
286286
}
287287
assert(CompilerOracle::option_matches_type(option, value), "Value must match option type");
288288

289-
if (option == CompileCommand::Blackhole && !UnlockDiagnosticVMOptions) {
290-
warning("Blackhole compile option is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions");
291-
return;
292-
}
293-
294289
matcher->init(option, option_list);
295290
matcher->set_value<T>(value);
296291
option_list = matcher;
@@ -414,19 +409,6 @@ bool CompilerOracle::should_break_at(const methodHandle& method) {
414409
return check_predicate(CompileCommand::Break, method);
415410
}
416411

417-
bool CompilerOracle::should_blackhole(const methodHandle& method) {
418-
if (!check_predicate(CompileCommand::Blackhole, method)) {
419-
return false;
420-
}
421-
guarantee(UnlockDiagnosticVMOptions, "Checked during initial parsing");
422-
if (method->result_type() != T_VOID) {
423-
warning("Blackhole compile option only works for methods with void type: %s",
424-
method->name_and_sig_as_C_string());
425-
return false;
426-
}
427-
return true;
428-
}
429-
430412
static enum CompileCommand parse_option_name(const char* line, int* bytes_read, char* errorbuf, int bufsize) {
431413
assert(ARRAY_SIZE(option_names) == static_cast<int>(CompileCommand::Count), "option_names size mismatch");
432414

‎src/hotspot/share/compiler/compilerOracle.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class methodHandle;
5151
option(Print, "print", Bool) \
5252
option(Inline, "inline", Bool) \
5353
option(DontInline, "dontinline", Bool) \
54-
option(Blackhole, "blackhole", Bool) \
5554
option(CompileOnly, "compileonly", Bool)\
5655
option(Exclude, "exclude", Bool) \
5756
option(Break, "break", Bool) \
@@ -142,9 +141,6 @@ class CompilerOracle : AllStatic {
142141
// Tells whether to break when compiling method
143142
static bool should_break_at(const methodHandle& method);
144143

145-
// Tells whether to blackhole when compiling method
146-
static bool should_blackhole(const methodHandle& method);
147-
148144
// Tells whether there are any methods to print for print_method_statistics()
149145
static bool should_print_methods();
150146

‎src/hotspot/share/opto/c2compiler.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,6 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt
675675
case vmIntrinsics::_VectorInsert:
676676
case vmIntrinsics::_VectorExtract:
677677
return EnableVectorSupport;
678-
case vmIntrinsics::_blackhole:
679-
break;
680678

681679
default:
682680
return false;

‎src/hotspot/share/opto/classes.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ macro(ArrayCopy)
4444
macro(AryEq)
4545
macro(AtanD)
4646
macro(Binary)
47-
macro(Blackhole)
4847
macro(Bool)
4948
macro(BoxLock)
5049
macro(ReverseBytesI)

‎src/hotspot/share/opto/compile.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -3561,8 +3561,6 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f
35613561
}
35623562
break;
35633563
}
3564-
case Op_Blackhole:
3565-
break;
35663564
case Op_RangeCheck: {
35673565
RangeCheckNode* rc = n->as_RangeCheck();
35683566
Node* iff = new IfNode(rc->in(0), rc->in(1), rc->_prob, rc->_fcnt);

‎src/hotspot/share/opto/library_call.cpp

+1-34
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ JVMState* LibraryIntrinsic::generate(JVMState* jvms) {
110110
const int bci = kit.bci();
111111

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

670-
case vmIntrinsics::_blackhole:
671-
return inline_blackhole();
672-
673670
default:
674671
// If you get here, it may be that someone has added a new intrinsic
675672
// to the list in vmSymbols.hpp without implementing it here.
@@ -6851,33 +6848,3 @@ bool LibraryCallKit::inline_getObjectSize() {
68516848

68526849
return true;
68536850
}
6854-
6855-
//------------------------------- inline_blackhole --------------------------------------
6856-
//
6857-
// Make sure all arguments to this node are alive.
6858-
// This matches methods that were requested to be blackholed through compile commands.
6859-
//
6860-
bool LibraryCallKit::inline_blackhole() {
6861-
// To preserve the semantics of Java call, we need to null-check the receiver,
6862-
// if present. Shortcut if receiver is unconditionally null.
6863-
Node* receiver = NULL;
6864-
bool has_receiver = !callee()->is_static();
6865-
if (has_receiver) {
6866-
receiver = null_check_receiver();
6867-
if (stopped()) {
6868-
return true;
6869-
}
6870-
}
6871-
6872-
// Bind call arguments as blackhole arguments to keep them alive
6873-
Node* bh = insert_mem_bar(Op_Blackhole);
6874-
if (has_receiver) {
6875-
bh->add_req(receiver);
6876-
}
6877-
uint nargs = callee()->arg_size();
6878-
for (uint i = has_receiver ? 1 : 0; i < nargs; i++) {
6879-
bh->add_req(argument(i));
6880-
}
6881-
6882-
return true;
6883-
}

‎src/hotspot/share/opto/library_call.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,5 @@ class LibraryCallKit : public GraphKit {
344344
}
345345

346346
bool inline_getObjectSize();
347-
348-
bool inline_blackhole();
349347
};
350348

‎src/hotspot/share/opto/memnode.cpp

-23
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "opto/addnode.hpp"
3434
#include "opto/arraycopynode.hpp"
3535
#include "opto/cfgnode.hpp"
36-
#include "opto/regalloc.hpp"
3736
#include "opto/compile.hpp"
3837
#include "opto/connode.hpp"
3938
#include "opto/convertnode.hpp"
@@ -3222,7 +3221,6 @@ MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) {
32223221
case Op_OnSpinWait: return new OnSpinWaitNode(C, atp, pn);
32233222
case Op_Initialize: return new InitializeNode(C, atp, pn);
32243223
case Op_MemBarStoreStore: return new MemBarStoreStoreNode(C, atp, pn);
3225-
case Op_Blackhole: return new BlackholeNode(C, atp, pn);
32263224
default: ShouldNotReachHere(); return NULL;
32273225
}
32283226
}
@@ -3457,27 +3455,6 @@ MemBarNode* MemBarNode::leading_membar() const {
34573455
return mb;
34583456
}
34593457

3460-
#ifndef PRODUCT
3461-
void BlackholeNode::format(PhaseRegAlloc* ra, outputStream* st) const {
3462-
st->print("blackhole ");
3463-
bool first = true;
3464-
for (uint i = 0; i < req(); i++) {
3465-
Node* n = in(i);
3466-
if (n != NULL && OptoReg::is_valid(ra->get_reg_first(n))) {
3467-
if (first) {
3468-
first = false;
3469-
} else {
3470-
st->print(", ");
3471-
}
3472-
char buf[128];
3473-
ra->dump_register(n, buf);
3474-
st->print("%s", buf);
3475-
}
3476-
}
3477-
st->cr();
3478-
}
3479-
#endif
3480-
34813458
//===========================InitializeNode====================================
34823459
// SUMMARY:
34833460
// This node acts as a memory barrier on raw memory, after some raw stores.

‎src/hotspot/share/opto/memnode.hpp

-20
Original file line numberDiff line numberDiff line change
@@ -1335,26 +1335,6 @@ class OnSpinWaitNode: public MemBarNode {
13351335
virtual int Opcode() const;
13361336
};
13371337

1338-
//------------------------------BlackholeNode----------------------------
1339-
// Blackhole all arguments. This node would survive through the compiler
1340-
// the effects on its arguments, and would be finally matched to nothing.
1341-
class BlackholeNode : public MemBarNode {
1342-
public:
1343-
BlackholeNode(Compile* C, int alias_idx, Node* precedent)
1344-
: MemBarNode(C, alias_idx, precedent) {}
1345-
virtual int Opcode() const;
1346-
virtual uint ideal_reg() const { return 0; } // not matched in the AD file
1347-
const RegMask &in_RegMask(uint idx) const {
1348-
// Fake the incoming arguments mask for blackholes: accept all registers
1349-
// and all stack slots. This would avoid moving the arguments for the
1350-
// call that never happens.
1351-
return RegMask::All;
1352-
}
1353-
#ifndef PRODUCT
1354-
virtual void format(PhaseRegAlloc* ra, outputStream* st) const;
1355-
#endif
1356-
};
1357-
13581338
// Isolation of object setup after an AllocateNode and before next safepoint.
13591339
// (See comment in memnode.cpp near InitializeNode::InitializeNode for semantics.)
13601340
class InitializeNode: public MemBarNode {

‎src/hotspot/share/opto/node.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class AllocateNode;
4444
class ArrayCopyNode;
4545
class BaseCountedLoopNode;
4646
class BaseCountedLoopEndNode;
47-
class BlackholeNode;
4847
class Block;
4948
class BoolNode;
5049
class BoxLockNode;

‎src/hotspot/share/opto/regmask.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ void OptoReg::dump(int r, outputStream *st) {
5151
//=============================================================================
5252
const RegMask RegMask::Empty;
5353

54-
const RegMask RegMask::All(
55-
# define BODY(I) -1,
56-
FORALL_BODY
57-
# undef BODY
58-
0
59-
);
60-
6154
//=============================================================================
6255
bool RegMask::is_vector(uint ireg) {
6356
return (ireg == Op_VecA || ireg == Op_VecS || ireg == Op_VecD ||

‎src/hotspot/share/opto/regmask.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ class RegMask {
356356
#endif
357357

358358
static const RegMask Empty; // Common empty mask
359-
static const RegMask All; // Common all mask
360359

361360
static bool can_represent(OptoReg::Name reg) {
362361
// NOTE: -1 in computation reflects the usage of the last

‎src/hotspot/share/runtime/vmStructs.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1596,7 +1596,6 @@ typedef HashtableEntry<InstanceKlass*, mtClass> KlassHashtableEntry;
15961596
declare_c2_type(MemBarVolatileNode, MemBarNode) \
15971597
declare_c2_type(MemBarCPUOrderNode, MemBarNode) \
15981598
declare_c2_type(OnSpinWaitNode, MemBarNode) \
1599-
declare_c2_type(BlackholeNode, MemBarNode) \
16001599
declare_c2_type(InitializeNode, MemBarNode) \
16011600
declare_c2_type(ThreadLocalNode, Node) \
16021601
declare_c2_type(Opaque1Node, Node) \

‎test/hotspot/jtreg/ProblemList-Xcomp.txt

-23
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,3 @@
2828
#############################################################################
2929

3030
vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw001/TestDescription.java 8205957 generic-all
31-
32-
compiler/blackhole/BlackholeDiagnosticUnlockTest.java 8258101 generic-all
33-
compiler/blackhole/BlackholeInstanceReturnTest.java#c1 8258101 generic-all
34-
compiler/blackhole/BlackholeInstanceReturnTest.java#c1-no-coops 8258101 generic-all
35-
compiler/blackhole/BlackholeInstanceReturnTest.java#c2 8258101 generic-all
36-
compiler/blackhole/BlackholeInstanceReturnTest.java#c2-no-coops 8258101 generic-all
37-
compiler/blackhole/BlackholeInstanceTest.java#c1 8258101 generic-all
38-
compiler/blackhole/BlackholeInstanceTest.java#c1-no-coops 8258101 generic-all
39-
compiler/blackhole/BlackholeInstanceTest.java#c2 8258101 generic-all
40-
compiler/blackhole/BlackholeInstanceTest.java#c2-no-coops 8258101 generic-all
41-
compiler/blackhole/BlackholeNonVoidWarningTest.java 8258101 generic-all
42-
compiler/blackhole/BlackholeNullCheckTest.java#c1 8258101 generic-all
43-
compiler/blackhole/BlackholeNullCheckTest.java#c1-no-coops 8258101 generic-all
44-
compiler/blackhole/BlackholeNullCheckTest.java#c2 8258101 generic-all
45-
compiler/blackhole/BlackholeNullCheckTest.java#c2-no-coops 8258101 generic-all
46-
compiler/blackhole/BlackholeStaticReturnTest.java#c1 8258101 generic-all
47-
compiler/blackhole/BlackholeStaticReturnTest.java#c1-no-coops 8258101 generic-all
48-
compiler/blackhole/BlackholeStaticReturnTest.java#c2 8258101 generic-all
49-
compiler/blackhole/BlackholeStaticReturnTest.java#c2-no-coops 8258101 generic-all
50-
compiler/blackhole/BlackholeStaticTest.java#c1 8258101 generic-all
51-
compiler/blackhole/BlackholeStaticTest.java#c1-no-coops 8258101 generic-all
52-
compiler/blackhole/BlackholeStaticTest.java#c2 8258101 generic-all
53-
compiler/blackhole/BlackholeStaticTest.java#c2-no-coops 8258101 generic-all

‎test/hotspot/jtreg/TEST.groups

-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ hotspot_slow_compiler = \
9797

9898
tier1_compiler_1 = \
9999
compiler/arraycopy/ \
100-
compiler/blackhole/ \
101100
compiler/c1/ \
102101
compiler/c2/ \
103102
-compiler/c2/Test6850611.java \

‎test/hotspot/jtreg/compiler/blackhole/BlackholeDiagnosticUnlockTest.java

-109
This file was deleted.

‎test/hotspot/jtreg/compiler/blackhole/BlackholeInstanceReturnTest.java

-183
This file was deleted.

‎test/hotspot/jtreg/compiler/blackhole/BlackholeInstanceTest.java

-314
This file was deleted.

‎test/hotspot/jtreg/compiler/blackhole/BlackholeNonVoidWarningTest.java

-98
This file was deleted.

‎test/hotspot/jtreg/compiler/blackhole/BlackholeNullCheckTest.java

-173
This file was deleted.

‎test/hotspot/jtreg/compiler/blackhole/BlackholeStaticReturnTest.java

-174
This file was deleted.

‎test/hotspot/jtreg/compiler/blackhole/BlackholeStaticTest.java

-287
This file was deleted.

‎test/hotspot/jtreg/compiler/blackhole/BlackholeTarget.java

-136
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.