mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-30 13:08:24 +00:00
8353276: C2: simplify PhaseMacroExpand::opt_bits_test
Reviewed-by: chagedorn, thartmann
This commit is contained in:
parent
805f1deebc
commit
9f7dc19ffd
@ -93,14 +93,8 @@ void PhaseMacroExpand::migrate_outs(Node *old, Node *target) {
|
||||
assert(old->outcnt() == 0, "all uses must be deleted");
|
||||
}
|
||||
|
||||
Node* PhaseMacroExpand::opt_bits_test(Node* ctrl, Node* region, int edge, Node* word, int mask, int bits, bool return_fast_path) {
|
||||
Node* cmp;
|
||||
if (mask != 0) {
|
||||
Node* and_node = transform_later(new AndXNode(word, MakeConX(mask)));
|
||||
cmp = transform_later(new CmpXNode(and_node, MakeConX(bits)));
|
||||
} else {
|
||||
cmp = word;
|
||||
}
|
||||
Node* PhaseMacroExpand::opt_bits_test(Node* ctrl, Node* region, int edge, Node* word) {
|
||||
Node* cmp = word;
|
||||
Node* bol = transform_later(new BoolNode(cmp, BoolTest::ne));
|
||||
IfNode* iff = new IfNode( ctrl, bol, PROB_MIN, COUNT_UNKNOWN );
|
||||
transform_later(iff);
|
||||
@ -111,13 +105,8 @@ Node* PhaseMacroExpand::opt_bits_test(Node* ctrl, Node* region, int edge, Node*
|
||||
// Fast path not-taken, i.e. slow path
|
||||
Node *slow_taken = transform_later(new IfTrueNode(iff));
|
||||
|
||||
if (return_fast_path) {
|
||||
region->init_req(edge, slow_taken); // Capture slow-control
|
||||
return fast_taken;
|
||||
} else {
|
||||
region->init_req(edge, fast_taken); // Capture fast-control
|
||||
return slow_taken;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------copy_predefined_input_for_runtime_call--------------------
|
||||
@ -2220,7 +2209,7 @@ void PhaseMacroExpand::expand_lock_node(LockNode *lock) {
|
||||
mem_phi = new PhiNode( region, Type::MEMORY, TypeRawPtr::BOTTOM);
|
||||
|
||||
// Optimize test; set region slot 2
|
||||
slow_path = opt_bits_test(ctrl, region, 2, flock, 0, 0);
|
||||
slow_path = opt_bits_test(ctrl, region, 2, flock);
|
||||
mem_phi->init_req(2, mem);
|
||||
|
||||
// Make slow path call
|
||||
@ -2281,7 +2270,7 @@ void PhaseMacroExpand::expand_unlock_node(UnlockNode *unlock) {
|
||||
FastUnlockNode *funlock = new FastUnlockNode( ctrl, obj, box );
|
||||
funlock = transform_later( funlock )->as_FastUnlock();
|
||||
// Optimize test; set region slot 2
|
||||
Node *slow_path = opt_bits_test(ctrl, region, 2, funlock, 0, 0);
|
||||
Node *slow_path = opt_bits_test(ctrl, region, 2, funlock);
|
||||
Node *thread = transform_later(new ThreadLocalNode());
|
||||
|
||||
CallNode *call = make_slow_call((CallNode *) unlock, OptoRuntime::complete_monitor_exit_Type(),
|
||||
|
||||
@ -182,7 +182,7 @@ private:
|
||||
|
||||
int replace_input(Node *use, Node *oldref, Node *newref);
|
||||
void migrate_outs(Node *old, Node *target);
|
||||
Node* opt_bits_test(Node* ctrl, Node* region, int edge, Node* word, int mask, int bits, bool return_fast_path = false);
|
||||
Node* opt_bits_test(Node* ctrl, Node* region, int edge, Node* word);
|
||||
void copy_predefined_input_for_runtime_call(Node * ctrl, CallNode* oldcall, CallNode* call);
|
||||
CallNode* make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, address slow_call,
|
||||
const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user