changeset 537:52e05f49560a cacao

2007-12-18 Gary Benson <gbenson@redhat.com> * contrib/templater/*: Wrap all PPC-specifics with conditionals. * ports/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp: Regenerated from templater (whitespace changes only). * ports/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp: Likewise. * ports/hotspot/src/cpu/ppc/vm/frame_ppc.hpp: Likewise. * ports/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp: Likewise. * ports/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp: Likewise. * ports/hotspot/src/cpu/ppc/vm/stubRoutines_ppc.hpp: Likewise. * ports/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp: Likewise.
author Gary Benson <gbenson@redhat.com>
date Tue, 18 Dec 2007 05:12:22 -0500
parents 2109ddb8dc92
children 5e6b21015b29
files ChangeLog contrib/templater/generate.py contrib/templater/hotspot/src/cpu/CPU/vm/assembler_CPU.cpp contrib/templater/hotspot/src/cpu/CPU/vm/assembler_CPU.hpp contrib/templater/hotspot/src/cpu/CPU/vm/bytecodeInterpreter_CPU.inline.hpp contrib/templater/hotspot/src/cpu/CPU/vm/bytes_CPU.hpp contrib/templater/hotspot/src/cpu/CPU/vm/cppInterpreterGenerator_CPU.hpp contrib/templater/hotspot/src/cpu/CPU/vm/cppInterpreter_CPU.cpp contrib/templater/hotspot/src/cpu/CPU/vm/disassembler_CPU.cpp contrib/templater/hotspot/src/cpu/CPU/vm/frame_CPU.cpp contrib/templater/hotspot/src/cpu/CPU/vm/frame_CPU.hpp contrib/templater/hotspot/src/cpu/CPU/vm/frame_CPU.inline.hpp contrib/templater/hotspot/src/cpu/CPU/vm/globalDefinitions_CPU.hpp contrib/templater/hotspot/src/cpu/CPU/vm/interp_masm_CPU.cpp contrib/templater/hotspot/src/cpu/CPU/vm/interp_masm_CPU.hpp contrib/templater/hotspot/src/cpu/CPU/vm/interpreterRT_CPU.cpp contrib/templater/hotspot/src/cpu/CPU/vm/interpreterRT_CPU.hpp contrib/templater/hotspot/src/cpu/CPU/vm/interpreter_CPU.cpp contrib/templater/hotspot/src/cpu/CPU/vm/registerMap_CPU.hpp contrib/templater/hotspot/src/cpu/CPU/vm/register_CPU.cpp contrib/templater/hotspot/src/cpu/CPU/vm/register_CPU.hpp contrib/templater/hotspot/src/cpu/CPU/vm/register_definitions_CPU.cpp contrib/templater/hotspot/src/cpu/CPU/vm/relocInfo_CPU.hpp contrib/templater/hotspot/src/cpu/CPU/vm/sharedRuntime_CPU.cpp contrib/templater/hotspot/src/cpu/CPU/vm/stubGenerator_CPU.cpp contrib/templater/hotspot/src/cpu/CPU/vm/stubRoutines_CPU.hpp contrib/templater/hotspot/src/os_cpu/linux_CPU/vm/assembler_linux_CPU.cpp contrib/templater/hotspot/src/os_cpu/linux_CPU/vm/atomic_linux_CPU.inline.hpp contrib/templater/hotspot/src/os_cpu/linux_CPU/vm/os_linux_CPU.cpp ports/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp ports/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp ports/hotspot/src/cpu/ppc/vm/frame_ppc.hpp ports/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp ports/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp ports/hotspot/src/cpu/ppc/vm/stubRoutines_ppc.hpp ports/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
diffstat 36 files changed, 228 insertions(+), 82 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Dec 18 04:59:22 2007 -0500
+++ b/ChangeLog	Tue Dec 18 05:12:22 2007 -0500
@@ -1,3 +1,16 @@
+2007-12-18  Gary Benson  <gbenson@redhat.com>
+
+	* contrib/templater/*: Wrap all PPC-specifics with conditionals.
+
+	* ports/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp:
+	Regenerated from templater (whitespace changes only).
+	* ports/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp: Likewise.
+	* ports/hotspot/src/cpu/ppc/vm/frame_ppc.hpp: Likewise.
+	* ports/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp: Likewise.
+	* ports/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp: Likewise.
+	* ports/hotspot/src/cpu/ppc/vm/stubRoutines_ppc.hpp: Likewise.
+	* ports/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp: Likewise.
+
 2007-12-18  Gary Benson  <gbenson@redhat.com>
 
 	* ports/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
--- a/contrib/templater/generate.py	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/generate.py	Tue Dec 18 05:12:22 2007 -0500
@@ -40,12 +40,12 @@
     while src:
         thing = things.match(src)
         if not thing:
-            if mode[-1] != COND_FALSE:
+            if COND_FALSE not in mode:
                 dst += src
             break
         before, thing, src = thing.groups()
         src = thing + src
-        if mode[-1] != COND_FALSE:
+        if COND_FALSE not in mode:
             dst += before
         end = ends.get(thing, "\n")
         index = src.find(end)
@@ -54,7 +54,7 @@
         thing = src[:index]
         src = src[index:]
         if not thing.startswith("#"):
-            if mode[-1] != COND_FALSE:
+            if COND_FALSE not in mode:
                 dst += thing
             continue
         args = thing.strip().split()
@@ -63,7 +63,7 @@
             cmd += args.pop(0)
 
         if cmd in ("#include", "#define", "#undef"):
-            if mode[-1] != COND_FALSE:
+            if COND_FALSE not in mode:
                 dst += thing
         elif cmd in ("#ifdef", "#ifndef"):
             us, them = {
@@ -76,7 +76,8 @@
                 mode.append(them)
             else:
                 mode.append(COPY)
-                dst += thing
+                if COND_FALSE not in mode:
+                    dst += thing
         elif cmd == "#if":
             for check in [cpu] + other_cpus:
                 assert "defined(%s)" % check not in args
@@ -88,9 +89,10 @@
             elif mode[-1] == COND_FALSE:
                 mode[-1] = COND_TRUE
             else:
-                dst += thing
+                if COND_FALSE not in mode:
+                    dst += thing
         elif cmd == "#endif":
-            if mode[-1] == COPY:
+            if mode[-1] == COPY and COND_FALSE not in mode:
                 dst += thing
             mode.pop()
         else:
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/assembler_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/assembler_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -648,16 +648,16 @@
     Unimplemented();
   }
 }
+#endif // PPC
 
-#endif // PPC
 #ifndef PRODUCT
 void Assembler::pd_print_patched_instruction(address branch)
 {
   Unimplemented();
 }
 #endif // PRODUCT
+
 #ifdef PPC
-
 // 32-bit ABI:
 //
 //     | ...                  |
@@ -1406,8 +1406,6 @@
     CAST_FROM_FN_PTR(address, report_untested), file, line, message);
 }
 
-#endif // PPC
-
 address MacroAssembler::generate_unimplemented_stub(const char* file, int line)
 {
   address start = enter();
@@ -1470,3 +1468,9 @@
   epilog(frame);
 }
 #endif // PRODUCT
+
+#endif // PPC
+void MacroAssembler::bang_stack_with_offset(int offset)
+{
+  Unimplemented();
+}
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/assembler_CPU.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/assembler_CPU.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -25,13 +25,12 @@
 
 // The definitions needed for @@cpu@@ assembly code generation.
 
+#ifdef PPC
 // Non-volatile registers used by the interpreter
 
-#ifdef PPC
 REGISTER_DECLARATION(Register, Rthread, r31);
 REGISTER_DECLARATION(Register, Rmethod, r30);
 REGISTER_DECLARATION(Register, Rlocals, r29);
-#endif // PPC
 
 
 // Address is an abstraction used to represent a memory location
@@ -62,6 +61,7 @@
 };
 
 
+#endif // PPC
 // The @@cpu@@ Assembler: Pure assembler doing NO optimizations on
 // the instruction level; i.e., what you write is what you get.
 // The Assembler is generating code into a CodeBuffer.
@@ -69,6 +69,7 @@
 class Assembler : public AbstractAssembler {
  public:
   Assembler(CodeBuffer* code) : AbstractAssembler(code) {}
+#ifdef PPC
 
  private:
   static bool is_simm(int x, int nbits)
@@ -82,7 +83,6 @@
     return is_simm(x, 16);
   }
 
-#ifdef PPC
  private:
   // Instruction emitters for the various forms.
   // Every instruction should ultimately come through one of these.
@@ -230,19 +230,19 @@
   void b(Label& l);
   void bc(int bo, int bi, Label& l);
   void bl(Label& l);
+#endif // PPC
 
   // Function to fix up forward branches
   void pd_patch_instruction(address branch, address target);
 #ifndef PRODUCT  
   static void pd_print_patched_instruction(address branch);
 #endif // PRODUCT
-#endif // PPC
 };
 
+#ifdef PPC
 
 // StackFrame is used to generate prologs and epilogs
 
-#ifdef PPC
 class StackFrame {
  private:
   int _params;
@@ -325,7 +325,6 @@
   int unaligned_size();
   int start_of_locals();
 };
-#endif // PPC
 
 
 // Flags for MacroAssembler::call_VM
@@ -337,12 +336,14 @@
 };
 
 
+#endif // PPC
 // MacroAssembler extends Assembler by frequently used macros.
 //
 // Instructions for which a 'better' code sequence exists depending
 // on arguments should also go in here.
 
 class MacroAssembler : public Assembler {
+#ifdef PPC
  protected:
   // Support for VM calls
   //
@@ -365,15 +366,16 @@
                          Register arg_2 = noreg,
                          Register arg_3 = noreg);
   
+#endif // PPC
  public:
   MacroAssembler(CodeBuffer* code) : Assembler(code) {}
 
   void align(int modulus);
+#ifdef PPC
 
   void prolog(StackFrame& frame) { frame.generate_prolog(this); }
   void epilog(StackFrame& frame) { frame.generate_epilog(this); }
 
-#ifdef PPC
   // Non-standard mnemonics
   void lbax(Register dst, Register a, Register b);
   void lhax(Register dst, Register a, Register b);
@@ -400,7 +402,6 @@
   void store_indexed(Register src, Register a, Register b);
   void store_update(Register src, const Address& dst);
   void store_update_indexed(Register src, Register a, Register b);
-#endif // PPC
 
   void cmpxchg_(Register exchange, Register dst, Register compare);
 
@@ -461,17 +462,20 @@
   void dump_int(const char* prefix, Register src);
 #endif // PRODUCT
 
-  void bang_stack_with_offset(int offset)
-  {
-    Unimplemented();
-  }
+#endif // PPC
+  void bang_stack_with_offset(int offset);
 };
 
 #ifdef ASSERT
-inline bool AbstractAssembler::pd_check_instruction_mark() { Unimplemented(); }
+inline bool AbstractAssembler::pd_check_instruction_mark()
+{
+  Unimplemented();
+}
 #endif
 
+#ifdef PPC
 #define UnimplementedStub() \
   (__ generate_unimplemented_stub(__FILE__, __LINE__))
 #define UnimplementedEntry() \
   (__ generate_unimplemented_entry(__FILE__, __LINE__))
+#endif // PPC
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/bytecodeInterpreter_CPU.inline.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/bytecodeInterpreter_CPU.inline.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -42,12 +42,9 @@
 }
 
 inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2], const uint32_t from[2]) {
-  // x86 can do unaligned copies but not 64bits at a time
-  to[0] = from[0]; to[1] = from[1];
+  *(uint64_t *) to = *(uint64_t *) from;
 }
 
-// The long operations depend on compiler support for "long long" on x86
-
 inline jlong BytecodeInterpreter::VMlongAdd(jlong op1, jlong op2) {
   return op1 + op2;
 }
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/bytes_CPU.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/bytes_CPU.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -25,12 +25,15 @@
 
 class Bytes: AllStatic {
  public:
-  // Returns true if the byte ordering used by Java is different from
-  // the native byte ordering of the underlying machine. For example,
-  // this is true for Intel x86, but false for Solaris on Sparc.
+  // Returns true if the byte ordering used by Java is different
+  // from the native byte ordering of the underlying machine.
   static inline bool is_Java_byte_ordering_different()
   {
-    return @@isLittleEndian(cpu) and "true" or "false"@@;
+#ifdef VM_LITTLE_ENDIAN
+    return true;
+#else
+    return false;
+#endif
   }
 
   // Efficient reading and writing of unaligned unsigned data in
@@ -132,9 +135,9 @@
 
 
   // Efficient reading and writing of unaligned unsigned data in Java
-  // byte ordering (i.e. big-endian ordering). @@
-(isLittleEndian(cpu) and """Byte-order reversal is
-  // needed since %s CPUs use little-endian format.
+  // byte ordering (i.e. big-endian ordering).
+#ifdef VM_LITTLE_ENDIAN
+  // Byte-order reversal is needed
   static inline u2 get_Java_u2(address p)
   {
     return swap_u2(get_native_u2(p)); 
@@ -164,8 +167,9 @@
   // Efficient swapping of byte ordering
   static inline u2 swap_u2(u2 x);
   static inline u4 swap_u4(u4 x);
-  static inline u8 swap_u8(u8 x);""" or """No byte-order reversal
-  // is needed since %s CPUs use big-endian format.
+  static inline u8 swap_u8(u8 x);
+#else
+  // No byte-order reversal is needed
   static inline u2 get_Java_u2(address p)
   {
     return get_native_u2(p);
@@ -195,10 +199,12 @@
   // No byte-order reversal is needed
   static inline u2 swap_u2(u2 x) { return x; }
   static inline u4 swap_u4(u4 x) { return x; }
-  static inline u8 swap_u8(u8 x) { return x; }""") % cpu@@
+  static inline u8 swap_u8(u8 x) { return x; }
+#endif // VM_LITTLE_ENDIAN
 };
-@@isLittleEndian(cpu) and """\
 
+#ifdef VM_LITTLE_ENDIAN
 // The following header contains the implementations of swap_u2,
 // swap_u4, and swap_u8
-#include "incls/_bytes_pd.inline.hpp.incl"""@@
+#include "incls/_bytes_pd.inline.hpp.incl"
+#endif // VM_LITTLE_ENDIAN
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/cppInterpreterGenerator_CPU.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/cppInterpreterGenerator_CPU.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -23,8 +23,10 @@
  *  
  */
 
