src/share/vm/opto/phaseX.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/phaseX.cpp

Print this page
rev 5464 : 8024070: C2 needs some form of type speculation
Summary: record unused type profile information with type system, propagate and use it.
Reviewed-by:
rev 5465 : imported patch speculative-cleanup


1368         Node* u = use->fast_out(i2);
1369         if (u->is_Mem())
1370           _worklist.push(u);
1371       }
1372     }
1373     // If changed initialization activity, check dependent Stores
1374     if (use_op == Op_Allocate || use_op == Op_AllocateArray) {
1375       InitializeNode* init = use->as_Allocate()->initialization();
1376       if (init != NULL) {
1377         Node* imem = init->proj_out(TypeFunc::Memory);
1378         if (imem != NULL)  add_users_to_worklist0(imem);
1379       }
1380     }
1381     if (use_op == Op_Initialize) {
1382       Node* imem = use->as_Initialize()->proj_out(TypeFunc::Memory);
1383       if (imem != NULL)  add_users_to_worklist0(imem);
1384     }
1385   }
1386 }
1387 












1388 //=============================================================================
1389 #ifndef PRODUCT
1390 uint PhaseCCP::_total_invokes   = 0;
1391 uint PhaseCCP::_total_constants = 0;
1392 #endif
1393 //------------------------------PhaseCCP---------------------------------------
1394 // Conditional Constant Propagation, ala Wegman & Zadeck
1395 PhaseCCP::PhaseCCP( PhaseIterGVN *igvn ) : PhaseIterGVN(igvn) {
1396   NOT_PRODUCT( clear_constants(); )
1397   assert( _worklist.size() == 0, "" );
1398   // Clear out _nodes from IterGVN.  Must be clear to transform call.
1399   _nodes.clear();               // Clear out from IterGVN
1400   analyze();
1401 }
1402 
1403 #ifndef PRODUCT
1404 //------------------------------~PhaseCCP--------------------------------------
1405 PhaseCCP::~PhaseCCP() {
1406   inc_invokes();
1407   _total_constants += count_constants();




1368         Node* u = use->fast_out(i2);
1369         if (u->is_Mem())
1370           _worklist.push(u);
1371       }
1372     }
1373     // If changed initialization activity, check dependent Stores
1374     if (use_op == Op_Allocate || use_op == Op_AllocateArray) {
1375       InitializeNode* init = use->as_Allocate()->initialization();
1376       if (init != NULL) {
1377         Node* imem = init->proj_out(TypeFunc::Memory);
1378         if (imem != NULL)  add_users_to_worklist0(imem);
1379       }
1380     }
1381     if (use_op == Op_Initialize) {
1382       Node* imem = use->as_Initialize()->proj_out(TypeFunc::Memory);
1383       if (imem != NULL)  add_users_to_worklist0(imem);
1384     }
1385   }
1386 }
1387 
1388 // Remove the speculative part of all types that we know of
1389 void PhaseIterGVN::remove_speculative_types()  {
1390   assert(UseTypeSpeculation, "speculation is off");
1391   for (int i = 0; i < _types.Size(); i++)  {
1392     const Type* t = _types.fast_lookup(i);
1393     if (t != NULL && t->isa_oopptr()) {
1394       const TypeOopPtr* to = t->is_oopptr();
1395       _types.map(i, to->remove_speculative());
1396     }
1397   }
1398 }
1399 
1400 //=============================================================================
1401 #ifndef PRODUCT
1402 uint PhaseCCP::_total_invokes   = 0;
1403 uint PhaseCCP::_total_constants = 0;
1404 #endif
1405 //------------------------------PhaseCCP---------------------------------------
1406 // Conditional Constant Propagation, ala Wegman & Zadeck
1407 PhaseCCP::PhaseCCP( PhaseIterGVN *igvn ) : PhaseIterGVN(igvn) {
1408   NOT_PRODUCT( clear_constants(); )
1409   assert( _worklist.size() == 0, "" );
1410   // Clear out _nodes from IterGVN.  Must be clear to transform call.
1411   _nodes.clear();               // Clear out from IterGVN
1412   analyze();
1413 }
1414 
1415 #ifndef PRODUCT
1416 //------------------------------~PhaseCCP--------------------------------------
1417 PhaseCCP::~PhaseCCP() {
1418   inc_invokes();
1419   _total_constants += count_constants();


src/share/vm/opto/phaseX.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File