aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/opto
diff options
context:
space:
mode:
authorvlivanov <none@none>2012-10-08 13:02:13 -0700
committervlivanov <none@none>2012-10-08 13:02:13 -0700
commitefa99f2958f833a3a9dc2d04a66ce28f6ecb071d (patch)
tree7ab1ec7544e112057e03f69948c80db2ed3b2c31 /src/share/vm/opto
parent635e58df86f55c0732ad10f53737245bc2feb8f0 (diff)
8000313: C2 should use jlong for 64bit values
Summary: Replace all occurrences of long with jlong in C2 code. Reviewed-by: kvn, twisti
Diffstat (limited to 'src/share/vm/opto')
-rw-r--r--src/share/vm/opto/graphKit.cpp2
-rw-r--r--src/share/vm/opto/loopTransform.cpp12
-rw-r--r--src/share/vm/opto/loopnode.cpp32
-rw-r--r--src/share/vm/opto/phaseX.hpp4
4 files changed, 25 insertions, 25 deletions
diff --git a/src/share/vm/opto/graphKit.cpp b/src/share/vm/opto/graphKit.cpp
index 53130fd45..95d5357d7 100644
--- a/src/share/vm/opto/graphKit.cpp
+++ b/src/share/vm/opto/graphKit.cpp
@@ -1115,7 +1115,7 @@ Node* GraphKit::ConvI2L(Node* offset) {
// short-circuit a common case
jint offset_con = find_int_con(offset, Type::OffsetBot);
if (offset_con != Type::OffsetBot) {
- return longcon((long) offset_con);
+ return longcon((jlong) offset_con);
}
return _gvn.transform( new (C) ConvI2LNode(offset));
}
diff --git a/src/share/vm/opto/loopTransform.cpp b/src/share/vm/opto/loopTransform.cpp
index ba6a86569..207ccbbb0 100644
--- a/src/share/vm/opto/loopTransform.cpp
+++ b/src/share/vm/opto/loopTransform.cpp
@@ -92,10 +92,10 @@ void IdealLoopTree::compute_exact_trip_count( PhaseIdealLoop *phase ) {
limit_n != NULL && limit_n->is_Con()) {
// Use longs to avoid integer overflow.
int stride_con = cl->stride_con();
- long init_con = cl->init_trip()->get_int();
- long limit_con = cl->limit()->get_int();
+ jlong init_con = cl->init_trip()->get_int();
+ jlong limit_con = cl->limit()->get_int();
int stride_m = stride_con - (stride_con > 0 ? 1 : -1);
- long trip_count = (limit_con - init_con + stride_m)/stride_con;
+ jlong trip_count = (limit_con - init_con + stride_m)/stride_con;
if (trip_count > 0 && (julong)trip_count < (julong)max_juint) {
// Set exact trip count.
cl->set_exact_trip_count((uint)trip_count);
@@ -1212,16 +1212,16 @@ void PhaseIdealLoop::do_unroll( IdealLoopTree *loop, Node_List &old_new, bool ad
} else if (loop_head->has_exact_trip_count() && init->is_Con()) {
// Loop's limit is constant. Loop's init could be constant when pre-loop
// become peeled iteration.
- long init_con = init->get_int();
+ jlong init_con = init->get_int();
// We can keep old loop limit if iterations count stays the same:
// old_trip_count == new_trip_count * 2
// Note: since old_trip_count >= 2 then new_trip_count >= 1
// so we also don't need to adjust zero trip test.
- long limit_con = limit->get_int();
+ jlong limit_con = limit->get_int();
// (stride_con*2) not overflow since stride_con <= 8.
int new_stride_con = stride_con * 2;
int stride_m = new_stride_con - (stride_con > 0 ? 1 : -1);
- long trip_count = (limit_con - init_con + stride_m)/new_stride_con;
+ jlong trip_count = (limit_con - init_con + stride_m)/new_stride_con;
// New trip count should satisfy next conditions.
assert(trip_count > 0 && (julong)trip_count < (julong)max_juint/2, "sanity");
uint new_trip_count = (uint)trip_count;
diff --git a/src/share/vm/opto/loopnode.cpp b/src/share/vm/opto/loopnode.cpp
index 631e39a70..a483f0180 100644
--- a/src/share/vm/opto/loopnode.cpp
+++ b/src/share/vm/opto/loopnode.cpp
@@ -328,12 +328,12 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) {
const TypeInt* limit_t = gvn->type(limit)->is_int();
if (stride_con > 0) {
- long init_p = (long)init_t->_lo + stride_con;
- if (init_p > (long)max_jint || init_p > (long)limit_t->_hi)
+ jlong init_p = (jlong)init_t->_lo + stride_con;
+ if (init_p > (jlong)max_jint || init_p > (jlong)limit_t->_hi)
return false; // cyclic loop or this loop trips only once
} else {
- long init_p = (long)init_t->_hi + stride_con;
- if (init_p < (long)min_jint || init_p < (long)limit_t->_lo)
+ jlong init_p = (jlong)init_t->_hi + stride_con;
+ if (init_p < (jlong)min_jint || init_p < (jlong)limit_t->_lo)
return false; // cyclic loop or this loop trips only once
}
@@ -716,16 +716,16 @@ Node* PhaseIdealLoop::exact_limit( IdealLoopTree *loop ) {
#endif
if (cl->has_exact_trip_count()) {
// Simple case: loop has constant boundaries.
- // Use longs to avoid integer overflow.
+ // Use jlongs to avoid integer overflow.
int stride_con = cl->stride_con();
- long init_con = cl->init_trip()->get_int();
- long limit_con = cl->limit()->get_int();
+ jlong init_con = cl->init_trip()->get_int();
+ jlong limit_con = cl->limit()->get_int();
julong trip_cnt = cl->trip_count();
- long final_con = init_con + trip_cnt*stride_con;
+ jlong final_con = init_con + trip_cnt*stride_con;
int final_int = (int)final_con;
// The final value should be in integer range since the loop
// is counted and the limit was checked for overflow.
- assert(final_con == (long)final_int, "final value should be integer");
+ assert(final_con == (jlong)final_int, "final value should be integer");
limit = _igvn.intcon(final_int);
} else {
// Create new LoopLimit node to get exact limit (final iv value).
@@ -790,16 +790,16 @@ const Type *LoopLimitNode::Value( PhaseTransform *phase ) const {
return NULL; // Identity
if (init_t->is_int()->is_con() && limit_t->is_int()->is_con()) {
- // Use longs to avoid integer overflow.
- long init_con = init_t->is_int()->get_con();
- long limit_con = limit_t->is_int()->get_con();
+ // Use jlongs to avoid integer overflow.
+ jlong init_con = init_t->is_int()->get_con();
+ jlong limit_con = limit_t->is_int()->get_con();
int stride_m = stride_con - (stride_con > 0 ? 1 : -1);
- long trip_count = (limit_con - init_con + stride_m)/stride_con;
- long final_con = init_con + stride_con*trip_count;
+ jlong trip_count = (limit_con - init_con + stride_m)/stride_con;
+ jlong final_con = init_con + stride_con*trip_count;
int final_int = (int)final_con;
// The final value should be in integer range since the loop
// is counted and the limit was checked for overflow.
- assert(final_con == (long)final_int, "final value should be integer");
+ assert(final_con == (jlong)final_int, "final value should be integer");
return TypeInt::make(final_int);
}
@@ -829,7 +829,7 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) {
const TypeInt* init_t = phase->type(in(Init) )->is_int();
const TypeInt* limit_t = phase->type(in(Limit))->is_int();
int stride_p;
- long lim, ini;
+ jlong lim, ini;
julong max;
if (stride_con > 0) {
stride_p = stride_con;
diff --git a/src/share/vm/opto/phaseX.hpp b/src/share/vm/opto/phaseX.hpp
index 8068e6d54..9338a28d7 100644
--- a/src/share/vm/opto/phaseX.hpp
+++ b/src/share/vm/opto/phaseX.hpp
@@ -497,8 +497,8 @@ public:
#ifndef PRODUCT
protected:
// Sub-quadratic implementation of VerifyIterativeGVN.
- unsigned long _verify_counter;
- unsigned long _verify_full_passes;
+ julong _verify_counter;
+ julong _verify_full_passes;
enum { _verify_window_size = 30 };
Node* _verify_window[_verify_window_size];
void verify_step(Node* n);