+#ifdef PPC
   void generate_adjust_callers_stack();
   void generate_compute_interpreter_state(bool native); 
   void generate_more_monitors();
   void generate_convert_result(address* converter_array);
   void generate_unwind_interpreter_state();
+#endif // PPC
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/cppInterpreter_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/cppInterpreter_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -27,6 +27,7 @@
 #include "incls/_cppInterpreter_@@cpu@@.cpp.incl"
 
 #ifdef CC_INTERP
+#ifdef PPC
 
 // The address of this function is stored in the LR save area
 // while we are recursed in the frame manager/C++ interpreter.
@@ -61,6 +62,7 @@
 // Stuff for caching identical entries
 static address normal_entry = NULL;
 static address native_entry = NULL;
+#endif // PPC
 
 int AbstractInterpreter::BasicType_as_index(BasicType type)
 {
@@ -90,10 +92,15 @@
 
 bool CppInterpreter::contains(address pc)
 {
+#ifdef PPC
   return pc == CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation)
     || _code->contains(pc);
+#else
+  Unimplemented();
+#endif // PPC
 }
 
+#ifdef PPC
 // A result is the register or registers defined in the native ABI
 // for that type, unless it is an OOP in which case it will have
 // been unboxed and saved in the frame.  Preprocess it.
