United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6818666 G1: Type lost in g1 pre-barrier
JDK-6818666 : G1: Type lost in g1 pre-barrier

Details
Type:
Bug
Submit Date:
2009-03-18
Status:
Closed
Updated Date:
2011-03-07
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs14
Fixed Versions:
hs16 (b06)

Related Reports
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
C2 fails inlining the g1 pre-barrier:
#  Internal Error (/tmp/jprt/P1/B/004916.iv159533/source/src/share/vm/opto/type.hpp:1083), pid=14214, tid=15
#  Error: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")

Stack: [0xfffffd7fb1266000,0xfffffd7fb1366000],  sp=0xfffffd7fb1354020,  free space=3b80000000000000001k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1d7800f];;  void VMError::report(outputStream*)+0x68f
V  [libjvm.so+0x1d78ecd];;  void VMError::report_and_die()+0x4fd
V  [libjvm.so+0xa6250b];;  void report_assertion_failure(const char*,int,const char*)+0x5ab
V  [libjvm.so+0x16b1962];;  Node*LoadNode::make(PhaseGVN&,Node*,Node*,Node*,const TypePtr*,const Type*,BasicType)+0xc32
V  [libjvm.so+0xcf2bb9];;  Node*IdealKit::load(Node*,Node*,const Type*,BasicType,int,bool)+0x119
V  [libjvm.so+0xca3bfa];;  void GraphKit::g1_write_barrier_pre(Node*,Node*,unsigned,Node*,const Type*,BasicType)+0x59a
V  [libjvm.so+0xc80128];;  Node*GraphKit::store_oop_to_unknown(Node*,Node*,Node*,const TypePtr*,Node*,const Type*,BasicType)+0x58
V  [libjvm.so+0x1523cd5];;  bool LibraryCallKit::inline_unsafe_access(bool,bool,BasicType,bool)+0x1585
V  [libjvm.so+0x150a927];;  bool LibraryCallKit::try_to_inline()+0x747
V  [libjvm.so+0x1509cc3];;  JVMState*LibraryIntrinsic::generate(JVMState*)+0xc3
V  [libjvm.so+0xb1eabc];;  void Parse::do_call()+0x4dc
V  [libjvm.so+0x18ceeb9];;  void Parse::do_one_bytecode()+0x1e9
V  [libjvm.so+0x18a6bc4];;  void Parse::do_one_block()+0x504
V  [libjvm.so+0x189a797];;  void Parse::do_all_blocks()+0x427
V  [libjvm.so+0x1899db6];;  Parse::Parse(JVMState*,ciMethod*,float)+0xad6
V  [libjvm.so+0x6f7dd1];;  JVMState*ParseGenerator::generate(JVMState*)+0x101
V  [libjvm.so+0xb1eabc];;  void Parse::do_call()+0x4dc
V  [libjvm.so+0x18ceeb9];;  void Parse::do_one_bytecode()+0x1e9
V  [libjvm.so+0x18a6bc4];;  void Parse::do_one_block()+0x504
V  [libjvm.so+0x189a797];;  void Parse::do_all_blocks()+0x427
V  [libjvm.so+0x1899db6];;  Parse::Parse(JVMState*,ciMethod*,float)+0xad6
V  [libjvm.so+0x6f7dd1];;  JVMState*ParseGenerator::generate(JVMState*)+0x101
V  [libjvm.so+0xb1eabc];;  void Parse::do_call()+0x4dc
V  [libjvm.so+0x18ceeb9];;  void Parse::do_one_bytecode()+0x1e9
V  [libjvm.so+0x18a6bc4];;  void Parse::do_one_block()+0x504
V  [libjvm.so+0x189a797];;  void Parse::do_all_blocks()+0x427
V  [libjvm.so+0x1899db6];;  Parse::Parse(JVMState*,ciMethod*,float)+0xad6
V  [libjvm.so+0x6f7dd1];;  JVMState*ParseGenerator::generate(JVMState*)+0x101
V  [libjvm.so+0x90da11];;  Compile::Compile(ciEnv*,C2Compiler*,ciMethod*,int,bool,bool)+0x12f1
V  [libjvm.so+0x6f6dcc];;  void C2Compiler::compile_method(ciEnv*,ciMethod*,int)+0xcc
V  [libjvm.so+0x92ecc9];;  void CompileBroker::invoke_compiler_on_method(CompileTask*)+0x1269
V  [libjvm.so+0x92cdd8];;  void CompileBroker::compiler_thread_loop()+0x1528
V  [libjvm.so+0x1c47306];;  void compiler_thread_entry(JavaThread*,Thread*)+0x16
V  [libjvm.so+0x1c41257];;  void JavaThread::thread_main_inner()+0x107
V  [libjvm.so+0x1c410b6];;  void JavaThread::run()+0x1d6
V  [libjvm.so+0x183b63a];;  java_start+0x66a
C  [libc.so.1+0xcfd7b]  _thr_slot_offset+0x31b;;  _thr_setup+0x5b
C  [libc.so.1+0xcffb0]  _thr_slot_offset+0x550;;  _lwp_start+0x0


How to reproduce:
java -server -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -cp /net/sqenfs-1.sfbay.sun.com/export1/comp/vm/testbase/sqe/vm/6/build/r24/vm/bin/classes:/net/sqenfs-1.sfbay.sun.com/export1/comp/vm/testbase/jck/6b/dist/JCK-runtime-6b/classes  nsk.stress.share.StressTestRunner -testList /net/sqenfs-1.sfbay.sun.com/export1/comp/vm/testbase/sqe/vm/6/build/r24/vm/src/nsk/stress/jck60/jck60021/tests -stress:indulgent

                                    

Comments
EVALUATION

The code that calls store_oop_to_unknown uses val->bottom_type() as the type of the load used in the pre-barrier.  If you are storing null then this is TypePtr::NULL_PTR which isn't a valid type for the result of a load.  We have to get type from a different place, probably the adr_type.
                                     
2009-03-18
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/8f5825e0aeaa
                                     
2009-06-26



Hardware and Software, Engineered to Work Together