view patches/hotspot/original/icedtea-6791168.patch @ 1702:6cb729c4a876

Make the normal (non-Zero/Shark) HotSpot original build work. 2010-03-10 Andrew John Hughes <ahughes@redhat.com> Fix the normal (non-Zero/Shark) build with the original HotSpot. * Makefile.am: Move format-warnings, fortify-source, 6791168 and includedb patch to set applied to all HotSpots. Add bytecodeInterpreter XSL fix back for original HotSpot. * patches/hotspot/default/icedtea-explicit-target-arch.patch: Move HotSpot chunk to separate hs14-specific file. * patches/hotspot/original/icedtea-6791168.patch, * patches/hotspot/original/icedtea-explicit-target-arch.patch, * patches/hotspot/original/icedtea-includedb.patch: New variants for original HotSpot (hs11). * patches/hotspot/original/icedtea-shark.patch: Fixed to apply to original HotSpot. * patches/icedtea-bytecodeInterpreterWithChecks.patch: Readded, reverting part of Gary's patch of 2009-05-08. * patches/icedtea-explicit-target-arch.patch: Remove HotSpot chunk and specialise it in HotSpot subdirectories.
author Andrew John Hughes <ahughes@redhat.com>
date Thu, 11 Mar 2010 22:57:54 +0000
parents patches/hotspot/default/icedtea-6791168.patch@b858f5551ba7
children
line wrap: on
line source

diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/assembler_x86_32.cpp openjdk/hotspot/src/cpu/x86/vm/assembler_x86_32.cpp
--- openjdk.orig/hotspot/src/cpu/x86/vm/assembler_x86_32.cpp	2009-04-24 08:30:53.000000000 +0100
+++ openjdk/hotspot/src/cpu/x86/vm/assembler_x86_32.cpp	2010-03-11 18:15:32.000000000 +0000
@@ -3612,29 +3612,32 @@
 
   Label slow_case, done;
 
-  // x ?<= pi/4
-  fld_d(ExternalAddress((address)&pi_4));
-  fld_s(1);                // Stack:  X  PI/4  X
-  fabs();                  // Stack: |X| PI/4  X
-  fcmp(tmp);
-  jcc(Assembler::above, slow_case);
-    
-  // fastest case: -pi/4 <= x <= pi/4
-  switch(trig) {
-  case 's':
-    fsin();
-    break;
-  case 'c':
-    fcos();
-    break;
-  case 't':
-    ftan();
-    break;
-  default:
-    assert(false, "bad intrinsic");
-    break;
+  ExternalAddress pi4_adr = (address)&pi_4;
+  if (reachable(pi4_adr)) {
+    // x ?<= pi/4
+    fld_d(pi4_adr); // ExternalAddress((address)&pi_4));
+    fld_s(1);                // Stack:  X  PI/4  X
+    fabs();                  // Stack: |X| PI/4  X
+    fcmp(tmp);
+    jcc(Assembler::above, slow_case);
+
+    // fastest case: -pi/4 <= x <= pi/4
+    switch(trig) {
+    case 's':
+      fsin();
+      break;
+    case 'c':
+      fcos();
+      break;
+    case 't':
+      ftan();
+      break;
+    default:
+      assert(false, "bad intrinsic");
+      break;
+    }
+    jmp(done);
   }
-  jmp(done);
 
   // slow case: runtime call
   bind(slow_case);
diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp openjdk/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp
--- openjdk.orig/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp	2009-04-24 08:30:53.000000000 +0100
+++ openjdk/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp	2010-03-11 18:09:57.000000000 +0000
@@ -216,7 +216,7 @@
 
 inline jint BytecodeInterpreter::VMintDiv(jint op1, jint op2) {
   /* it's possible we could catch this special case implicitly */
-  if (op1 == 0x80000000 && op2 == -1) return op1;
+  if ((juint)op1 == 0x80000000 && op2 == -1) return op1;
   else return op1 / op2;
 }
 
@@ -234,7 +234,7 @@
 
 inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) {
   /* it's possible we could catch this special case implicitly */
-  if (op1 == 0x80000000 && op2 == -1) return 0;
+  if ((juint)op1 == 0x80000000 && op2 == -1) return 0;
   else return op1 % op2;
 }
 
diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp openjdk/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp
--- openjdk.orig/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp	2009-04-24 08:30:53.000000000 +0100
+++ openjdk/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp	2010-03-11 18:14:12.000000000 +0000
@@ -578,7 +578,7 @@
   __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), rax);
 
   // for c++ interpreter can rsi really be munged? 
-  __ leal(rsi, Address(rbp, -sizeof(BytecodeInterpreter)));                                // restore state
+  __ leal(rsi, Address(rbp, -(int)sizeof(BytecodeInterpreter)));                           // restore state
   __ movl(rbx, Address(rsi, byte_offset_of(BytecodeInterpreter, _method)));                // restore method
   __ movl(rdi, Address(rsi, byte_offset_of(BytecodeInterpreter, _locals)));                // get locals pointer
 
