< prev index next >
src/share/vm/opto/subnode.cpp
Print this page
*** 44,54 ****
#include "math.h"
//=============================================================================
//------------------------------Identity---------------------------------------
// If right input is a constant 0, return the left input.
! Node *SubNode::Identity( PhaseTransform *phase ) {
assert(in(1) != this, "Must already have called Value");
assert(in(2) != this, "Must already have called Value");
// Remove double negation
const Type *zero = add_id();
--- 44,54 ----
#include "math.h"
//=============================================================================
//------------------------------Identity---------------------------------------
// If right input is a constant 0, return the left input.
! Node* SubNode::Identity(PhaseGVN* phase) {
assert(in(1) != this, "Must already have called Value");
assert(in(2) != this, "Must already have called Value");
// Remove double negation
const Type *zero = add_id();
*** 98,108 ****
return bottom_type();
return NULL;
}
! const Type* SubNode::Value(PhaseTransform *phase) const {
const Type* t = Value_common(phase);
if (t != NULL) {
return t;
}
const Type* t1 = phase->type(in(1));
--- 98,108 ----
return bottom_type();
return NULL;
}
! const Type* SubNode::Value(PhaseGVN* phase) const {
const Type* t = Value_common(phase);
if (t != NULL) {
return t;
}
const Type* t1 = phase->type(in(1));
*** 376,386 ****
}
//=============================================================================
//------------------------------Value------------------------------------------
// A subtract node differences its 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;
--- 376,386 ----
}
//=============================================================================
//------------------------------Value------------------------------------------
// A subtract node differences its two inputs.
! const Type* SubFPNode::Value(PhaseGVN* 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;
*** 492,502 ****
//=============================================================================
//------------------------------Idealize---------------------------------------
// Unlike SubNodes, compare must still flatten return value to the
// range -1, 0, 1.
// And optimizations like those for (X + Y) - X fail if overflow happens.
! Node *CmpNode::Identity( PhaseTransform *phase ) {
return this;
}
#ifndef PRODUCT
//----------------------------related------------------------------------------
--- 492,502 ----
//=============================================================================
//------------------------------Idealize---------------------------------------
// Unlike SubNodes, compare must still flatten return value to the
// range -1, 0, 1.
// And optimizations like those for (X + Y) - X fail if overflow happens.
! Node* CmpNode::Identity(PhaseGVN* phase) {
return this;
}
#ifndef PRODUCT
//----------------------------related------------------------------------------
*** 609,619 ****
if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && is_index_range_check())
return TypeInt::CC_LT;
return TypeInt::CC; // else use worst case results
}
! const Type* CmpUNode::Value(PhaseTransform *phase) const {
const Type* t = SubNode::Value_common(phase);
if (t != NULL) {
return t;
}
const Node* in1 = in(1);
--- 609,619 ----
if ((jint)lo0 >= 0 && (jint)lo1 >= 0 && is_index_range_check())
return TypeInt::CC_LT;
return TypeInt::CC; // else use worst case results
}
! const Type* CmpUNode::Value(PhaseGVN* phase) const {
const Type* t = SubNode::Value_common(phase);
if (t != NULL) {
return t;
}
const Node* in1 = in(1);
*** 1051,1061 ****
//=============================================================================
//------------------------------Value------------------------------------------
// Simplify an CmpF (compare 2 floats ) node, based on local information.
// If both inputs are constants, compare them.
! const Type *CmpFNode::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;
--- 1051,1061 ----
//=============================================================================
//------------------------------Value------------------------------------------
// Simplify an CmpF (compare 2 floats ) node, based on local information.
// If both inputs are constants, compare them.
! const Type* CmpFNode::Value(PhaseGVN* 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;
*** 1081,1091 ****
//=============================================================================
//------------------------------Value------------------------------------------
// Simplify an CmpD (compare 2 doubles ) node, based on local information.
// If both inputs are constants, compare them.
! const Type *CmpDNode::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;
--- 1081,1091 ----
//=============================================================================
//------------------------------Value------------------------------------------
// Simplify an CmpD (compare 2 doubles ) node, based on local information.
// If both inputs are constants, compare them.
! const Type* CmpDNode::Value(PhaseGVN* 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;
*** 1421,1431 ****
}
//------------------------------Value------------------------------------------
// Simplify a Bool (convert condition codes to boolean (1 or 0)) node,
// based on local information. If the input is constant, do it.
! const Type *BoolNode::Value( PhaseTransform *phase ) const {
return _test.cc2logical( phase->type( in(1) ) );
}
#ifndef PRODUCT
//------------------------------dump_spec--------------------------------------
--- 1421,1431 ----
}
//------------------------------Value------------------------------------------
// Simplify a Bool (convert condition codes to boolean (1 or 0)) node,
// based on local information. If the input is constant, do it.
! const Type* BoolNode::Value(PhaseGVN* phase) const {
return _test.cc2logical( phase->type( in(1) ) );
}
#ifndef PRODUCT
//------------------------------dump_spec--------------------------------------
*** 1464,1474 ****
}
//=============================================================================
//------------------------------Value------------------------------------------
// Compute sqrt
! const Type *SqrtDNode::Value( PhaseTransform *phase ) const {
const Type *t1 = phase->type( in(1) );
if( t1 == Type::TOP ) return Type::TOP;
if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
double d = t1->getd();
if( d < 0.0 ) return Type::DOUBLE;
--- 1464,1474 ----
}
//=============================================================================
//------------------------------Value------------------------------------------
// Compute sqrt
! const Type* SqrtDNode::Value(PhaseGVN* phase) const {
const Type *t1 = phase->type( in(1) );
if( t1 == Type::TOP ) return Type::TOP;
if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
double d = t1->getd();
if( d < 0.0 ) return Type::DOUBLE;
*** 1476,1497 ****
}
//=============================================================================
//------------------------------Value------------------------------------------
// Compute tan
! const Type *TanDNode::Value( PhaseTransform *phase ) const {
const Type *t1 = phase->type( in(1) );
if( t1 == Type::TOP ) return Type::TOP;
if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
double d = t1->getd();
return TypeD::make( StubRoutines::intrinsic_tan( d ) );
}
//=============================================================================
//------------------------------Value------------------------------------------
// Compute log10
! const Type *Log10DNode::Value( PhaseTransform *phase ) const {
const Type *t1 = phase->type( in(1) );
if( t1 == Type::TOP ) return Type::TOP;
if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
double d = t1->getd();
return TypeD::make( StubRoutines::intrinsic_log10( d ) );
--- 1476,1497 ----
}
//=============================================================================
//------------------------------Value------------------------------------------
// Compute tan
! const Type* TanDNode::Value(PhaseGVN* phase) const {
const Type *t1 = phase->type( in(1) );
if( t1 == Type::TOP ) return Type::TOP;
if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
double d = t1->getd();
return TypeD::make( StubRoutines::intrinsic_tan( d ) );
}
//=============================================================================
//------------------------------Value------------------------------------------
// Compute log10
! const Type* Log10DNode::Value(PhaseGVN* phase) const {
const Type *t1 = phase->type( in(1) );
if( t1 == Type::TOP ) return Type::TOP;
if( t1->base() != Type::DoubleCon ) return Type::DOUBLE;
double d = t1->getd();
return TypeD::make( StubRoutines::intrinsic_log10( d ) );
< prev index next >