1.1 --- a/src/share/vm/c1/c1_IR.cpp Wed Sep 22 23:51:03 2010 -0700 1.2 +++ b/src/share/vm/c1/c1_IR.cpp Tue Dec 29 19:08:54 2009 +0100 1.3 @@ -116,24 +116,6 @@ 1.4 1.5 1.6 // Implementation of IRScope 1.7 - 1.8 -BlockBegin* IRScope::header_block(BlockBegin* entry, BlockBegin::Flag f, ValueStack* state) { 1.9 - if (entry == NULL) return NULL; 1.10 - assert(entry->is_set(f), "entry/flag mismatch"); 1.11 - // create header block 1.12 - BlockBegin* h = new BlockBegin(entry->bci()); 1.13 - BlockEnd* g = new Goto(entry, false); 1.14 - h->set_next(g, entry->bci()); 1.15 - h->set_end(g); 1.16 - h->set(f); 1.17 - // setup header block end state 1.18 - ValueStack* s = state->copy(); // can use copy since stack is empty (=> no phis) 1.19 - assert(s->stack_is_empty(), "must have empty stack at entry point"); 1.20 - g->set_state(s); 1.21 - return h; 1.22 -} 1.23 - 1.24 - 1.25 BlockBegin* IRScope::build_graph(Compilation* compilation, int osr_bci) { 1.26 GraphBuilder gm(compilation, this); 1.27 NOT_PRODUCT(if (PrintValueNumbering && Verbose) gm.print_stats()); 1.28 @@ -145,12 +127,9 @@ 1.29 IRScope::IRScope(Compilation* compilation, IRScope* caller, int caller_bci, ciMethod* method, int osr_bci, bool create_graph) 1.30 : _callees(2) 1.31 , _compilation(compilation) 1.32 -, _lock_stack_size(-1) 1.33 , _requires_phi_function(method->max_locals()) 1.34 { 1.35 _caller = caller; 1.36 - _caller_bci = caller == NULL ? -1 : caller_bci; 1.37 - _caller_state = NULL; // Must be set later if needed 1.38 _level = caller == NULL ? 0 : caller->level() + 1; 1.39 _method = method; 1.40 _xhandlers = new XHandlers(method); 1.41 @@ -182,32 +161,6 @@ 1.42 } 1.43 1.44 1.45 -void IRScope::compute_lock_stack_size() { 1.46 - if (!InlineMethodsWithExceptionHandlers) { 1.47 - _lock_stack_size = 0; 1.48 - return; 1.49 - } 1.50 - 1.51 - // Figure out whether we have to preserve expression stack elements 1.52 - // for parent scopes, and if so, how many 1.53 - IRScope* cur_scope = this; 1.54 - while (cur_scope != NULL && !cur_scope->xhandlers()->has_handlers()) { 1.55 - cur_scope = cur_scope->caller(); 1.56 - } 1.57 - _lock_stack_size = (cur_scope == NULL ? 0 : 1.58 - (cur_scope->caller_state() == NULL ? 0 : 1.59 - cur_scope->caller_state()->stack_size())); 1.60 -} 1.61 - 1.62 -int IRScope::top_scope_bci() const { 1.63 - assert(!is_top_scope(), "no correct answer for top scope possible"); 1.64 - const IRScope* scope = this; 1.65 - while (!scope->caller()->is_top_scope()) { 1.66 - scope = scope->caller(); 1.67 - } 1.68 - return scope->caller_bci(); 1.69 -} 1.70 - 1.71 bool IRScopeDebugInfo::should_reexecute() { 1.72 ciMethod* cur_method = scope()->method(); 1.73 int cur_bci = bci(); 1.74 @@ -222,37 +175,24 @@ 1.75 // Implementation of CodeEmitInfo 1.76 1.77 // Stack must be NON-null 1.78 -CodeEmitInfo::CodeEmitInfo(int bci, ValueStack* stack, XHandlers* exception_handlers) 1.79 +CodeEmitInfo::CodeEmitInfo(ValueStack* stack, XHandlers* exception_handlers) 1.80 : _scope(stack->scope()) 1.81 - , _bci(bci) 1.82 , _scope_debug_info(NULL) 1.83 , _oop_map(NULL) 1.84 , _stack(stack) 1.85 , _exception_handlers(exception_handlers) 1.86 - , _next(NULL) 1.87 - , _id(-1) 1.88 , _is_method_handle_invoke(false) { 1.89 assert(_stack != NULL, "must be non null"); 1.90 - assert(_bci == SynchronizationEntryBCI || Bytecodes::is_defined(scope()->method()->java_code_at_bci(_bci)), "make sure bci points at a real bytecode"); 1.91 } 1.92 1.93 1.94 -CodeEmitInfo::CodeEmitInfo(CodeEmitInfo* info, bool lock_stack_only) 1.95 +CodeEmitInfo::CodeEmitInfo(CodeEmitInfo* info, ValueStack* stack) 1.96 : _scope(info->_scope) 1.97 , _exception_handlers(NULL) 1.98 - , _bci(info->_bci) 1.99 , _scope_debug_info(NULL) 1.100 , _oop_map(NULL) 1.101 + , _stack(stack == NULL ? info->_stack : stack) 1.102 , _is_method_handle_invoke(info->_is_method_handle_invoke) { 1.103 - if (lock_stack_only) { 1.104 - if (info->_stack != NULL) { 1.105 - _stack = info->_stack->copy_locks(); 1.106 - } else { 1.107 - _stack = NULL; 1.108 - } 1.109 - } else { 1.110 - _stack = info->_stack; 1.111 - } 1.112 1.113 // deep copy of exception handlers 1.114 if (info->_exception_handlers != NULL) { 1.115 @@ -273,8 +213,6 @@ 1.116 assert(_oop_map != NULL, "oop map must already exist"); 1.117 assert(opr->is_single_cpu(), "should not call otherwise"); 1.118 1.119 - int frame_size = frame_map()->framesize(); 1.120 - int arg_count = frame_map()->oop_map_arg_count(); 1.121 VMReg name = frame_map()->regname(opr); 1.122 _oop_map->set_oop(name); 1.123 } 1.124 @@ -383,8 +321,7 @@ 1.125 void visit(Value* n) { 1.126 // Local instructions and Phis for expression stack values at the 1.127 // start of basic blocks are not added to the instruction list 1.128 - if ((*n)->bci() == -99 && (*n)->as_Local() == NULL && 1.129 - (*n)->as_Phi() == NULL) { 1.130 + if (!(*n)->is_linked()&& (*n)->can_be_linked()) { 1.131 assert(false, "a node was not appended to the graph"); 1.132 Compilation::current()->bailout("a node was not appended to the graph"); 1.133 } 1.134 @@ -1338,7 +1275,7 @@ 1.135 // need to remove this instruction from the instruction stream 1.136 if (n->subst() != n) { 1.137 assert(last != NULL, "must have last"); 1.138 - last->set_next(n->next(), n->next()->bci()); 1.139 + last->set_next(n->next()); 1.140 } else { 1.141 last = n; 1.142 }