@@ -1288,6 +1295,7 @@
   __ load (r0, Address(r1, StackFrame::lr_save_offset * wordSize));
   __ mtlr (r0);  
 }
+#endif // PPC
 
 address AbstractInterpreterGenerator::generate_method_entry(
     AbstractInterpreter::MethodKind kind) {
@@ -1350,6 +1358,7 @@
 
 int AbstractInterpreter::size_top_interpreter_activation(methodOop method)
 {
+#ifdef PPC
   StackFrame frame;
 
   int call_stub_frame = round_to(
@@ -1365,6 +1374,9 @@
     sizeof(BytecodeInterpreter), StackAlignmentInBytes);
 
   return (call_stub_frame + interpreter_frame) / wordSize;
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 // Deoptimization helpers for C++ interpreter
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/disassembler_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/disassembler_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -27,6 +27,7 @@
 #include "incls/_disassembler_@@cpu@@.cpp.incl"
 
 #ifndef PRODUCT
+#ifdef PPC
 class InstructionParser {
  private:
   intptr_t _addr;
@@ -652,11 +653,16 @@
 
 // External interface
 
+#endif // PPC
 void Disassembler::decode(CodeBlob *cb, outputStream *st)
 {
+#ifdef PPC
   st = st ? st : tty;
   st->print_cr("Decoding CodeBlob " INTPTR_FORMAT, cb);
   decode(cb->instructions_begin(), cb->instructions_end(), st);
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 void Disassembler::decode(nmethod *nm, outputStream *st)
@@ -666,6 +672,7 @@
 
 void Disassembler::decode(u_char *begin, u_char *end, outputStream *st)
 {
+#ifdef PPC
   st = st ? st : tty;
   CodeBlob *cb = CodeCache::find_blob_unsafe(begin);
   for (u_char *addr = begin; addr < end; addr += 4) {
@@ -682,5 +689,8 @@
 
     st->cr();
   }
+#else
+  Unimplemented();
+#endif // PPC
 }
 #endif // PRODUCT
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/frame_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/frame_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -39,11 +39,16 @@
 
 bool frame::is_interpreted_frame() const
 {
+#ifdef PPC
   return Interpreter::contains(pc());
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 frame frame::sender_for_entry_frame(RegisterMap *map) const
 {
+#ifdef PPC
   assert(map != NULL, "map must be set");
   // Java frame called from C; skip all C frames and return top C
   // frame of that chunk as the sender
@@ -53,6 +58,9 @@
   map->clear(); 
   assert(map->include_argument_oops(), "should be set by clear");
   return frame(jfa->last_Java_sp(), jfa->last_Java_pc());
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 frame frame::sender_for_interpreter_frame(RegisterMap *map) const
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/frame_CPU.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/frame_CPU.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -23,19 +23,19 @@
  *  
  */
 
-// A frame represents a physical stack frame (an activation).  Frames
-// can be C or Java frames, and the Java frames can be interpreted or
-// compiled.  In contrast, vframes represent source-level activations,
-// so that one physical frame can correspond to multiple source level
-// frames because of inlining.  A frame is comprised of {pc, sp}
+  // A frame represents a physical stack frame (an activation).  Frames
+  // can be C or Java frames, and the Java frames can be interpreted or
+  // compiled.  In contrast, vframes represent source-level activations,
+  // so that one physical frame can correspond to multiple source level
+  // frames because of inlining.  A frame is comprised of {pc, sp}
 
+#ifdef PPC
  public:
   enum {
-#ifdef PPC
     pc_return_offset = 0
-#endif // PPC
   };
 
+#endif // PPC
  public:
   // Constructors
   frame(intptr_t* sp);
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/frame_CPU.inline.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/frame_CPU.inline.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -150,6 +150,8 @@
 {
 #ifdef PPC
   return -1;
+#else
+  Unimplemented();
 #endif // PPC
 }
 
@@ -160,13 +162,19 @@
 {
 #ifdef PPC
   return sp();
+#else
+  Unimplemented();
 #endif // PPC
 }
 
 inline JavaCallWrapper* frame::entry_frame_call_wrapper() const
 {
+#ifdef PPC
   assert(is_entry_frame(), "must be an entry frame");
   return *(JavaCallWrapper**) ((address) sender_sp() - call_wrapper_offset());
+#else
+  Unimplemented();
+#endif // PPC 
 }
 
 inline void frame::set_saved_oop_result(RegisterMap* map, oop obj)
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/globalDefinitions_CPU.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/globalDefinitions_CPU.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -23,4 +23,6 @@
  *
  */
 
+#ifdef PPC
 const int StackAlignmentInBytes = 16;
+#endif // PPC
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/interp_masm_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/interp_masm_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -26,6 +26,7 @@
 #include "incls/_precompiled.incl"
 #include "incls/_interp_masm_@@cpu@@.cpp.incl"
 
+#ifdef PPC
 #ifdef CC_INTERP
 REGISTER_DEFINITION(Register, Rstate);
 #endif
@@ -187,3 +188,4 @@
   Unimplemented();
 #endif
 }
+#endif // PPC
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/interp_masm_CPU.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/interp_masm_CPU.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -25,6 +25,7 @@
 
 // This file specializes the assember with interpreter-specific macros
 
+#ifdef PPC
 #ifdef CC_INTERP
 REGISTER_DECLARATION(Register, Rstate, r28);
 
@@ -32,7 +33,9 @@
   (Address(Rstate, byte_offset_of(BytecodeInterpreter, field_name)))
 #endif // CC_INTERP
 
+#endif // PPC
 class InterpreterMacroAssembler : public MacroAssembler {
+#ifdef PPC
  protected:
   // Support for VM calls
   virtual void call_VM_leaf_base(address entry_point);
@@ -40,8 +43,10 @@
                             address entry_point,
                             CallVMFlags flags);
 
+#endif // PPC
  public:
   InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {}
+#ifdef PPC
 
   // Frame anchor tracking
   void set_last_Java_frame(Register lr_save = noreg);
@@ -53,4 +58,5 @@
 
   // Safepoints
   void fixup_after_potential_safepoint();
+#endif // PPC
 };
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/interpreterRT_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/interpreterRT_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -32,6 +32,7 @@
 
 void InterpreterRuntime::SignatureHandlerGenerator::pass_int()
 {
+#ifdef PPC
   const Address src(Rlocals, Interpreter::local_offset_in_bytes(offset()));
 
   if (_gp_reg <= gp_reg_max) {
@@ -43,10 +44,14 @@
   else {
     pass_on_stack(src, T_INT);
   }
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 void InterpreterRuntime::SignatureHandlerGenerator::pass_long()
 {
+#ifdef PPC
 #ifdef PPC32
   const Address srch(Rlocals, Interpreter::local_offset_in_bytes(offset()));
   const Address srcl(Rlocals, Interpreter::local_offset_in_bytes(offset()+1));
@@ -71,10 +76,14 @@
     pass_on_stack(src, T_LONG);
   }
 #endif // PPC32
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 void InterpreterRuntime::SignatureHandlerGenerator::pass_float()
 {
+#ifdef PPC
   const Address src(Rlocals, Interpreter::local_offset_in_bytes(offset()));
 
   if (_fp_reg <= fp_reg_max) {
@@ -86,10 +95,14 @@
   else {
     pass_on_stack(src, T_FLOAT);
   }
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 void InterpreterRuntime::SignatureHandlerGenerator::pass_double()
 {
+#ifdef PPC
   const Address src(Rlocals, Interpreter::local_offset_in_bytes(offset() + 1));
 
   if (_fp_reg <= fp_reg_max) {
@@ -101,10 +114,14 @@
   else {
     pass_on_stack(src, T_DOUBLE);
   }
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 void InterpreterRuntime::SignatureHandlerGenerator::pass_object()
 {
+#ifdef PPC
   const Address src(Rlocals, Interpreter::local_offset_in_bytes(offset()));
 
   if (_gp_reg <= gp_reg_max) {
@@ -124,8 +141,12 @@
   else {
     pass_on_stack(src, T_OBJECT);
   }
+#else
+  Unimplemented();
+#endif // PPC
 }
 
+#ifdef PPC
 void InterpreterRuntime::SignatureHandlerGenerator::pass_on_stack(
   const Address& src, BasicType type)
 {
@@ -202,9 +223,11 @@
   }
 }
 
+#endif // PPC
 void InterpreterRuntime::SignatureHandlerGenerator::generate(
   uint64_t fingerprint) 
 {
+#ifdef PPC
   // Generate code to handle register arguments
   iterate(fingerprint);
 
@@ -239,7 +262,11 @@
   __ blr ();
 
   __ flush ();
+#else
+  Unimplemented();
+#endif // PPC
 }
+#ifdef PPC
 
 
 // Implementation of SlowSignatureHandler
@@ -348,6 +375,7 @@
   return Interpreter::result_handler(m->result_type());
 IRT_END
 
+#endif // PPC
 
 // Implementation of SignatureHandlerLibrary
 
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/interpreterRT_CPU.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/interpreterRT_CPU.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -25,6 +25,7 @@
 
 // native method calls
 
+#ifdef PPC
 class StackArgument
 {
  private:
@@ -52,7 +53,6 @@
   void pass();
 };
 
-#ifdef PPC
 enum {
   gp_reg_start = 4, // r3 contains the JNIEnv
   gp_reg_max   = 10,
@@ -63,10 +63,11 @@
   fp_reg_max   = 13
 #endif // PPC32
 };
+
 #endif // PPC
-
 class SignatureHandlerGenerator : public NativeSignatureIterator
 {
+#ifdef PPC
  private:
   MacroAssembler* _masm;
 
@@ -76,6 +77,7 @@
 
   GrowableArray<StackArgument>* _st_args;
 
+#endif // PPC
  private:
   void pass_int();
   void pass_long();
@@ -85,12 +87,13 @@
 
 #ifdef PPC
   void pass_on_stack(const Address& src, BasicType type);
+  
 #endif
-  
  public:
   SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) 
     : NativeSignatureIterator(method) 
   {
+#ifdef PPC
     _masm = new MacroAssembler(buffer);
 
     _gp_reg = gp_reg_start;
@@ -105,11 +108,15 @@
 #endif
 
     _st_args  = new GrowableArray<StackArgument>();
+#else
+    Unimplemented();
+#endif // PPC
   }
 
   void generate(uint64_t fingerprint);
 };
 
+#ifdef PPC
 class SlowSignatureHandler : public NativeSignatureIterator
 {
  private:
@@ -153,3 +160,4 @@
     _fp_reg_max = fp_regs + fp_reg_max - fp_reg_start;
   }
 };
+#endif // PPC
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/interpreter_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/interpreter_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -30,6 +30,7 @@
 
 address AbstractInterpreterGenerator::generate_slow_signature_handler()
 {
+#ifdef PPC
   address start = __ pc();
 
   const Address param_words_addr(
@@ -113,6 +114,9 @@
   __ blr ();
 
   return start;
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 address InterpreterGenerator::generate_math_entry(
@@ -121,6 +125,7 @@
   if (!InlineIntrinsics)
     return NULL;
 
+#ifdef PPC
   address start = __ pc();
 
   switch (kind) {
@@ -157,6 +162,9 @@
   }
 
   return start;
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 address InterpreterGenerator::generate_abstract_entry()
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/registerMap_CPU.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/registerMap_CPU.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -22,7 +22,7 @@
  *  
  */
 
-// machine-dependent implemention for register maps
+  // machine-dependent implemention for register maps
   friend class frame;
 
  private:
@@ -31,7 +31,7 @@
   // Since there is none, we just return NULL.
   // See registerMap_sparc.hpp for an example of grabbing registers
   // from register save areas of a standard layout.
-   address pd_location(VMReg reg) const {return NULL;}
+  address pd_location(VMReg reg) const {return NULL;}
 
   // no PD state to clear or copy:
   void pd_clear() {}
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/register_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/register_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -30,8 +30,8 @@
 const int ConcreteRegisterImpl::max_fpr =
   ConcreteRegisterImpl::max_gpr + FloatRegisterImpl::number_of_registers;
 
+const char* RegisterImpl::name() const {
 #ifdef PPC
-const char* RegisterImpl::name() const {
   const char* names[number_of_registers] = {
     "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",
     "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15",
@@ -39,9 +39,13 @@
     "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31"
   };
   return is_valid() ? names[encoding()] : "noreg";
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 const char* FloatRegisterImpl::name() const {
+#ifdef PPC
   const char* names[number_of_registers] = {
     "f0",  "f1",  "f2",  "f3",  "f4",  "f5",  "f6",  "f7",
     "f8",  "f9",  "f10", "f11", "f12", "f13", "f14", "f15",
@@ -49,5 +53,7 @@
     "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31"
   };
   return is_valid() ? names[encoding()] : "noreg";
+#else
+  Unimplemented();
+#endif // PPC
 }
-#endif // PPC
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/register_CPU.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/register_CPU.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -178,9 +178,7 @@
 CONSTANT_REGISTER_DECLARATION(FloatRegister, f29, (29));
 CONSTANT_REGISTER_DECLARATION(FloatRegister, f30, (30));
 CONSTANT_REGISTER_DECLARATION(FloatRegister, f31, (31));
-#endif // PPC
 
-#ifdef PPC
 // Use ConditionRegister as shortcut
 class ConditionRegisterImpl;
 typedef ConditionRegisterImpl* ConditionRegister;
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/register_definitions_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/register_definitions_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -26,9 +26,9 @@
 #include "incls/_precompiled.incl"
 #include "incls/_register_definitions_@@cpu@@.cpp.incl"
 
-#ifdef PPC
 REGISTER_DEFINITION(Register, noreg);
 
+#ifdef PPC
 REGISTER_DEFINITION(Register, r0);
 REGISTER_DEFINITION(Register, r1);
 REGISTER_DEFINITION(Register, r2);
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/relocInfo_CPU.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/relocInfo_CPU.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -27,8 +27,10 @@
  private:
   enum 
   {
+#ifdef PPC
 #ifdef XXX_EVIL_EVIL_EVIL
     offset_unit  =  1,
     format_width =  1
 #endif // XXX_EVIL_EVIL_EVIL
+#endif // PPC
   };
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/sharedRuntime_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/sharedRuntime_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -37,6 +37,7 @@
 
 #define __ masm->
 
+#ifdef PPC
 // Read the array of BasicTypes from a signature, and compute where
 // the arguments should go.  Values in the VMRegPair regs array refer
 // to 4-byte quantities.  XXX describe the mapping
@@ -47,6 +48,7 @@
 
 // XXX I'm not very confident I have all the set1/set2's and ++/+=2's right
 
+#endif // PPC
 int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
                                            VMRegPair *regs,
                                            int total_args_passed,
@@ -200,6 +202,7 @@
 							int line,
 							const char* name)
 {
+#ifdef PPC
   ResourceMark rm;
   CodeBuffer buffer(name, 1000, 512);
   MacroAssembler* masm = new MacroAssembler(&buffer);
@@ -215,11 +218,15 @@
   masm->flush();
   return RuntimeStub::new_runtime_stub(name, &buffer, frame_complete,
 				       frame_size_in_words, oop_maps, true);
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 static SafepointBlob* generate_unimplemented_safepoint_blob(const char* file,
 							    int line)
 {
+#ifdef PPC
   ResourceMark rm;
   CodeBuffer buffer("handler_blob", 2048, 1024);
   MacroAssembler* masm = new MacroAssembler(&buffer);
@@ -233,6 +240,9 @@
   __ blr();
   masm->flush();
   return SafepointBlob::create(&buffer, oop_maps, frame_size_in_words);
+#else
+  Unimplemented();
+#endif // PPC
 }
 
 void SharedRuntime::generate_stubs()
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/stubGenerator_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/stubGenerator_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -380,7 +380,6 @@
 #else
     return UnimplementedStub();
 #endif // PPC
-    
   }
 
   void generate_arraycopy_stubs()
--- a/contrib/templater/hotspot/src/cpu/CPU/vm/stubRoutines_CPU.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/cpu/CPU/vm/stubRoutines_CPU.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -23,14 +23,18 @@
  *  
  */
 
-// This file holds the platform specific parts of the StubRoutines
-// definition. See stubRoutines.hpp for a description on how to
-// extend it.
+  // This file holds the platform specific parts of the StubRoutines
+  // definition. See stubRoutines.hpp for a description on how to
+  // extend it.
 
  public:
   static bool returns_to_call_stub(address return_pc)
   {
+#ifdef PPC
     return return_pc == _call_stub_return_address;
+#else
+    Unimplemented();
+#endif // PPC
   }
 
   enum platform_dependent_constants 
--- a/contrib/templater/hotspot/src/os_cpu/linux_CPU/vm/assembler_linux_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/os_cpu/linux_CPU/vm/assembler_linux_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -26,7 +26,9 @@
 #include "incls/_precompiled.incl"
 #include "incls/_assembler_linux_@@cpu@@.cpp.incl"
 
+#ifdef PPC
 bool MacroAssembler::needs_explicit_null_check(intptr_t offset)
 {
   Unimplemented();
 }
+#endif // PPC
--- a/contrib/templater/hotspot/src/os_cpu/linux_CPU/vm/atomic_linux_CPU.inline.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/os_cpu/linux_CPU/vm/atomic_linux_CPU.inline.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -62,6 +62,8 @@
 {
 #ifdef PPC
   *dest = store_value;
+#else
+   Unimplemented(); 
 #endif
 }
 // inline void Atomic::store(jlong store_value, volatile jlong* dest)
--- a/contrib/templater/hotspot/src/os_cpu/linux_CPU/vm/os_linux_CPU.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/contrib/templater/hotspot/src/os_cpu/linux_CPU/vm/os_linux_CPU.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -23,7 +23,7 @@
  *  
  */
 
-// do not include  precompiled  header file
+// do not include precompiled header file
 #include "incls/_os_linux_@@cpu@@.cpp.incl"
 
 address os::current_stack_pointer()
@@ -293,23 +293,25 @@
 
 extern "C" {
 
-#ifndef PPC32
+#ifdef PPC
+#ifdef PPC64
   void _Copy_conjoint_jints_atomic(jint* from, jint* to, size_t count)
   {
     Unimplemented();
   }
-#endif // !PPC32
+#endif // PPC64
 
-#ifndef PPC64
+#ifdef PPC32
   void _Copy_conjoint_jlongs_atomic(jlong* from, jlong* to, size_t count)
   {
-#if defined(PPC32) && defined(XXX_EVIL_EVIL_EVIL)
+#ifdef XXX_EVIL_EVIL_EVIL
     _Copy_conjoint_jints_atomic((jint *) from, (jint *) to, count * 2);
 #else
     Unimplemented();
-#endif // PPC32 && XXX_EVIL_EVIL_EVIL
+#endif // XXX_EVIL_EVIL_EVIL
   }
-#endif // !PPC64
+#endif // PPC32
+#endif // PPC
 
   void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count)
   {
--- a/ports/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/ports/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -1403,7 +1403,6 @@
     CAST_FROM_FN_PTR(address, report_untested), file, line, message);
 }
 
-
 address MacroAssembler::generate_unimplemented_stub(const char* file, int line)
 {
   address start = enter();
--- a/ports/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/ports/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -455,7 +455,10 @@
 };
 
 #ifdef ASSERT
-inline bool AbstractAssembler::pd_check_instruction_mark() { Unimplemented(); }
+inline bool AbstractAssembler::pd_check_instruction_mark()
+{
+  Unimplemented();
+}
 #endif
 
 #define UnimplementedStub() \
--- a/ports/hotspot/src/cpu/ppc/vm/frame_ppc.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/ports/hotspot/src/cpu/ppc/vm/frame_ppc.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -23,11 +23,11 @@
  *
  */
 
-// A frame represents a physical stack frame (an activation).  Frames
-// can be C or Java frames, and the Java frames can be interpreted or
-// compiled.  In contrast, vframes represent source-level activations,
-// so that one physical frame can correspond to multiple source level
-// frames because of inlining.  A frame is comprised of {pc, sp}
+  // A frame represents a physical stack frame (an activation).  Frames
+  // can be C or Java frames, and the Java frames can be interpreted or
+  // compiled.  In contrast, vframes represent source-level activations,
+  // so that one physical frame can correspond to multiple source level
+  // frames because of inlining.  A frame is comprised of {pc, sp}
 
  public:
   enum {
--- a/ports/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/ports/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -22,7 +22,7 @@
  *
  */
 
-// machine-dependent implemention for register maps
+  // machine-dependent implemention for register maps
   friend class frame;
 
  private:
@@ -31,7 +31,7 @@
   // Since there is none, we just return NULL.
   // See registerMap_sparc.hpp for an example of grabbing registers
   // from register save areas of a standard layout.
-   address pd_location(VMReg reg) const {return NULL;}
+  address pd_location(VMReg reg) const {return NULL;}
 
   // no PD state to clear or copy:
   void pd_clear() {}
--- a/ports/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/ports/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -372,7 +372,6 @@
     __ blr ();
 
     return start;
-
   }
 
   void generate_arraycopy_stubs()
--- a/ports/hotspot/src/cpu/ppc/vm/stubRoutines_ppc.hpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/ports/hotspot/src/cpu/ppc/vm/stubRoutines_ppc.hpp	Tue Dec 18 05:12:22 2007 -0500
@@ -23,9 +23,9 @@
  *
  */
 
-// This file holds the platform specific parts of the StubRoutines
-// definition. See stubRoutines.hpp for a description on how to
-// extend it.
+  // This file holds the platform specific parts of the StubRoutines
+  // definition. See stubRoutines.hpp for a description on how to
+  // extend it.
 
  public:
   static bool returns_to_call_stub(address return_pc)
--- a/ports/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Tue Dec 18 04:59:22 2007 -0500
+++ b/ports/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp	Tue Dec 18 05:12:22 2007 -0500
@@ -23,7 +23,7 @@
  *
  */
 
-// do not include  precompiled  header file
+// do not include precompiled header file
 #include "incls/_os_linux_ppc.cpp.incl"
 
 address os::current_stack_pointer()