8247218: Add default constructor to VectorSet to use Thread::current()->resource_area() as arena by default

Add a default construction to VectorSet and clean up uses of the old constructor.

Reviewed-by: kvn, thartmann
This commit is contained in:
Christian Hagedorn 2020-06-29 17:14:19 +02:00
parent fe145646e7
commit 840867efa6
28 changed files with 108 additions and 130 deletions

View File

@ -785,9 +785,8 @@ void G1BarrierSetC2::verify_gc_barriers(Compile* compile, CompilePhase phase) co
// Verify G1 pre-barriers
const int marking_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset());
ResourceArea *area = Thread::current()->resource_area();
Unique_Node_List visited(area);
Node_List worklist(area);
Unique_Node_List visited;
Node_List worklist;
// We're going to walk control flow backwards starting from the Root
worklist.push(compile->root());
while (worklist.size() > 0) {

View File

@ -986,9 +986,8 @@ void ShenandoahBarrierSetC2::verify_gc_barriers(Compile* compile, CompilePhase p
// Verify G1 pre-barriers
const int marking_offset = in_bytes(ShenandoahThreadLocalData::satb_mark_queue_active_offset());
ResourceArea *area = Thread::current()->resource_area();
Unique_Node_List visited(area);
Node_List worklist(area);
Unique_Node_List visited;
Node_List worklist;
// We're going to walk control flow backwards starting from the Root
worklist.push(compile->root());
while (worklist.size() > 0) {

View File

@ -279,7 +279,7 @@ void ShenandoahBarrierC2Support::verify(RootNode* root) {
GrowableArray<Node*> barriers;
Unique_Node_List barriers_used;
Node_Stack phis(0);
VectorSet visited(Thread::current()->resource_area());
VectorSet visited;
const bool trace = false;
const bool verify_no_useless_barrier = false;
@ -766,7 +766,7 @@ Node* ShenandoahBarrierC2Support::no_branches(Node* c, Node* dom, bool allow_one
Node* ShenandoahBarrierC2Support::dom_mem(Node* mem, Node* ctrl, int alias, Node*& mem_ctrl, PhaseIdealLoop* phase) {
ResourceMark rm;
VectorSet wq(Thread::current()->resource_area());
VectorSet wq;
wq.set(mem->_idx);
mem_ctrl = phase->ctrl_or_self(mem);
while (!phase->is_dominator(mem_ctrl, ctrl) || mem_ctrl == ctrl) {
@ -1184,7 +1184,7 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
call->extract_projections(&projs, false, false);
#ifdef ASSERT
VectorSet cloned(Thread::current()->resource_area());
VectorSet cloned;
#endif
Node* lrb_clone = lrb->clone();
phase->register_new_node(lrb_clone, projs.catchall_catchproj);
@ -1354,7 +1354,7 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
Node* addr;
if (ShenandoahSelfFixing) {
VectorSet visited(Thread::current()->resource_area());
VectorSet visited;
addr = get_load_addr(phase, visited, lrb);
} else {
addr = phase->igvn().zerocon(T_OBJECT);
@ -1818,7 +1818,7 @@ void ShenandoahBarrierC2Support::optimize_after_expansion(VectorSet &visited, No
}
if (!phase->C->major_progress()) {
VectorSet seen(Thread::current()->resource_area());
VectorSet seen;
for (uint i = 0; i < heap_stable_tests.size(); i++) {
Node* n = heap_stable_tests.at(i);
IdealLoopTree* loop = phase->get_loop(n);
@ -2090,7 +2090,7 @@ static bool has_never_branch(Node* root) {
void MemoryGraphFixer::collect_memory_nodes() {
Node_Stack stack(0);
VectorSet visited(Thread::current()->resource_area());
VectorSet visited;
Node_List regions;
// Walk the raw memory graph and create a mapping from CFG node to

View File

@ -371,7 +371,7 @@ void ZBarrierSetC2::analyze_dominating_barriers() const {
// Dominating block? Look around for safepoints
ResourceMark rm;
Block_List stack;
VectorSet visited(Thread::current()->resource_area());
VectorSet visited;
stack.push(load_block);
bool safepoint_found = block_has_safepoint(load_block);
while (!safepoint_found && stack.size() > 0) {

View File

@ -24,15 +24,24 @@
#include "precompiled.hpp"
#include "libadt/vectset.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/arena.hpp"
#include "memory/resourceArea.hpp"
#include "utilities/count_leading_zeros.hpp"
#include "utilities/powerOfTwo.hpp"
VectorSet::VectorSet(Arena *arena) : _size(2),
_data(NEW_ARENA_ARRAY(arena, uint32_t, 2)),
_data_size(2),
_set_arena(arena) {
VectorSet::VectorSet() {
init(Thread::current()->resource_area());
}
VectorSet::VectorSet(Arena* arena) {
init(arena);
}
void VectorSet::init(Arena* arena) {
_size = 2;
_data = NEW_ARENA_ARRAY(arena, uint32_t, 2);
_data_size = 2;
_set_arena = arena;
_data[0] = 0;
_data[1] = 0;
}

View File

@ -47,10 +47,12 @@ private:
uint _data_size;
Arena* _set_arena;
void init(Arena* arena);
// Grow vector to required word capacity
void grow(uint new_word_capacity);
public:
VectorSet(Arena *arena);
VectorSet();
VectorSet(Arena* arena);
~VectorSet() {}
void insert(uint elem);

View File

@ -403,11 +403,10 @@ PhaseCFG::PhaseCFG(Arena* arena, RootNode* root, Matcher& matcher)
// The RootNode both starts and ends it's own block. Do this with a recursive
// backwards walk over the control edges.
uint PhaseCFG::build_cfg() {
Arena *a = Thread::current()->resource_area();
VectorSet visited(a);
VectorSet visited;
// Allocate stack with enough space to avoid frequent realloc
Node_Stack nstack(a, C->live_nodes() >> 1);
Node_Stack nstack(C->live_nodes() >> 1);
nstack.push(_root, 0);
uint sum = 0; // Counter for blocks

View File

@ -346,9 +346,8 @@ bool RegionNode::is_unreachable_region(PhaseGVN *phase) const {
// Unsafe case - check if the Region node is reachable from root.
ResourceMark rm;
Arena *a = Thread::current()->resource_area();
Node_List nstack(a);
VectorSet visited(a);
Node_List nstack;
VectorSet visited;
// Mark all control nodes reachable from root outputs
Node *n = (Node*)phase->C->root();
@ -1040,7 +1039,7 @@ void PhiNode::verify_adr_type(bool recursive) const {
"Phi::adr_type must be pre-normalized");
if (recursive) {
VectorSet visited(Thread::current()->resource_area());
VectorSet visited;
verify_adr_type(visited, _adr_type);
}
}
@ -1780,9 +1779,8 @@ bool PhiNode::is_unsafe_data_reference(Node *in) const {
ResourceMark rm;
Arena *a = Thread::current()->resource_area();
Node_List nstack(a);
VectorSet visited(a);
Node_List nstack;
VectorSet visited;
nstack.push(in); // Start with unique input.
visited.set(in->_idx);

View File

@ -202,8 +202,6 @@ PhaseChaitin::PhaseChaitin(uint unique, PhaseCFG &cfg, Matcher &matcher, bool sc
#endif
)
, _live(0)
, _spilled_once(Thread::current()->resource_area())
, _spilled_twice(Thread::current()->resource_area())
, _lo_degree(0), _lo_stk_degree(0), _hi_degree(0), _simplified(0)
, _oldphi(unique)
#ifndef PRODUCT

View File

@ -2684,8 +2684,7 @@ struct Final_Reshape_Counts : public StackObj {
Final_Reshape_Counts() :
_call_count(0), _float_count(0), _double_count(0),
_java_call_count(0), _inner_loop_count(0),
_visited( Thread::current()->resource_area() ) { }
_java_call_count(0), _inner_loop_count(0) { }
void inc_call_count () { _call_count ++; }
void inc_float_count () { _float_count ++; }
@ -3505,8 +3504,7 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f
// Replacing Opaque nodes with their input in final_graph_reshaping_impl(),
// requires that the walk visits a node's inputs before visiting the node.
void Compile::final_graph_reshaping_walk( Node_Stack &nstack, Node *root, Final_Reshape_Counts &frc ) {
ResourceArea *area = Thread::current()->resource_area();
Unique_Node_List sfpt(area);
Unique_Node_List sfpt;
frc._visited.set(root->_idx); // first, mark node as visited
uint cnt = root->req();
@ -3868,14 +3866,13 @@ bool Compile::needs_clinit_barrier(ciInstanceKlass* holder, ciMethod* accessing_
// between Use-Def edges and Def-Use edges in the graph.
void Compile::verify_graph_edges(bool no_dead_code) {
if (VerifyGraphEdges) {
ResourceArea *area = Thread::current()->resource_area();
Unique_Node_List visited(area);
Unique_Node_List visited;
// Call recursive graph walk to check edges
_root->verify_edges(visited);
if (no_dead_code) {
// Now make sure that no visited node is used by an unvisited node.
bool dead_nodes = false;
Unique_Node_List checked(area);
Unique_Node_List checked;
while (visited.size() > 0) {
Node* n = visited.pop();
checked.push(n);

View File

@ -404,7 +404,7 @@ void PhaseIdealLoop::Dominators() {
// Tarjan's algorithm, almost verbatim:
// Step 1:
VectorSet visited(Thread::current()->resource_area());
VectorSet visited;
int dfsnum = NTarjan::DFS( ntarjan, visited, this, dfsorder);
// Tarjan is using 1-based arrays, so these are some initialize flags

View File

@ -2935,8 +2935,7 @@ void ConnectionGraph::split_unique_types(GrowableArray<Node *> &alloc_worklist,
GrowableArray<PhiNode *> orig_phis;
PhaseIterGVN *igvn = _igvn;
uint new_index_start = (uint) _compile->num_alias_types();
Arena* arena = Thread::current()->resource_area();
VectorSet visited(arena);
VectorSet visited;
ideal_nodes.clear(); // Reset for use with set_map/get_map.
uint unique_old = _compile->unique();

View File

@ -1396,15 +1396,14 @@ void PhaseCFG::global_code_motion() {
}
// Set the basic block for Nodes pinned into blocks
Arena* arena = Thread::current()->resource_area();
VectorSet visited(arena);
VectorSet visited;
schedule_pinned_nodes(visited);
// Find the earliest Block any instruction can be placed in. Some
// instructions are pinned into Blocks. Unpinned instructions can
// appear in last block in which all their inputs occur.
visited.clear();
Node_Stack stack(arena, (C->live_nodes() >> 2) + 16); // pre-grow
Node_Stack stack((C->live_nodes() >> 2) + 16); // pre-grow
if (!schedule_early(visited, stack)) {
// Bailout without retry
C->record_method_not_compilable("early schedule failed");

View File

@ -589,7 +589,7 @@ void IdealGraphPrinter::visit_node(Node *n, bool edges, VectorSet* temp_set) {
void IdealGraphPrinter::walk_nodes(Node *start, bool edges, VectorSet* temp_set) {
VectorSet visited(Thread::current()->resource_area());
VectorSet visited;
GrowableArray<Node *> nodeStack(Thread::current()->resource_area(), 0, 0, NULL);
nodeStack.push(start);
visited.test_set(start->_idx);
@ -646,7 +646,7 @@ void IdealGraphPrinter::print(const char *name, Node *node) {
print_attr(GRAPH_NAME_PROPERTY, (const char *)name);
end_head();
VectorSet temp_set(Thread::current()->resource_area());
VectorSet temp_set;
head(NODES_ELEMENT);
walk_nodes(node, false, &temp_set);

View File

@ -153,7 +153,6 @@ void PhaseCFG::implicit_null_check(Block* block, Node *proj, Node *val, int allo
// Search the successor block for a load or store who's base value is also
// the tested value. There may be several.
Node_List *out = new Node_List(Thread::current()->resource_area());
MachNode *best = NULL; // Best found so far
for (DUIterator i = val->outs(); val->has_out(i); i++) {
Node *m = val->out(i);
@ -1231,7 +1230,7 @@ Node* PhaseCFG::catch_cleanup_find_cloned_def(Block *use_blk, Node *def, Block *
if( j == def_blk->_num_succs ) {
// Block at same level in dom-tree is not a successor. It needs a
// PhiNode, the PhiNode uses from the def and IT's uses need fixup.
Node_Array inputs = new Node_List(Thread::current()->resource_area());
Node_Array inputs = new Node_List();
for(uint k = 1; k < use_blk->num_preds(); k++) {
Block* block = get_block_for_node(use_blk->pred(k));
inputs.map(k, catch_cleanup_find_cloned_def(block, def, def_blk, n_clone_idx));
@ -1342,7 +1341,7 @@ void PhaseCFG::call_catch_cleanup(Block* block) {
uint n_clone_idx = i2-beg+1; // Index of clone of n in each successor block
Node *n = block->get_node(i2); // Node that got cloned
// Need DU safe iterator because of edge manipulation in calls.
Unique_Node_List *out = new Unique_Node_List(Thread::current()->resource_area());
Unique_Node_List* out = new Unique_Node_List();
for (DUIterator_Fast j1max, j1 = n->fast_outs(j1max); j1 < j1max; j1++) {
out->push(n->fast_out(j1));
}

View File

@ -89,7 +89,7 @@ void PhaseLive::compute(uint maxlrg) {
_free_IndexSet = NULL;
// Blocks having done pass-1
VectorSet first_pass(Thread::current()->resource_area());
VectorSet first_pass;
// Outer loop: must compute local live-in sets and push into predecessors.
for (uint j = _cfg.number_of_blocks(); j > 0; j--) {

View File

@ -1337,17 +1337,17 @@ bool PhaseIdealLoop::loop_predication_impl(IdealLoopTree *loop) {
ConNode* zero = _igvn.intcon(0);
set_ctrl(zero, C->root());
ResourceArea *area = Thread::current()->resource_area();
ResourceArea* area = Thread::current()->resource_area();
Invariance invar(area, loop);
// Create list of if-projs such that a newer proj dominates all older
// projs in the list, and they all dominate loop->tail()
Node_List if_proj_list(area);
Node_List regions(area);
Node *current_proj = loop->tail(); //start from tail
Node_List if_proj_list;
Node_List regions;
Node* current_proj = loop->tail(); // start from tail
Node_List controls(area);
Node_List controls;
while (current_proj != head) {
if (loop == get_loop(current_proj) && // still in the loop ?
current_proj->is_Proj() && // is a projection ?
@ -1416,7 +1416,7 @@ bool PhaseIdealLoop::loop_predication_impl(IdealLoopTree *loop) {
// And look into all branches
Node_Stack stack(0);
VectorSet seen(Thread::current()->resource_area());
VectorSet seen;
Node_List if_proj_list_freq(area);
while (regions.size() > 0) {
Node* c = regions.pop();

View File

@ -1463,9 +1463,8 @@ void PhaseIdealLoop::insert_pre_post_loops(IdealLoopTree *loop, Node_List &old_n
outer_main_head->set_req(LoopNode::EntryControl, min_taken);
set_idom(outer_main_head, min_taken, dd_main_head);
Arena *a = Thread::current()->resource_area();
VectorSet visited(a);
Node_Stack clones(a, main_head->back_control()->outcnt());
VectorSet visited;
Node_Stack clones(main_head->back_control()->outcnt());
// Step B3: Make the fall-in values to the main-loop come from the
// fall-out values of the pre-loop.
for (DUIterator_Fast i2max, i2 = main_head->fast_outs(i2max); i2 < i2max; i2++) {
@ -1751,9 +1750,8 @@ Node *PhaseIdealLoop::insert_post_loop(IdealLoopTree *loop, Node_List &old_new,
post_head->set_req(LoopNode::EntryControl, zer_taken);
set_idom(post_head, zer_taken, dd_main_exit);
Arena *a = Thread::current()->resource_area();
VectorSet visited(a);
Node_Stack clones(a, main_head->back_control()->outcnt());
VectorSet visited;
Node_Stack clones(main_head->back_control()->outcnt());
// Step A3: Make the fall-in values to the post-loop come from the
// fall-out values of the main-loop.
for (DUIterator_Fast imax, i = main_head->fast_outs(imax); i < imax; i++) {
@ -1848,10 +1846,9 @@ void PhaseIdealLoop::do_unroll(IdealLoopTree *loop, Node_List &old_new, bool adj
}
if (C->do_vector_loop() && (PrintOpto && (VerifyLoopOptimizations || TraceLoopOpts))) {
Arena* arena = Thread::current()->resource_area();
Node_Stack stack(arena, C->live_nodes() >> 2);
Node_Stack stack(C->live_nodes() >> 2);
Node_List rpo_list;
VectorSet visited(arena);
VectorSet visited;
visited.set(loop_head->_idx);
rpo(loop_head, stack, visited, rpo_list);
dump(loop, rpo_list.size(), rpo_list);
@ -3598,7 +3595,7 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st
}
// No make sure all the other nodes in the loop can be handled
VectorSet ok(Thread::current()->resource_area());
VectorSet ok;
// store related values are ok
ok.set(store->_idx);

View File

@ -2942,8 +2942,7 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) {
_created_loop_node = false;
Arena *a = Thread::current()->resource_area();
VectorSet visited(a);
VectorSet visited;
// Pre-grow the mapping from Nodes to IdealLoopTrees.
_nodes.map(C->unique(), NULL);
memset(_nodes.adr(), 0, wordSize * C->unique());
@ -3044,7 +3043,7 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) {
// Given dominators, try to find inner loops with calls that must
// always be executed (call dominates loop tail). These loops do
// not need a separate safepoint.
Node_List cisstack(a);
Node_List cisstack;
_ltree_root->check_safepts(visited, cisstack);
}
@ -3055,10 +3054,10 @@ void PhaseIdealLoop::build_and_optimize(LoopOptsMode mode) {
// Allocate stack with enough space to avoid frequent realloc
int stack_size = (C->live_nodes() >> 1) + 16; // (live_nodes>>1)+16 from Java2D stats
Node_Stack nstack( a, stack_size );
Node_Stack nstack(stack_size);
visited.clear();
Node_List worklist(a);
Node_List worklist;
// Don't need C->root() on worklist since
// it will be processed among C->top() inputs
worklist.push(C->top());
@ -3327,12 +3326,12 @@ static int fail; // debug only, so its multi-thread dont care
void PhaseIdealLoop::verify() const {
int old_progress = C->major_progress();
ResourceMark rm;
PhaseIdealLoop loop_verify( _igvn, this );
VectorSet visited(Thread::current()->resource_area());
PhaseIdealLoop loop_verify(_igvn, this);
VectorSet visited;
fail = 0;
verify_compare( C->root(), &loop_verify, visited );
assert( fail == 0, "verify loops failed" );
verify_compare(C->root(), &loop_verify, visited);
assert(fail == 0, "verify loops failed");
// Verify loop structure is the same
_ltree_root->verify_tree(loop_verify._ltree_root, NULL);
// Reset major-progress. It was cleared by creating a verify version of
@ -4681,10 +4680,9 @@ void PhaseIdealLoop::dump_bad_graph(const char* msg, Node* n, Node* early, Node*
//------------------------------dump-------------------------------------------
void PhaseIdealLoop::dump() const {
ResourceMark rm;
Arena* arena = Thread::current()->resource_area();
Node_Stack stack(arena, C->live_nodes() >> 2);
Node_Stack stack(C->live_nodes() >> 2);
Node_List rpo_list;
VectorSet visited(arena);
VectorSet visited;
visited.set(C->top()->_idx);
rpo(C->root(), stack, visited, rpo_list);
// Dump root loop indexed by last element in PO order

View File

@ -1742,22 +1742,19 @@ void PhaseIdealLoop::clone_loop_handle_data_uses(Node* old, Node_List &old_new,
// Since this code is highly unlikely, we lazily build the worklist
// of such Nodes to go split.
if (!split_if_set) {
ResourceArea *area = Thread::current()->resource_area();
split_if_set = new Node_List(area);
split_if_set = new Node_List();
}
split_if_set->push(use);
}
if (use->is_Bool()) {
if (!split_bool_set) {
ResourceArea *area = Thread::current()->resource_area();
split_bool_set = new Node_List(area);
split_bool_set = new Node_List();
}
split_bool_set->push(use);
}
if (use->Opcode() == Op_CreateEx) {
if (!split_cex_set) {
ResourceArea *area = Thread::current()->resource_area();
split_cex_set = new Node_List(area);
split_cex_set = new Node_List();
}
split_cex_set->push(use);
}
@ -2090,8 +2087,7 @@ void PhaseIdealLoop::clone_loop( IdealLoopTree *loop, Node_List &old_new, int dd
_igvn.hash_find_insert(nnn);
}
ResourceArea *area = Thread::current()->resource_area();
Node_List extra_data_nodes(area); // data nodes in the outer strip mined loop
Node_List extra_data_nodes; // data nodes in the outer strip mined loop
clone_outer_loop(head, mode, loop, outer_loop, dd, old_new, extra_data_nodes);
// Step 3: Now fix control uses. Loop varying control uses have already
@ -2099,7 +2095,7 @@ void PhaseIdealLoop::clone_loop( IdealLoopTree *loop, Node_List &old_new, int dd
// control uses must be either an IfFalse or an IfTrue. Make a merge
// point to merge the old and new IfFalse/IfTrue nodes; make the use
// refer to this.
Node_List worklist(area);
Node_List worklist;
uint new_counter = C->unique();
for( i = 0; i < loop->_body.size(); i++ ) {
Node* old = loop->_body.at(i);
@ -2580,9 +2576,8 @@ void PhaseIdealLoop::remove_cmpi_loop_exit(IfNode* if_cmp, IdealLoopTree *loop)
void PhaseIdealLoop::scheduled_nodelist( IdealLoopTree *loop, VectorSet& member, Node_List &sched ) {
assert(member.test(loop->_head->_idx), "loop head must be in member set");
Arena *a = Thread::current()->resource_area();
VectorSet visited(a);
Node_Stack nstack(a, loop->_body.size());
VectorSet visited;
Node_Stack nstack(loop->_body.size());
Node* n = loop->_head; // top of stack is cached in "n"
uint idx = 0;
@ -3158,12 +3153,11 @@ bool PhaseIdealLoop::partial_peel( IdealLoopTree *loop, Node_List &old_new ) {
}
}
#endif
ResourceArea *area = Thread::current()->resource_area();
VectorSet peel(area);
VectorSet not_peel(area);
Node_List peel_list(area);
Node_List worklist(area);
Node_List sink_list(area);
VectorSet peel;
VectorSet not_peel;
Node_List peel_list;
Node_List worklist;
Node_List sink_list;
uint estimate = loop->est_loop_clone_sz(1);
if (exceeding_node_budget(estimate)) {
@ -3430,7 +3424,7 @@ bool PhaseIdealLoop::partial_peel( IdealLoopTree *loop, Node_List &old_new ) {
#ifndef PRODUCT
if (TracePartialPeeling) {
tty->print_cr("\nafter partial peel one iteration");
Node_List wl(area);
Node_List wl;
Node* t = last_peel;
while (true) {
wl.push(t);

View File

@ -533,8 +533,7 @@ Node *PhaseMacroExpand::value_from_mem(Node *sfpt_mem, Node *sfpt_ctl, BasicType
Node *start_mem = C->start()->proj_out_or_null(TypeFunc::Memory);
Node *alloc_ctrl = alloc->in(TypeFunc::Control);
Node *alloc_mem = alloc->in(TypeFunc::Memory);
Arena *a = Thread::current()->resource_area();
VectorSet visited(a);
VectorSet visited;
bool done = sfpt_mem == alloc_mem;
Node *mem = sfpt_mem;
@ -598,8 +597,8 @@ Node *PhaseMacroExpand::value_from_mem(Node *sfpt_mem, Node *sfpt_ctl, BasicType
return n;
} else if (mem->is_Phi()) {
// attempt to produce a Phi reflecting the values on the input paths of the Phi
Node_Stack value_phis(a, 8);
Node * phi = value_from_mem_phi(mem, ft, ftype, adr_t, alloc, &value_phis, ValueSearchLimit);
Node_Stack value_phis(8);
Node* phi = value_from_mem_phi(mem, ft, ftype, adr_t, alloc, &value_phis, ValueSearchLimit);
if (phi != NULL) {
return phi;
} else {

View File

@ -153,7 +153,7 @@ void Matcher::verify_new_nodes_only(Node* xroot) {
// Make sure that the new graph only references new nodes
ResourceMark rm;
Unique_Node_List worklist;
VectorSet visited(Thread::current()->resource_area());
VectorSet visited;
worklist.push(xroot);
while (worklist.size() > 0) {
Node* n = worklist.pop();
@ -1964,7 +1964,7 @@ void Matcher::find_shared(Node* n) {
// Allocate stack of size C->live_nodes() * 2 to avoid frequent realloc
MStack mstack(C->live_nodes() * 2);
// Mark nodes as address_visited if they are inputs to an address expression
VectorSet address_visited(Thread::current()->resource_area());
VectorSet address_visited;
mstack.push(n, Visit); // Don't need to pre-visit root node
while (mstack.is_nonempty()) {
n = mstack.node(); // Leave node on stack

View File

@ -455,9 +455,8 @@ bool MemNode::all_controls_dominate(Node* dom, Node* sub) {
// Check all control edges of 'dom'.
ResourceMark rm;
Arena* arena = Thread::current()->resource_area();
Node_List nlist(arena);
Unique_Node_List dom_list(arena);
Node_List nlist;
Unique_Node_List dom_list;
dom_list.push(dom);
bool only_dominating_controls = false;
@ -3242,7 +3241,7 @@ void MemBarNode::set_load_store_pair(MemBarNode* leading, MemBarNode* trailing)
MemBarNode* MemBarNode::trailing_membar() const {
ResourceMark rm;
Node* trailing = (Node*)this;
VectorSet seen(Thread::current()->resource_area());
VectorSet seen;
Node_Stack multis(0);
do {
Node* c = trailing;
@ -3286,7 +3285,7 @@ MemBarNode* MemBarNode::trailing_membar() const {
MemBarNode* MemBarNode::leading_membar() const {
ResourceMark rm;
VectorSet seen(Thread::current()->resource_area());
VectorSet seen;
Node_Stack regions(0);
Node* leading = in(0);
while (leading != NULL && (!leading->is_MemBar() || !leading->as_MemBar()->leading())) {

View File

@ -1328,7 +1328,7 @@ static void kill_dead_code( Node *dead, PhaseIterGVN *igvn ) {
if( dead->is_Con() ) return;
ResourceMark rm;
Node_List nstack(Thread::current()->resource_area());
Node_List nstack;
Node *top = igvn->C->top();
nstack.push(dead);
@ -1601,20 +1601,18 @@ Node* find_node(int idx) {
//------------------------------find-------------------------------------------
Node* Node::find(int idx) const {
ResourceArea *area = Thread::current()->resource_area();
VectorSet old_space(area), new_space(area);
VectorSet old_space, new_space;
Node* result = NULL;
find_recur(Compile::current(), result, (Node*) this, idx, false, &old_space, &new_space );
find_recur(Compile::current(), result, (Node*) this, idx, false, &old_space, &new_space);
return result;
}
//------------------------------find_ctrl--------------------------------------
// Find an ancestor to this node in the control history with given _idx
Node* Node::find_ctrl(int idx) const {
ResourceArea *area = Thread::current()->resource_area();
VectorSet old_space(area), new_space(area);
VectorSet old_space, new_space;
Node* result = NULL;
find_recur(Compile::current(), result, (Node*) this, idx, true, &old_space, &new_space );
find_recur(Compile::current(), result, (Node*)this, idx, true, &old_space, &new_space);
return result;
}
#endif
@ -2156,10 +2154,9 @@ void Node::verify_edges(Unique_Node_List &visited) {
void Node::verify(Node* n, int verify_depth) {
assert(verify_depth != 0, "depth should not be 0");
ResourceMark rm;
ResourceArea* area = Thread::current()->resource_area();
VectorSet old_space(area);
VectorSet new_space(area);
Node_List worklist(area);
VectorSet old_space;
VectorSet new_space;
Node_List worklist;
worklist.push(n);
Compile* C = Compile::current();
uint last_index_on_current_depth = 0;
@ -2228,7 +2225,7 @@ void Node::verify(Node* n, int verify_depth) {
//------------------------------walk-------------------------------------------
// Graph walk, with both pre-order and post-order functions
void Node::walk(NFunc pre, NFunc post, void *env) {
VectorSet visited(Thread::current()->resource_area()); // Setup for local walk
VectorSet visited; // Setup for local walk
walk_(pre, post, env, visited);
}

View File

@ -1520,7 +1520,7 @@ class Unique_Node_List : public Node_List {
VectorSet _in_worklist;
uint _clock_index; // Index in list where to pop from next
public:
Unique_Node_List() : Node_List(), _in_worklist(Thread::current()->resource_area()), _clock_index(0) {}
Unique_Node_List() : Node_List(), _clock_index(0) {}
Unique_Node_List(Arena *a) : Node_List(a), _in_worklist(a), _clock_index(0) {}
void remove( Node *n );

View File

@ -401,8 +401,7 @@ void NodeHash::operator=(const NodeHash& nh) {
//=============================================================================
//------------------------------PhaseRemoveUseless-----------------------------
// 1) Use a breadthfirst walk to collect useful nodes reachable from root.
PhaseRemoveUseless::PhaseRemoveUseless(PhaseGVN *gvn, Unique_Node_List *worklist, PhaseNumber phase_num) : Phase(phase_num),
_useful(Thread::current()->resource_area()) {
PhaseRemoveUseless::PhaseRemoveUseless(PhaseGVN* gvn, Unique_Node_List* worklist, PhaseNumber phase_num) : Phase(phase_num) {
// Implementation requires 'UseLoopSafepoints == true' and an edge from root
// to each SafePointNode at a backward branch. Inserted in add_safepoint().
@ -456,7 +455,6 @@ PhaseRenumberLive::PhaseRenumberLive(PhaseGVN* gvn,
PhaseRemoveUseless(gvn, worklist, Remove_Useless_And_Renumber_Live),
_new_type_array(C->comp_arena()),
_old2new_map(C->unique(), C->unique(), -1),
_delayed(Thread::current()->resource_area()),
_is_pass_finished(false),
_live_node_count(C->live_nodes())
{
@ -662,9 +660,9 @@ void PhaseTransform::dump_types( ) const {
}
//------------------------------dump_nodes_and_types---------------------------
void PhaseTransform::dump_nodes_and_types(const Node *root, uint depth, bool only_ctrl) {
VectorSet visited(Thread::current()->resource_area());
dump_nodes_and_types_recur( root, depth, only_ctrl, visited );
void PhaseTransform::dump_nodes_and_types(const Node* root, uint depth, bool only_ctrl) {
VectorSet visited;
dump_nodes_and_types_recur(root, depth, only_ctrl, visited);
}
//------------------------------dump_nodes_and_types_recur---------------------

View File

@ -40,7 +40,6 @@ PhaseRegAlloc::PhaseRegAlloc( uint unique, PhaseCFG &cfg,
Phase(Register_Allocation),
_node_regs(0),
_node_regs_max_index(0),
_node_oops(Thread::current()->resource_area()),
_cfg(cfg),
_framesize(0xdeadbeef),
_matcher(matcher)

View File

@ -584,8 +584,7 @@ StringConcat* PhaseStringOpts::build_candidate(CallStaticJavaNode* call) {
PhaseStringOpts::PhaseStringOpts(PhaseGVN* gvn, Unique_Node_List*):
Phase(StringOpts),
_gvn(gvn),
_visited(Thread::current()->resource_area()) {
_gvn(gvn) {
assert(OptimizeStringConcat, "shouldn't be here");