提交 12e10e67 编写于 作者: K kvn

Merge

......@@ -161,6 +161,8 @@ public class OopTreeNodeAdapter extends FieldTreeNodeAdapter {
child = new OopTreeNodeAdapter(field.getValue(getObj()), field.getID(), getTreeTableMode());
} catch (AddressException e) {
child = new BadOopTreeNodeAdapter(field.getValueAsOopHandle(getObj()), field.getID(), getTreeTableMode());
} catch (UnknownOopException e) {
child = new BadOopTreeNodeAdapter(field.getValueAsOopHandle(getObj()), field.getID(), getTreeTableMode());
}
}
++curField;
......
......@@ -41,7 +41,7 @@ ifeq ($(COMPILER_REV_NUMERIC),509)
endif
# Workaround SS11 bug 6345274 (all platforms) (Fixed in SS11 patch and SS12)
ifeq ($(COMPILER_REV_NUMERIC),508))
ifeq ($(COMPILER_REV_NUMERIC),508)
OPT_CFLAGS/ciTypeFlow.o = $(OPT_CFLAGS/O2)
endif # COMPILER_REV_NUMERIC == 508
......
......@@ -357,6 +357,9 @@ PhaseCFG::PhaseCFG( Arena *a, RootNode *r, Matcher &m ) :
#ifndef PRODUCT
, _trace_opto_pipelining(TraceOptoPipelining || C->method_has_option("TraceOptoPipelining"))
#endif
#ifdef ASSERT
, _raw_oops(a)
#endif
{
ResourceMark rm;
// I'll need a few machine-specific GotoNodes. Make an Ideal GotoNode,
......
......@@ -380,6 +380,10 @@ class PhaseCFG : public Phase {
bool _trace_opto_pipelining; // tracing flag
#endif
#ifdef ASSERT
Unique_Node_List _raw_oops;
#endif
// Build dominators
void Dominators();
......
......@@ -74,9 +74,11 @@ struct OopFlow : public ResourceObj {
// this block.
Block *_b; // Block for this struct
OopFlow *_next; // Next free OopFlow
// or NULL if dead/conflict
Compile* C;
OopFlow( short *callees, Node **defs ) : _callees(callees), _defs(defs),
_b(NULL), _next(NULL) { }
OopFlow( short *callees, Node **defs, Compile* c ) : _callees(callees), _defs(defs),
_b(NULL), _next(NULL), C(c) { }
// Given reaching-defs for this block start, compute it for this block end
void compute_reach( PhaseRegAlloc *regalloc, int max_reg, Dict *safehash );
......@@ -88,7 +90,7 @@ struct OopFlow : public ResourceObj {
void clone( OopFlow *flow, int max_size);
// Make a new OopFlow from scratch
static OopFlow *make( Arena *A, int max_size );
static OopFlow *make( Arena *A, int max_size, Compile* C );
// Build an oopmap from the current flow info
OopMap *build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, int* live );
......@@ -180,11 +182,11 @@ void OopFlow::clone( OopFlow *flow, int max_size ) {
}
//------------------------------make-------------------------------------------
OopFlow *OopFlow::make( Arena *A, int max_size ) {
OopFlow *OopFlow::make( Arena *A, int max_size, Compile* C ) {
short *callees = NEW_ARENA_ARRAY(A,short,max_size+1);
Node **defs = NEW_ARENA_ARRAY(A,Node*,max_size+1);
debug_only( memset(defs,0,(max_size+1)*sizeof(Node*)) );
OopFlow *flow = new (A) OopFlow(callees+1, defs+1);
OopFlow *flow = new (A) OopFlow(callees+1, defs+1, C);
assert( &flow->_callees[OptoReg::Bad] == callees, "Ok to index at OptoReg::Bad" );
assert( &flow->_defs [OptoReg::Bad] == defs , "Ok to index at OptoReg::Bad" );
return flow;
......@@ -288,7 +290,7 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i
m = m->in(idx);
}
}
guarantee( 0, "must find derived/base pair" );
guarantee( 0, "must find derived/base pair" );
}
found: ;
Node *base = n->in(i+1); // Base is other half of pair
......@@ -347,6 +349,13 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i
} else {
// Other - some reaching non-oop value
omap->set_value( r);
#ifdef ASSERT
if( t->isa_rawptr() && C->cfg()->_raw_oops.member(def) ) {
def->dump();
n->dump();
assert(false, "there should be a oop in OopMap instead of a live raw oop at safepoint");
}
#endif
}
}
......@@ -562,7 +571,7 @@ void Compile::BuildOopMaps() {
// Do the first block 'by hand' to prime the worklist
Block *entry = _cfg->_blocks[1];
OopFlow *rootflow = OopFlow::make(A,max_reg);
OopFlow *rootflow = OopFlow::make(A,max_reg,this);
// Initialize to 'bottom' (not 'top')
memset( rootflow->_callees, OptoReg::Bad, max_reg*sizeof(short) );
memset( rootflow->_defs , 0, max_reg*sizeof(Node*) );
......@@ -628,7 +637,7 @@ void Compile::BuildOopMaps() {
// Carry it forward.
} else { // Draw a new OopFlow from the freelist
if( !free_list )
free_list = OopFlow::make(A,max_reg);
free_list = OopFlow::make(A,max_reg,C);
flow = free_list;
assert( flow->_b == NULL, "oopFlow is not free" );
free_list = flow->_next;
......
......@@ -1130,6 +1130,9 @@ void PhaseCFG::schedule_late(VectorSet &visited, Node_List &stack) {
Node *def = self->in(1);
if (def != NULL && def->bottom_type()->base() == Type::RawPtr) {
early->add_inst(self);
#ifdef ASSERT
_raw_oops.push(def);
#endif
continue;
}
break;
......
此差异已折叠。
......@@ -667,7 +667,6 @@ static bool merge_point_too_heavy(Compile* C, Node* region) {
}
}
#ifdef _LP64
static bool merge_point_safe(Node* region) {
// 4799512: Stop split_if_with_blocks from splitting a block with a ConvI2LNode
// having a PhiNode input. This sidesteps the dangerous case where the split
......@@ -676,20 +675,25 @@ static bool merge_point_safe(Node* region) {
// uses.
// A better fix for this problem can be found in the BugTraq entry, but
// expediency for Mantis demands this hack.
// 6855164: If the merge point has a FastLockNode with a PhiNode input, we stop
// split_if_with_blocks from splitting a block because we could not move around
// the FastLockNode.
for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) {
Node* n = region->fast_out(i);
if (n->is_Phi()) {
for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
Node* m = n->fast_out(j);
if (m->Opcode() == Op_ConvI2L) {
if (m->is_FastLock())
return false;
}
#ifdef _LP64
if (m->Opcode() == Op_ConvI2L)
return false;
#endif
}
}
}
return true;
}
#endif
//------------------------------place_near_use---------------------------------
......@@ -771,12 +775,10 @@ void PhaseIdealLoop::split_if_with_blocks_post( Node *n ) {
if( get_loop(n_ctrl->in(j)) != n_loop )
return;
#ifdef _LP64
// Check for safety of the merge point.
if( !merge_point_safe(n_ctrl) ) {
return;
}
#endif
// Split compare 'n' through the merge point if it is profitable
Node *phi = split_thru_phi( n, n_ctrl, policy );
......
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6855164
* @summary SIGSEGV during compilation of method involving loop over CharSequence
* @run main/othervm -Xbatch Test
*/
public class Test{
public static void main(String[] args) throws Exception {
StringBuffer builder = new StringBuffer();
for(int i = 0; i < 100; i++)
builder.append("I am the very model of a modern major general\n");
for(int j = 0; j < builder.length(); j++){
previousSpaceIndex(builder, j);
}
}
private static final int previousSpaceIndex(CharSequence sb, int seek) {
seek--;
while (seek > 0) {
if (sb.charAt(seek) == ' ') {
while (seek > 0 && sb.charAt(seek - 1) == ' ')
seek--;
return seek;
}
seek--;
}
return 0;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册