@@ -644,7 +644,7 @@
     const Address size_of_stack    (rbx, methodOopDesc::max_stack_offset());
     // Always give one monitor to allow us to start interp if sync method.
     // Any additional monitors need a check when moving the expression stack
-    const one_monitor = frame::interpreter_frame_monitor_size() * wordSize;
+    const int one_monitor = frame::interpreter_frame_monitor_size() * wordSize;
   __ load_unsigned_word(rax, size_of_stack);                            // get size of expression stack in words
   __ leal(rax, Address(noreg, rax, Interpreter::stackElementScale(), one_monitor));
   __ leal(rax, Address(rax, rdx, Interpreter::stackElementScale(), overhead_size));
@@ -1760,7 +1760,7 @@
   Label unwind_and_forward;
 
   // restore state pointer.
-  __ leal(state, Address(rbp,  -sizeof(BytecodeInterpreter)));
+  __ leal(state, Address(rbp,  -(int)sizeof(BytecodeInterpreter)));
 
   __ movl(rbx, STATE(_method));                       // get method
   __ movl(rcx, STATE(_thread));                       // get thread
@@ -1804,7 +1804,7 @@
 
   // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases
   if (UseSSE < 2) {
-    __ leal(state, Address(rbp,  -sizeof(BytecodeInterpreter)));
+    __ leal(state, Address(rbp,  -(int)sizeof(BytecodeInterpreter)));
     __ movl(rbx, STATE(_result._to_call._callee));                     // get method just executed 
     __ movl(rcx, Address(rbx, methodOopDesc::result_index_offset())); 
     __ cmpl(rcx, AbstractInterpreter::BasicType_as_index(T_FLOAT));    // Result stub address array index
@@ -1853,7 +1853,7 @@
 
   // Restore rsi as compiled code may not preserve it
 
-  __ leal(state, Address(rbp,  -sizeof(BytecodeInterpreter)));
+  __ leal(state, Address(rbp,  -(int)sizeof(BytecodeInterpreter)));
 
   // restore stack to what we had when we left (in case i2c extended it)
 
diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp openjdk/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp
--- openjdk.orig/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp	2009-04-24 08:30:53.000000000 +0100
+++ openjdk/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp	2010-03-11 18:09:57.000000000 +0000
@@ -137,7 +137,7 @@
 #ifdef CC_INTERP
 
 inline interpreterState frame::get_interpreterState() const {
-  return ((interpreterState)addr_at( -sizeof(BytecodeInterpreter)/wordSize ));
+  return ((interpreterState)addr_at( -((int)sizeof(BytecodeInterpreter))/wordSize ));
 }
 
 inline intptr_t*    frame::sender_sp()        const { 
diff -Nru openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp
--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	2010-03-11 18:00:58.000000000 +0000
+++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	2010-03-11 18:09:57.000000000 +0000
@@ -166,7 +166,7 @@
 #ifdef USELABELS
 // Have to do this dispatch this way in C++ because otherwise gcc complains about crossing an
 // initialization (which is is the initialization of the table pointer...)
-#define DISPATCH(opcode) goto *dispatch_table[opcode]
+#define DISPATCH(opcode) goto *(void*)dispatch_table[opcode]
 #define CONTINUE {                              \
         opcode = *pc;                           \
         DO_UPDATE_INSTRUCTION_COUNT(opcode);    \
@@ -344,7 +344,7 @@
  */
 #undef CHECK_NULL
 #define CHECK_NULL(obj_)                                                 \
-    if ((obj_) == 0) {                                                   \
+    if ((obj_) == NULL) {                                                \
         VM_JAVA_ERROR(vmSymbols::java_lang_NullPointerException(), "");  \
     }
 
@@ -1362,7 +1362,7 @@
 
 #define NULL_COMPARISON_NOT_OP(name)                                         \
       CASE(_if##name): {                                                     \
-          int skip = (!(STACK_OBJECT(-1) == 0))                              \
+          int skip = (!(STACK_OBJECT(-1) == NULL))                           \
                       ? (int16_t)Bytes::get_Java_u2(pc + 1) : 3;             \
           address branch_pc = pc;                                            \
           UPDATE_PC_AND_TOS(skip, -1);                                       \
@@ -1372,7 +1372,7 @@
 
 #define NULL_COMPARISON_OP(name)                                             \
       CASE(_if##name): {                                                     \
-          int skip = ((STACK_OBJECT(-1) == 0))                               \
+          int skip = ((STACK_OBJECT(-1) == NULL))                            \
                       ? (int16_t)Bytes::get_Java_u2(pc + 1) : 3;             \
           address branch_pc = pc;                                            \
           UPDATE_PC_AND_TOS(skip, -1);                                       \
diff -Nru openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp
--- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp	2010-03-11 18:00:57.000000000 +0000
+++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp	2010-03-11 18:09:57.000000000 +0000
@@ -68,7 +68,6 @@
 friend class InterpreterGenerator;
 friend class InterpreterMacroAssembler;
 friend class frame;
-friend class SharedRuntime;
 friend class VMStructs;
 
 public: