You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by va...@apache.org on 2007/03/14 14:33:57 UTC

svn commit: r518134 - in /harmony/enhanced/drlvm/trunk/vm: include/open/ jitrino/src/jet/ jitrino/src/shared/ port/include/

Author: varlax
Date: Wed Mar 14 06:33:56 2007
New Revision: 518134

URL: http://svn.apache.org/viewvc?view=rev&rev=518134
Log:
HARMONY-3380 [drlvm][winx64][jit] JET operates incorrectly with long values.
The regression test will follow shortly.

Modified:
    harmony/enhanced/drlvm/trunk/vm/include/open/types.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/arith_rt.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jdefs.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/XTimer.h
    harmony/enhanced/drlvm/trunk/vm/port/include/loggerstring.h
    harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/types.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/types.h?view=diff&rev=518134&r1=518133&r2=518134
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/types.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/types.h Wed Mar 14 06:33:56 2007
@@ -120,9 +120,17 @@
 #endif //!PLATFORM_POSIX
 
 /**
- * The integer datatype on the platform that can hold a pointer.
- * ? 02/7/25: addded <code>POINTER_SIZE_SINT</code>, since in some cases
- * a pointer-size integer has to be signed (for example, when specifying LIL offsets)
+ * printf format specifier for 64-bit integers
+ */
+#ifdef _WIN32
+#define FMT64 "I64"
+#else 
+#define FMT64 "ll"
+#endif
+
+
+/**
+ * The integer datatypes on the platform that can hold a pointer.
  */
  #ifdef POINTER64
 #define POINTER_SIZE_INT uint64

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/arith_rt.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/arith_rt.cpp?view=diff&rev=518134&r1=518133&r2=518134
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/arith_rt.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/arith_rt.cpp Wed Mar 14 06:33:56 2007
@@ -182,7 +182,7 @@
         return v1 >> (v2&0x3F);
         //  case OPCODE_IUSHR:  return ( v1 >= 0 ) ? v1 >> (v2&0x3F) : (v1 >> (v2&0x3F)) + (2L << ~(v2&0x3F));
     case OPCODE_IUSHR:
-        return ((unsigned long long)v1) >> (v2&0x3F);
+        return ((uint64)v1) >> (v2&0x3F);
     default:
         break;
     }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc.cpp?view=diff&rev=518134&r1=518133&r2=518134
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc.cpp Wed Mar 14 06:33:56 2007
@@ -371,9 +371,9 @@
                 mov(Opnd(i32, sp, cs.off(i)), val);
             }
             else {
-                int val = lo32((long)addr);
+                int val = lo32((jlong)(int_ptr)addr);
                 mov(Opnd(i32, sp, cs.off(i)), val);
-                val = hi32((long)addr);
+                val = hi32((jlong)(int_ptr)addr);
                 mov(Opnd(i32, sp, cs.off(i)+4), val);
             }
         }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc.h?view=diff&rev=518134&r1=518133&r2=518134
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc.h Wed Mar 14 06:33:56 2007
@@ -60,9 +60,9 @@
 class CallSig;
 class Encoder;
 /**
- * @brief A signed interger type, with the same size as a pointer.
+ * @brief A signed integer type, with the same size as a pointer.
  */
-typedef long int_ptr;
+typedef POINTER_SIZE_SINT int_ptr;
 
 /**
  * @brief A dynamically grown byte array.
@@ -535,9 +535,9 @@
      * The width of any_val is wide enough to fit any necessary value - 
      * a pointer, #dbl64 or #i64.
      */
-    Opnd(jtype jt, jlong any_val)
+    Opnd(jtype jt, int_ptr any_val)
     {
-        clear(); m_jt = jt; m_kind = opnd_imm; m_lval = (long)any_val;
+        clear(); m_jt = jt; m_kind = opnd_imm; m_lval = any_val;
     }
     
     /**
@@ -703,7 +703,7 @@
      * Returns long value for immediate operand, or 0 for 
      *        operands of other kinds.
      */
-    long   lval(void) const { return is_imm() ? m_lval : 0; }
+    int_ptr lval(void) const { return is_imm() ? m_lval : 0; }
     
     /**
      * Returns base register for memory operand, or ar_x for operands of 
@@ -772,7 +772,7 @@
         /**
          * Integer or long value of immediate operand.
          */
-        long        m_lval;
+        int_ptr     m_lval;
     };
     /**
      * Base register for memory operand.

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc_ia32.cpp?view=diff&rev=518134&r1=518133&r2=518134
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/enc_ia32.cpp Wed Mar 14 06:33:56 2007
@@ -135,7 +135,7 @@
             args.add(imm);
         }
         else if (op.jt() == jobj) {
-            EncoderBase::Operand imm(sz, (long)(void*)op.lval());
+            EncoderBase::Operand imm(sz, (int_ptr)(void*)op.lval());
             args.add(imm);
         }
         else {
@@ -192,7 +192,7 @@
     }
     else {
         assert(!is_f(op1.jt()));
-        EncoderBase::Operand imm(sz, (long)(void*)op1.lval());
+        EncoderBase::Operand imm(sz, (int_ptr)(void*)op1.lval());
         args.add(imm);
     }
 }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jdefs.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jdefs.h?view=diff&rev=518134&r1=518133&r2=518134
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jdefs.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/jdefs.h Wed Mar 14 06:33:56 2007
@@ -125,7 +125,7 @@
 /**
  * @brief Represents a Java's long aka 'signed int64'.
  */
-typedef long long   jlong;
+typedef int64   jlong;
 
 /**
  * @brief A maximum, positive value a #jlong can have.

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp?view=diff&rev=518134&r1=518133&r2=518134
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/trace.cpp Wed Mar 14 06:33:56 2007
@@ -294,7 +294,7 @@
                 snprintf(buf, sizeof(buf), "%d(0x%X)", s.ival(), s.ival());
             }
             else {
-                snprintf(buf, sizeof(buf), "%ld(0x%LX)", (long int)s.lval(), (long long)s.lval());
+                snprintf(buf, sizeof(buf), "%"FMT64"d(0x%"FMT64"X)", s.lval(), s.lval());
             }
         }
         str += buf;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/XTimer.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/XTimer.h?view=diff&rev=518134&r1=518133&r2=518134
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/XTimer.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/XTimer.h Wed Mar 14 06:33:56 2007
@@ -25,7 +25,7 @@
 #define _XTIMER_H_
 
 #include "Counter.h"
-#include "open/types.h" //typedef unsigned long long in64;
+#include "open/types.h"
 #include <vector>
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/port/include/loggerstring.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/loggerstring.h?view=diff&rev=518134&r1=518133&r2=518134
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/loggerstring.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/loggerstring.h Wed Mar 14 06:33:56 2007
@@ -25,13 +25,6 @@
 #include <iostream>
 #include "port_malloc.h"
 
-#ifdef PLATFORM_NT
-#define FMT64 "I64"
-#else // !PLATFORM_NT
-#define FMT64 "ll"
-#endif // !PLATFORM_NT
-
-
 using std::string;
 
 class LoggerString {

Modified: harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h?view=diff&rev=518134&r1=518133&r2=518134
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h Wed Mar 14 06:33:56 2007
@@ -24,12 +24,6 @@
 #include <vector>
 #include "port_malloc.h"
 
-#ifdef PLATFORM_NT
-#define FMT64 "I64"
-#else // !PLATFORM_NT
-#define FMT64 "ll"
-#endif // !PLATFORM_NT
-
 using std::string;
 using std::vector;