# HG changeset patch # User kvn # Date 1251483573 25200 # Node ID 8fe1963e3964e16661112196fe2f653759a1b602 # Parent 489a4f8dcd0fe3f80d75b9c0bf494f7df3b953ae 6875577: CTW fails with /hotspot/src/share/vm/opto/memnode.cpp Summary: Fix do_null_check to check for unloaded klass for all oop pointers. Reviewed-by: never, cfang diff -r 489a4f8dcd0f -r 8fe1963e3964 src/share/vm/opto/graphKit.cpp --- a/src/share/vm/opto/graphKit.cpp Thu Aug 27 06:17:23 2009 -0700 +++ b/src/share/vm/opto/graphKit.cpp Fri Aug 28 11:19:33 2009 -0700 @@ -622,11 +622,13 @@ //---------------------------PreserveReexecuteState---------------------------- PreserveReexecuteState::PreserveReexecuteState(GraphKit* kit) { + assert(!kit->stopped(), "must call stopped() before"); _kit = kit; _sp = kit->sp(); _reexecute = kit->jvms()->_reexecute; } PreserveReexecuteState::~PreserveReexecuteState() { + if (_kit->stopped()) return; _kit->jvms()->_reexecute = _reexecute; _kit->set_sp(_sp); } @@ -1123,7 +1125,7 @@ case T_OBJECT : { const Type *t = _gvn.type( value ); - const TypeInstPtr* tp = t->isa_instptr(); + const TypeOopPtr* tp = t->isa_oopptr(); if (tp != NULL && !tp->klass()->is_loaded() // Only for do_null_check, not any of its siblings: && !assert_null && null_control == NULL) { diff -r 489a4f8dcd0f -r 8fe1963e3964 src/share/vm/opto/library_call.cpp --- a/src/share/vm/opto/library_call.cpp Thu Aug 27 06:17:23 2009 -0700 +++ b/src/share/vm/opto/library_call.cpp Fri Aug 28 11:19:33 2009 -0700 @@ -3894,6 +3894,7 @@ assert(obj_size != NULL, ""); Node* raw_obj = alloc_obj->in(1); assert(alloc_obj->is_CheckCastPP() && raw_obj->is_Proj() && raw_obj->in(0)->is_Allocate(), ""); + assert(alloc_obj->as_CheckCastPP()->type() != TypeInstPtr::NOTNULL, "should be more precise than Object"); if (ReduceBulkZeroing) { // We will be completely responsible for initializing this object - @@ -4447,6 +4448,7 @@ InitializeNode* init = alloc->initialization(); assert(init->is_complete(), "we just did this"); assert(dest->is_CheckCastPP(), "sanity"); + assert(dest->as_CheckCastPP()->type() != TypeInstPtr::NOTNULL, "type should be more precise than Object"); assert(dest->in(0)->in(0) == init, "dest pinned"); // Cast to Object for arraycopy.