Wed, 04 Feb 2009 23:17:38 -0800
6442502: assert(bits,"Use TypePtr for NULL") on linux-x86
Reviewed-by: kvn
src/share/vm/opto/graphKit.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/opto/graphKit.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/graphKit.cpp Wed Feb 04 11:44:57 2009 -0800 1.2 +++ b/src/share/vm/opto/graphKit.cpp Wed Feb 04 23:17:38 2009 -0800 1.3 @@ -1836,10 +1836,7 @@ 1.4 (CardTableModRefBS*)(Universe::heap()->barrier_set()); 1.5 Node *b = _gvn.transform(new (C, 3) URShiftXNode( cast, _gvn.intcon(CardTableModRefBS::card_shift) )); 1.6 // We store into a byte array, so do not bother to left-shift by zero 1.7 - // Get base of card map 1.8 - assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), 1.9 - "adjust this code"); 1.10 - Node *c = makecon(TypeRawPtr::make((address)ct->byte_map_base)); 1.11 + Node *c = byte_map_base_node(); 1.12 // Combine 1.13 Node *sb_ctl = control(); 1.14 Node *sb_adr = _gvn.transform(new (C, 4) AddPNode( top()/*no base ptr*/, c, b )); 1.15 @@ -3365,14 +3362,6 @@ 1.16 1.17 const TypeFunc *tf = OptoRuntime::g1_wb_post_Type(); 1.18 1.19 - // Get the address of the card table 1.20 - CardTableModRefBS* ct = 1.21 - (CardTableModRefBS*)(Universe::heap()->barrier_set()); 1.22 - Node *card_table = __ makecon(TypeRawPtr::make((address)ct->byte_map_base)); 1.23 - // Get base of card map 1.24 - assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); 1.25 - 1.26 - 1.27 // Offsets into the thread 1.28 const int index_offset = in_bytes(JavaThread::dirty_card_queue_offset() + 1.29 PtrQueue::byte_offset_of_index()); 1.30 @@ -3402,7 +3391,7 @@ 1.31 Node* card_offset = __ URShiftX( cast, __ ConI(CardTableModRefBS::card_shift) ); 1.32 1.33 // Combine card table base and card offset 1.34 - Node *card_adr = __ AddP(no_base, card_table, card_offset ); 1.35 + Node *card_adr = __ AddP(no_base, byte_map_base_node(), card_offset ); 1.36 1.37 // If we know the value being stored does it cross regions? 1.38
2.1 --- a/src/share/vm/opto/graphKit.hpp Wed Feb 04 11:44:57 2009 -0800 2.2 +++ b/src/share/vm/opto/graphKit.hpp Wed Feb 04 23:17:38 2009 -0800 2.3 @@ -83,6 +83,18 @@ 2.4 Node* zerocon(BasicType bt) const { return _gvn.zerocon(bt); } 2.5 // (See also macro MakeConX in type.hpp, which uses intcon or longcon.) 2.6 2.7 + // Helper for byte_map_base 2.8 + Node* byte_map_base_node() { 2.9 + // Get base of card map 2.10 + CardTableModRefBS* ct = (CardTableModRefBS*)(Universe::heap()->barrier_set()); 2.11 + assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust users of this code"); 2.12 + if (ct->byte_map_base != NULL) { 2.13 + return makecon(TypeRawPtr::make((address)ct->byte_map_base)); 2.14 + } else { 2.15 + return null(); 2.16 + } 2.17 + } 2.18 + 2.19 jint find_int_con(Node* n, jint value_if_unknown) { 2.20 return _gvn.find_int_con(n, value_if_unknown); 2.21 }