const TypePtr *ProjNode::adr_type() const { if (bottom_type() == Type::MEMORY) { // in(0) might be a narrow MemBar; otherwise we will report TypePtr::BOTTOM const TypePtr* adr_type = in(0)->adr_type(); #ifdef ASSERT if (!is_error_reported() && !Node::in_dump()) assert(adr_type != NULL, "source must have adr_type"); #endif return adr_type; } assert(bottom_type()->base() != Type::Memory, "no other memories?"); return NULL; }
void ParmNode::dump_spec() const { if( _con < TypeFunc::Parms ) { tty->print(names[_con]); } else { tty->print("Parm%d: ",_con-TypeFunc::Parms); // Verbose and WizardMode dump bottom_type for all nodes if( !Verbose && !WizardMode ) bottom_type()->dump(); } }
// Create a binary tree form for Packs. [lo, hi) (half-open) range Node* PackNode::binaryTreePack(Compile* C, int lo, int hi) { int ct = hi - lo; assert(is_power_of_2(ct), "power of 2"); int mid = lo + ct/2; Node* n1 = ct == 2 ? in(lo) : binaryTreePack(C, lo, mid); Node* n2 = ct == 2 ? in(lo+1) : binaryTreePack(C, mid, hi ); int rslt_bsize = ct * type2aelembytes(elt_basic_type()); if (bottom_type()->is_floatingpoint()) { switch (rslt_bsize) { case 8: return new (C, 3) PackFNode(n1, n2); case 16: return new (C, 3) PackDNode(n1, n2); } } else { assert(bottom_type()->isa_int() || bottom_type()->isa_long(), "int or long"); switch (rslt_bsize) { case 2: return new (C, 3) Pack2x1BNode(n1, n2); case 4: return new (C, 3) Pack2x2BNode(n1, n2); case 8: return new (C, 3) PackINode(n1, n2); case 16: return new (C, 3) PackLNode(n1, n2); } } ShouldNotReachHere(); return NULL; }
//------------------------------Value----------------------------------------- // An add node sums it's two _in. If one input is an RSD, we must mixin // the other input's symbols. const Type *AddNode::Value( PhaseTransform *phase ) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); if( t1 == Type::TOP ) return Type::TOP; if( t2 == Type::TOP ) return Type::TOP; // Either input is BOTTOM ==> the result is the local BOTTOM const Type *bot = bottom_type(); if( (t1 == bot) || (t2 == bot) || (t1 == Type::BOTTOM) || (t2 == Type::BOTTOM) ) return bot; // Check for an addition involving the additive identity const Type *tadd = add_of_identity( t1, t2 ); if( tadd ) return tadd; return add_ring(t1,t2); // Local flavor of type addition }
//------------------------------Value------------------------------------------ // A subtract node differences it's two inputs. const Type *SubNode::Value( PhaseTransform *phase ) const { const Node* in1 = in(1); const Node* in2 = in(2); // Either input is TOP ==> the result is TOP const Type* t1 = (in1 == this) ? Type::TOP : phase->type(in1); if( t1 == Type::TOP ) return Type::TOP; const Type* t2 = (in2 == this) ? Type::TOP : phase->type(in2); if( t2 == Type::TOP ) return Type::TOP; // Not correct for SubFnode and AddFNode (must check for infinity) // Equal? Subtract is zero if( phase->eqv(in1, in2) ) return add_id(); // Either input is BOTTOM ==> the result is the local BOTTOM if( t1 == Type::BOTTOM || t2 == Type::BOTTOM ) return bottom_type(); return sub(t1,t2); // Local flavor of type subtraction }
//------------------------------Value----------------------------------------- const Type *MulNode::Value( PhaseTransform *phase ) const { const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); // Either input is TOP ==> the result is TOP if( t1 == Type::TOP ) return Type::TOP; if( t2 == Type::TOP ) return Type::TOP; // Either input is ZERO ==> the result is ZERO. // Not valid for floats or doubles since +0.0 * -0.0 --> +0.0 int op = Opcode(); if( op == Op_MulI || op == Op_AndI || op == Op_MulL || op == Op_AndL ) { const Type *zero = add_id(); // The multiplicative zero if( t1->higher_equal( zero ) ) return zero; if( t2->higher_equal( zero ) ) return zero; } // Either input is BOTTOM ==> the result is the local BOTTOM if( t1 == Type::BOTTOM || t2 == Type::BOTTOM ) return bottom_type(); return mul_ring(t1,t2); // Local flavor of type multiplication }
//============================================================================= //------------------------------Value------------------------------------------ // A subtract node differences it's two inputs. const Type *SubFPNode::Value( PhaseTransform *phase ) const { const Node* in1 = in(1); const Node* in2 = in(2); // Either input is TOP ==> the result is TOP const Type* t1 = (in1 == this) ? Type::TOP : phase->type(in1); if( t1 == Type::TOP ) return Type::TOP; const Type* t2 = (in2 == this) ? Type::TOP : phase->type(in2); if( t2 == Type::TOP ) return Type::TOP; // if both operands are infinity of same sign, the result is NaN; do // not replace with zero if( (t1->is_finite() && t2->is_finite()) ) { if( phase->eqv(in1, in2) ) return add_id(); } // Either input is BOTTOM ==> the result is the local BOTTOM const Type *bot = bottom_type(); if( (t1 == bot) || (t2 == bot) || (t1 == Type::BOTTOM) || (t2 == Type::BOTTOM) ) return bot; return sub(t1,t2); // Local flavor of type subtraction }
//------------------------------ideal_reg-------------------------------------- uint ProjNode::ideal_reg() const { return bottom_type()->ideal_reg(); }
virtual const Type *Value( PhaseTransform *phase ) const { return bottom_type(); }