changeset 8173:6d23f64f2fdb

Merge.
author Roland Schatz <roland.schatz@oracle.com>
date Fri, 08 Mar 2013 13:19:28 +0100
parents 5c9fc4f75b4c (current diff) da10229e5a33 (diff)
children 67d654d9ee9a
files src/share/vm/utilities/machineCodePrinter.cpp src/share/vm/utilities/machineCodePrinter.hpp
diffstat 94 files changed, 243 insertions(+), 1003 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/ComputeBlockOrder.java	Thu Mar 07 18:24:15 2013 +0100
+++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/ComputeBlockOrder.java	Fri Mar 08 13:19:28 2013 +0100
@@ -55,13 +55,6 @@
     private static final int INITIAL_WORKLIST_CAPACITY = 10;
 
     /**
-     * Divisor used for degrading the probability of the current path versus unscheduled paths at a
-     * merge node when calculating the linear scan order. A high value means that predecessors of
-     * merge nodes are more likely to be scheduled before the merge node.
-     */
-    private static final int PENALTY_VERSUS_UNSCHEDULED = 10;
-
-    /**
      * Computes the block order used for the linear scan register allocator.
      * 
      * @return sorted list of blocks
@@ -125,27 +118,7 @@
     private static void addPathToLinearScanOrder(Block block, List<Block> order, PriorityQueue<Block> worklist, BitSet visitedBlocks) {
         block.setLinearScanNumber(order.size());
         order.add(block);
-        Block mostLikelySuccessor = findAndMarkMostLikelySuccessor(block, visitedBlocks);
         enqueueSuccessors(block, worklist, visitedBlocks);
-        if (mostLikelySuccessor != null) {
-            if (!mostLikelySuccessor.isLoopHeader() && mostLikelySuccessor.getPredecessorCount() > 1) {
-                // We are at a merge. Check probabilities of predecessors that are not yet
-                // scheduled.
-                double unscheduledSum = 0.0;
-                for (Block pred : mostLikelySuccessor.getPredecessors()) {
-                    if (!visitedBlocks.get(pred.getId())) {
-                        unscheduledSum += pred.getBeginNode().probability();
-                    }
-                }
-
-                if (unscheduledSum > block.getProbability() / PENALTY_VERSUS_UNSCHEDULED) {
-                    // Add this merge only after at least one additional predecessor gets scheduled.
-                    visitedBlocks.clear(mostLikelySuccessor.getId());
-                    return;
-                }
-            }
-            addPathToLinearScanOrder(mostLikelySuccessor, order, worklist, visitedBlocks);
-        }
     }
 
     /**
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java	Thu Mar 07 18:24:15 2013 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java	Fri Mar 08 13:19:28 2013 +0100
@@ -68,13 +68,11 @@
 public abstract class GraalCompilerTest extends GraalTest {
 
     protected final GraalCodeCacheProvider runtime;
-    protected final GraalCompiler graalCompiler;
     protected final Backend backend;
 
     public GraalCompilerTest() {
         DebugEnvironment.initialize(System.out);
         this.runtime = Graal.getRequiredCapability(GraalCodeCacheProvider.class);
-        this.graalCompiler = Graal.getRequiredCapability(GraalCompiler.class);
         this.backend = Graal.getRequiredCapability(Backend.class);
     }
 
@@ -377,8 +375,7 @@
     }
 
     protected InstalledCode addMethod(final ResolvedJavaMethod method, final CompilationResult compResult) {
-        assert graalCompiler != null;
-        return Debug.scope("CodeInstall", new Object[]{graalCompiler, method}, new Callable<InstalledCode>() {
+        return Debug.scope("CodeInstall", new Object[]{runtime, method}, new Callable<InstalledCode>() {
 
             @Override
             public InstalledCode call() throws Exception {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Thu Mar 07 18:24:15 2013 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Fri Mar 08 13:19:28 2013 +0100
@@ -51,7 +51,7 @@
                     final StructuredGraph graph, final GraphCache cache, final PhasePlan plan, final OptimisticOptimizations optimisticOpts) {
         assert (method.getModifiers() & Modifier.NATIVE) == 0 : "compiling native methods is not supported";
 
-        return Debug.scope("GraalCompiler", new Object[]{graph, method}, new Callable<CompilationResult>() {
+        return Debug.scope("GraalCompiler", new Object[]{graph, method, runtime}, new Callable<CompilationResult>() {
 
             public CompilationResult call() {
                 final Assumptions assumptions = new Assumptions(GraalOptions.OptAssumptions);
--- a/graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/CompilationServer.java	Thu Mar 07 18:24:15 2013 +0100
+++ b/graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/CompilationServer.java	Fri Mar 08 13:19:28 2013 +0100
@@ -93,7 +93,6 @@
 
                 // return the initialized compiler to the client
                 HotSpotGraalRuntime compiler = initializeServer(toVM);
-                compiler.getCompiler();
                 streams.getInvocation().sendResult(compiler);
 
                 for (ConnectionObserver observer : observers) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Thu Mar 07 18:24:15 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Fri Mar 08 13:19:28 2013 +0100
@@ -177,7 +177,7 @@
     }
 
     private void installMethod(final CompilationResult tm) {
-        Debug.scope("CodeInstall", new Object[]{new DebugDumpScope(String.valueOf(id), true), graalRuntime.getCompiler(), method}, new Runnable() {
+        Debug.scope("CodeInstall", new Object[]{new DebugDumpScope(String.valueOf(id), true), graalRuntime.getRuntime(), method}, new Runnable() {
 
             @Override
             public void run() {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Thu Mar 07 18:24:15 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Fri Mar 08 13:19:28 2013 +0100
@@ -30,7 +30,6 @@
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.api.runtime.*;
-import com.oracle.graal.compiler.*;
 import com.oracle.graal.compiler.target.*;
 import com.oracle.graal.hotspot.bridge.*;
 import com.oracle.graal.hotspot.logging.*;
@@ -110,7 +109,6 @@
     protected/* final */VMToCompiler vmToCompiler;
 
     protected final HotSpotRuntime runtime;
-    protected final GraalCompiler compiler;
     protected final TargetDescription target;
 
     private HotSpotRuntimeInterpreterInterface runtimeInterpreterInterface;
@@ -143,7 +141,6 @@
 
         backend = createBackend();
         GraalOptions.StackShadowPages = config.stackShadowPages;
-        compiler = new GraalCompiler();
         if (GraalOptions.CacheGraphs) {
             cache = new HotSpotGraphCache();
         }
@@ -178,10 +175,6 @@
         return target;
     }
 
-    public GraalCompiler getCompiler() {
-        return compiler;
-    }
-
     public HotSpotGraphCache getCache() {
         return cache;
     }
@@ -267,9 +260,6 @@
         if (clazz == HotSpotRuntime.class) {
             return (T) runtime;
         }
-        if (clazz == GraalCompiler.class) {
-            return (T) getCompiler();
-        }
         if (clazz == Backend.class) {
             return (T) getBackend();
         }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Thu Mar 07 18:24:15 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Fri Mar 08 13:19:28 2013 +0100
@@ -361,8 +361,8 @@
 
         newInstanceStub = new NewInstanceStub(this, assumptions, graalRuntime.getTarget());
         newArrayStub = new NewArrayStub(this, assumptions, graalRuntime.getTarget());
-        newInstanceStub.install(backend, graalRuntime.getCompiler());
-        newArrayStub.install(backend, graalRuntime.getCompiler());
+        newInstanceStub.install(backend);
+        newArrayStub.install(backend);
     }
 
     public HotSpotGraalRuntime getGraalRuntime() {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java	Thu Mar 07 18:24:15 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java	Fri Mar 08 13:19:28 2013 +0100
@@ -70,8 +70,8 @@
     protected InstalledCode stubCode;
 
     /**
-     * Creates a new stub container. The new stub still needs to be
-     * {@linkplain #install(Backend, GraalCompiler) installed}.
+     * Creates a new stub container. The new stub still needs to be {@linkplain #install(Backend)
+     * installed}.
      * 
      * @param descriptor linkage details for a call to the stub
      */
@@ -107,7 +107,7 @@
      * Compiles the code for this stub, installs it and initializes the address used for calls to
      * it.
      */
-    public void install(Backend backend, GraalCompiler compiler) {
+    public void install(Backend backend) {
         StructuredGraph graph = (StructuredGraph) stubMethod.getCompilerStorage().get(Graph.class);
 
         Key key = new Key(stubMethod);
@@ -121,7 +121,7 @@
         final CompilationResult compResult = GraalCompiler.compileMethod(runtime(), backend, runtime().getTarget(), stubMethod, graph, null, phasePlan, OptimisticOptimizations.ALL);
 
         final CodeInfo[] info = new CodeInfo[1];
-        stubCode = Debug.scope("CodeInstall", new Object[]{compiler, stubMethod}, new Callable<InstalledCode>() {
+        stubCode = Debug.scope("CodeInstall", new Object[]{runtime(), stubMethod}, new Callable<InstalledCode>() {
 
             @Override
             public InstalledCode call() {
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java	Thu Mar 07 18:24:15 2013 +0100
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java	Fri Mar 08 13:19:28 2013 +0100
@@ -54,6 +54,7 @@
             dumpSandboxed(object, message);
         } catch (Throwable ex) {
             TTY.println("CFGPrinter: Exception during output of " + message + ": " + ex);
+            ex.printStackTrace();
         }
     }
 
@@ -115,18 +116,23 @@
             return;
         }
 
-        cfgPrinter.target = Debug.contextLookup(TargetDescription.class);
         if (object instanceof LIR) {
             cfgPrinter.lir = (LIR) object;
         } else {
             cfgPrinter.lir = Debug.contextLookup(LIR.class);
         }
         cfgPrinter.lirGenerator = Debug.contextLookup(LIRGenerator.class);
+        if (cfgPrinter.lirGenerator != null) {
+            cfgPrinter.target = cfgPrinter.lirGenerator.target();
+        }
         if (cfgPrinter.lir != null) {
             cfgPrinter.cfg = cfgPrinter.lir.cfg;
         }
 
         CodeCacheProvider runtime = Debug.contextLookup(CodeCacheProvider.class);
+        if (runtime != null) {
+            cfgPrinter.target = runtime.getTarget();
+        }
 
         if (object instanceof BciBlockMapping) {
             BciBlockMapping blockMap = (BciBlockMapping) object;
--- a/src/cpu/sparc/vm/frame_sparc.inline.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/cpu/sparc/vm/frame_sparc.inline.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -74,8 +74,7 @@
 
 // return address:
 
-inline address* frame::sender_pc_addr()   const { return (address*) (I7_addr() + pc_return_offset); }
-inline address  frame::sender_pc()        const { return *sender_pc_addr(); }
+inline address  frame::sender_pc()        const    { return *I7_addr() + pc_return_offset; }
 
 inline address* frame::I7_addr() const  { return (address*) &sp()[ I7->sp_offset_in_saved_window()]; }
 inline address* frame::I0_addr() const  { return (address*) &sp()[ I0->sp_offset_in_saved_window()]; }
--- a/src/cpu/sparc/vm/jniTypes_sparc.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/cpu/sparc/vm/jniTypes_sparc.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -112,25 +112,6 @@
                                                           return *(jdouble *)&jl; }
 #endif
 
-  static inline jint    get_int   (intptr_t *from, int& pos) {
-    return get_int(from + pos++);
-  }
-  static inline jlong   get_long  (intptr_t *from, int& pos) {
-    jlong result = get_long(from + pos);
-    pos += 2;
-    return result;
-  }
-  static inline oop     get_obj   (intptr_t *from, int& pos) {
-    return get_obj(from + pos++);
-  }
-  static inline jfloat  get_float (intptr_t *from, int& pos) {
-    return get_float(from + pos++);
-  }
-  static inline jdouble get_double(intptr_t *from, int& pos) {
-    jdouble result = get_double(from + pos);
-    pos += 2;
-    return result;
-  }
 };
 
 #endif // CPU_SPARC_VM_JNITYPES_SPARC_HPP
--- a/src/cpu/x86/vm/frame_x86.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/cpu/x86/vm/frame_x86.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -308,11 +308,6 @@
   ptr_at_put(interpreter_frame_sender_sp_offset, (intptr_t) sender_sp);
 }
 
-intptr_t** frame::interpreter_frame_sender_sp_addr() const {
-  assert(is_interpreted_frame(), "interpreted frame expected");
-  return (intptr_t**) addr_at(interpreter_frame_sender_sp_offset);
-}
-
 
 // monitor elements
 
--- a/src/cpu/x86/vm/frame_x86.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/cpu/x86/vm/frame_x86.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -191,12 +191,13 @@
   // Note: not necessarily the real 'frame pointer' (see real_fp)
   intptr_t*   fp() const { return _fp; }
 
+  inline address* sender_pc_addr() const;
+
   // return address of param, zero origin index.
   inline address* native_param_addr(int idx) const;
 
   // expression stack tos if we are nested in a java call
   intptr_t* interpreter_frame_last_sp() const;
-  intptr_t** interpreter_frame_last_sp_addr() const;
 
   // helper to update a map with callee-saved RBP
   static void update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr);
--- a/src/cpu/x86/vm/frame_x86.inline.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/cpu/x86/vm/frame_x86.inline.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -133,9 +133,8 @@
 
 
 
-inline intptr_t*  frame::link() const              { return (intptr_t*) *(intptr_t **)addr_at(link_offset); }
-inline intptr_t** frame::link_addr() const         { return (intptr_t **)addr_at(link_offset); }
-inline void       frame::set_link(intptr_t* addr)  { *(intptr_t **)addr_at(link_offset) = addr; }
+inline intptr_t* frame::link() const              { return (intptr_t*) *(intptr_t **)addr_at(link_offset); }
+inline void      frame::set_link(intptr_t* addr)  { *(intptr_t **)addr_at(link_offset) = addr; }
 
 
 inline intptr_t* frame::unextended_sp() const     { return _unextended_sp; }
@@ -211,10 +210,6 @@
   return *(intptr_t**)addr_at(interpreter_frame_last_sp_offset);
 }
 
-inline intptr_t** frame::interpreter_frame_last_sp_addr() const {
-  return (intptr_t**)addr_at(interpreter_frame_last_sp_offset);
-}
-
 inline intptr_t* frame::interpreter_frame_bcx_addr() const {
   return (intptr_t*)addr_at(interpreter_frame_bcx_offset);
 }
--- a/src/cpu/x86/vm/jniTypes_x86.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/cpu/x86/vm/jniTypes_x86.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -127,26 +127,6 @@
   static inline oop     get_obj   (intptr_t *from) { return *(oop *)    from; }
   static inline jfloat  get_float (intptr_t *from) { return *(jfloat *) from; }
   static inline jdouble get_double(intptr_t *from) { return *(jdouble *)(from + _JNI_SLOT_OFFSET); }
-
-  static inline jint    get_int   (intptr_t *from, int& pos) {
-    return get_int(from + pos++);
-  }
-  static inline jlong   get_long  (intptr_t *from, int& pos) {
-    jlong result = get_long(from + pos);
-    pos += 2;
-    return result;
-  }
-  static inline oop     get_obj   (intptr_t *from, int& pos) {
-    return get_obj(from + pos++);
-  }
-  static inline jfloat  get_float (intptr_t *from, int& pos) {
-    return get_float(from + pos++);
-  }
-  static inline jdouble get_double(intptr_t *from, int& pos) {
-    jdouble result = get_double(from + pos);
-    pos += 2;
-    return result;
-  }
 #undef _JNI_SLOT_OFFSET
 };
 
--- a/src/cpu/x86/vm/nativeInst_x86.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/cpu/x86/vm/nativeInst_x86.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -578,10 +578,8 @@
     // Graal may allocate an arbitrary register for storing the polling address.
     return true;
 #else
-    if (ubyte_at(0) == Assembler::REX_WR && ubyte_at(1) == NativeMovRegMem::instruction_code_mem2reg && ubyte_at(2) == 0x15) { // mov r10, rip[...]
-      address fault = addr_at(7) + int_at(3);
-      return os::is_poll_address(fault);
-    } else if (ubyte_at(0) == NativeTstRegMem::instruction_code_memXregl && ubyte_at(1) == 0x05) { // 00 rax 101
+    if (ubyte_at(0) == NativeTstRegMem::instruction_code_memXregl &&
+        ubyte_at(1) == 0x05) { // 00 rax 101
       address fault = addr_at(6) + int_at(2);
       return os::is_poll_address(fault);
     } else {
--- a/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -1763,8 +1763,7 @@
 
   int vep_offset = ((intptr_t)__ pc()) - start;
 
-#if defined(COMPILER1) || defined(GRAAL)
-
+#ifdef COMPILER1
   if (InlineObjectHash && method->intrinsic_id() == vmIntrinsics::_hashCode) {
     // Object.hashCode can pull the hashCode from the header word
     // instead of doing a full VM transition once it's been computed.
@@ -1793,7 +1792,7 @@
     __ ret(0);
     __ bind (slowCase);
   }
-#endif // COMPILER1 || GRAAL
+#endif // COMPILER1
 
   // The instruction at the verified entry point must be 5 bytes or longer
   // because it can be patched on the fly by make_non_entrant. The stack bang
--- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -1996,50 +1996,6 @@
 
   int vep_offset = ((intptr_t)__ pc()) - start;
 
-#ifdef GRAALVM
-  if (InlineObjectHash && (method->intrinsic_id() == vmIntrinsics::_hashCode || method->intrinsic_id() == vmIntrinsics::_identityHashCode)) {
-    // Object.hashCode can pull the hashCode from the header word
-    // instead of doing a full VM transition once it's been computed.
-    // Since hashCode is usually polymorphic at call sites we can't do
-    // this optimization at the call site without a lot of work.
-    Label slowCase;
-    Label nullCase;
-    Register result = rax;
-
-    if (method->intrinsic_id() == vmIntrinsics::_identityHashCode) {
-      __ cmpptr(receiver, 0);
-      __ jcc(Assembler::equal, nullCase);
-    }
-
-    __ movptr(result, Address(receiver, oopDesc::mark_offset_in_bytes()));
-
-    // check if locked
-    __ testptr(result, markOopDesc::unlocked_value);
-    __ jcc (Assembler::zero, slowCase);
-
-    if (UseBiasedLocking) {
-      // Check if biased and fall through to runtime if so
-      __ testptr(result, markOopDesc::biased_lock_bit_in_place);
-      __ jcc (Assembler::notZero, slowCase);
-    }
-
-    // get hash
-    __ shrptr(result, markOopDesc::hash_shift);
-    __ andptr(result, markOopDesc::hash_mask);
-    // test if hashCode exists
-    __ jcc  (Assembler::zero, slowCase);
-    __ ret(0);
-
-    if (method->intrinsic_id() == vmIntrinsics::_identityHashCode) {
-      __ bind(nullCase);
-      __ movl(result, 0);
-      __ ret(0);
-    }
-
-    __ bind (slowCase);
-  }
-#endif // GRAALVM
-
   // The instruction at the verified entry point must be 5 bytes or longer
   // because it can be patched on the fly by make_non_entrant. The stack bang
   // instruction fits that requirement.
--- a/src/os/bsd/vm/os_bsd.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/os/bsd/vm/os_bsd.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -3635,9 +3635,9 @@
 // able to use structured exception handling (thread-local exception filters)
 // on, e.g., Win32.
 void
-os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, nmethod* nm,
+os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method,
                          JavaCallArguments* args, Thread* thread) {
-  f(value, method, nm, args, thread);
+  f(value, method, args, thread);
 }
 
 void os::print_statistics() {
--- a/src/os/linux/vm/os_linux.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/os/linux/vm/os_linux.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -4434,9 +4434,9 @@
 // able to use structured exception handling (thread-local exception filters)
 // on, e.g., Win32.
 void
-os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, nmethod* nm,
+os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method,
                          JavaCallArguments* args, Thread* thread) {
-  f(value, method, nm, args, thread);
+  f(value, method, args, thread);
 }
 
 void os::print_statistics() {
--- a/src/os/solaris/vm/os_solaris.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/os/solaris/vm/os_solaris.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -4280,8 +4280,8 @@
 
 // This does not do anything on Solaris. This is basically a hook for being
 // able to use structured exception handling (thread-local exception filters) on, e.g., Win32.
-void os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, nmethod* nm, JavaCallArguments* args, Thread* thread) {
-  f(value, method, nm, args, thread);
+void os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread) {
+  f(value, method, args, thread);
 }
 
 // This routine may be used by user applications as a "hook" to catch signals.
--- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -282,17 +282,6 @@
     }
 #endif // AMD64
 
-    if (TraceSignals) {
-    CodeBlob* cb = CodeCache::find_blob(pc);
-      if (cb != NULL && cb->is_nmethod()) {
-        nmethod* nm = (nmethod*)cb;
-        int rel = pc - nm->code_begin();
-        tty->print_cr(err_msg("Implicit exception at %d of method %s", rel, nm->method()->name()->as_C_string()));
-      } else {
-        tty->print_cr("No code blob found for %x", pc);
-      }
-    }
-
     // Handle ALL stack overflow variations here
     if (sig == SIGSEGV) {
       address addr = (address) info->si_addr;
@@ -306,7 +295,6 @@
           if (thread->thread_state() == _thread_in_Java) {
             // Throw a stack overflow exception.  Guard pages will be reenabled
             // while unwinding the stack.
-            if (WizardMode) tty->print("implicit: %08x%08x\n", ((long long)pc) >> 32, pc);
             stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
           } else {
             // Thread was in the vm or native code.  Return and try to finish.
@@ -392,15 +380,8 @@
 #endif // AMD64
       } else if (sig == SIGSEGV &&
                !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
-          if (TraceSignals) {
-            tty->print_cr("Implicit exception continuation");
-          }
           // Determination of interpreter/vtable stub/compiled code null exception
           stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
-      } else if (sig == SIGSEGV) {
-        if (TraceSignals) {
-          tty->print_cr("would have needed explicit null check %d", (intptr_t)info->si_addr);
-        }
       }
     } else if (thread->thread_state() == _thread_in_vm &&
                sig == SIGBUS && /* info->si_code == BUS_OBJERR && */
--- a/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -70,7 +70,7 @@
 extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* );
 
 // Install a win32 structured exception handler around thread.
-void os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, nmethod* nm, JavaCallArguments* args, Thread* thread) {
+void os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread) {
   __try {
 
 #ifndef AMD64
@@ -110,7 +110,7 @@
 #endif // ASSERT
 #endif // !AMD64
 
-    f(value, method, nm, args, thread);
+    f(value, method, args, thread);
   } __except(topLevelExceptionFilter((_EXCEPTION_POINTERS*)_exception_info())) {
       // Nothing to do.
   }
--- a/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/os_cpu/windows_x86/vm/threadLS_windows_x86.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -39,7 +39,7 @@
 // up the offset from FS of the thread pointer.
 void ThreadLocalStorage::generate_code_for_get_thread() {
       os::os_exception_wrapper( (java_call_t)call_wrapper_dummy,
-                                NULL, NULL, NULL, NULL, NULL);
+                                NULL, NULL, NULL, NULL);
 }
 
 void ThreadLocalStorage::pd_init() { }
--- a/src/share/vm/c1/c1_IR.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/c1/c1_IR.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -240,8 +240,8 @@
     // reexecute allowed only for the topmost frame
     bool reexecute = topmost ? should_reexecute() : false;
     bool return_oop = false; // This flag will be ignored since it used only for C2 with escape analysis.
-    methodHandle null_mh;
-    recorder->describe_scope(pc_offset, null_mh, scope()->method(), bci(), reexecute, false, is_method_handle_invoke, return_oop, locvals, expvals, monvals);
+    bool rethrow_exception = false;
+    recorder->describe_scope(pc_offset, methodHandle(), scope()->method(), bci(), reexecute, rethrow_exception, is_method_handle_invoke, return_oop, locvals, expvals, monvals);
   }
 };
 
--- a/src/share/vm/ci/ciCallProfile.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/ci/ciCallProfile.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -61,7 +61,6 @@
   // Note:  The following predicates return false for invalid profiles:
   bool      has_receiver(int i) const { return _limit > i; }
   int       morphism() const          { return _morphism; }
-  int       limit() const             { return _limit; }
 
   int       count() const             { return _count; }
   int       receiver_count(int i)  {
--- a/src/share/vm/ci/ciField.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/ci/ciField.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -166,8 +166,6 @@
   // at each point of access.
   bool will_link(ciInstanceKlass* accessing_klass,
                  Bytecodes::Code bc);
-  bool will_link_from_vm(ciInstanceKlass* accessing_klass,
-                 Bytecodes::Code bc);
 
   // Java access flags
   bool is_public      () { return flags().is_public(); }
--- a/src/share/vm/ci/ciObject.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/ci/ciObject.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -65,14 +65,12 @@
   ciObject(Handle h);
   ciObject(ciKlass* klass);
 
-public:
   jobject      handle()  const { return _handle; }
   // Get the VM oop that this object holds.
   oop get_oop() const {
     assert(_handle != NULL, "null oop");
     return JNIHandles::resolve_non_null(_handle);
   }
-protected:
 
   void init_flags_from(oop x);
 
--- a/src/share/vm/ci/ciSymbol.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/ci/ciSymbol.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -48,7 +48,7 @@
 
 private:
   const vmSymbols::SID _sid;
-  DEBUG_ONLY( bool sid_ok() { return true;/*vmSymbols::find_sid(get_symbol()) == _sid;*/ } )
+  DEBUG_ONLY( bool sid_ok() { return vmSymbols::find_sid(get_symbol()) == _sid; } )
 
   ciSymbol(Symbol* s);  // normal case, for symbols not mentioned in vmSymbols
   ciSymbol(Symbol* s, vmSymbols::SID sid);   // for use with vmSymbols
--- a/src/share/vm/classfile/classLoader.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/classfile/classLoader.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -446,10 +446,6 @@
     tty->print_cr("[Bootstrap loader class path=%s]", sys_class_path);
   }
 
-  setup_bootstrap_search_path(sys_class_path);
-}
-
-void ClassLoader::setup_bootstrap_search_path(char* sys_class_path) {
   int len = (int)strlen(sys_class_path);
   int end = 0;
 
@@ -899,23 +895,7 @@
     PerfClassTraceTime vmtimer(perf_sys_class_lookup_time(),
                                ((JavaThread*) THREAD)->get_thread_stat()->perf_timers_addr(),
                                PerfClassTraceTime::CLASS_LOAD);
-    ClassPathEntry* e = _first_entry; 
-    while (e != NULL) {
-      stream = e->open_stream(name);
-      if (stream != NULL) {
-        break;
-      }
-      e = e->next();
-      ++classpath_index;
-    }
-  }
-
-  if (stream == NULL && !(THREAD->is_Compiler_thread())) {  
-	  classpath_index = 0;
-    PerfClassTraceTime vmtimer(perf_sys_class_lookup_time(),
-                               ((JavaThread*) THREAD)->get_thread_stat()->perf_timers_addr(),
-                               PerfClassTraceTime::CLASS_LOAD);
-    ClassPathEntry* e = _first_entry; 
+    ClassPathEntry* e = _first_entry;
     while (e != NULL) {
       stream = e->open_stream(name);
       if (stream != NULL) {
--- a/src/share/vm/classfile/classLoader.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/classfile/classLoader.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -206,7 +206,6 @@
   // Initialization
   static void setup_meta_index();
   static void setup_bootstrap_search_path();
-  static void setup_bootstrap_search_path(char* sys_class_path);
   static void load_zip_library();
   static void create_class_path_entry(char *path, struct stat st, ClassPathEntry **new_entry, bool lazy);
 
--- a/src/share/vm/code/codeBlob.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/codeBlob.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -39,7 +39,6 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/vframe.hpp"
 #include "services/memoryService.hpp"
-#include "utilities/machineCodePrinter.hpp"
 #ifdef TARGET_ARCH_x86
 # include "nativeInst_x86.hpp"
 #endif
@@ -134,11 +133,10 @@
   cb->copy_code_and_locs_to(this);
   set_oop_maps(oop_maps);
   _frame_size = frame_size;
-#if defined(COMPILER1) || defined(GRAAL)
-
+#ifdef COMPILER1
   // probably wrong for tiered
   assert(_frame_size >= -1, "must use frame size or -1 for runtime stubs");
-#endif // COMPILER1 || GRAAL
+#endif // COMPILER1
 }
 
 
@@ -345,10 +343,6 @@
 
   trace_new_stub(stub, "RuntimeStub - ", stub_name);
 
-  if (PrintMachineCodeToFile) {
-    MachineCodePrinter::print(stub);
-  }
-
   return stub;
 }
 
@@ -384,7 +378,9 @@
   _unpack_offset           = unpack_offset;
   _unpack_with_exception   = unpack_with_exception_offset;
   _unpack_with_reexecution = unpack_with_reexecution_offset;
+#ifdef COMPILER1
   _unpack_with_exception_in_tls   = -1;
+#endif
 }
 
 
--- a/src/share/vm/code/compiledIC.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/compiledIC.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -95,7 +95,7 @@
   // Don't use ic_destination for this test since that forwards
   // through ICBuffer instead of returning the actual current state of
   // the CompiledIC.
-  if (is_icholder_entry(_ic_call->destination()) && !_is_optimized) {
+  if (is_icholder_entry(_ic_call->destination()) GRAAL_ONLY(&& _value != NULL)) {
     // When patching for the ICStub case the cached value isn't
     // overwritten until the ICStub copied into the CompiledIC during
     // the next safepoint.  Make sure that the CompiledICHolder* is
@@ -560,10 +560,10 @@
 
 
 void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry) {
-  set_destination_mt_safe(entry);
   address stub=find_stub();
 #ifdef GRAAL
   if (stub == NULL) {
+    set_destination_mt_safe(entry);
     return;
   }
 #endif
@@ -661,11 +661,7 @@
         case relocInfo::poll_type:
         case relocInfo::poll_return_type: // A safepoint can't overlap a call.
         default:
-#ifdef GRAAL
-          return NULL;
-#else
           ShouldNotReachHere();
-#endif
       }
     }
   }
--- a/src/share/vm/code/debugInfo.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/debugInfo.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -77,11 +77,7 @@
 
 enum { LOCATION_CODE = 0, CONSTANT_INT_CODE = 1,  CONSTANT_OOP_CODE = 2,
                           CONSTANT_LONG_CODE = 3, CONSTANT_DOUBLE_CODE = 4,
-                          OBJECT_CODE = 5,        OBJECT_ID_CODE = 6,
-#ifdef GRAAL
-                          DEFERRED_READ_CODE = 7, DEFERRED_WRITE_CODE = 8
-#endif // GRAAL
-};
+                          OBJECT_CODE = 5,        OBJECT_ID_CODE = 6 };
 
 ScopeValue* ScopeValue::read_from(DebugInfoReadStream* stream) {
   ScopeValue* result = NULL;
@@ -93,10 +89,6 @@
    case CONSTANT_DOUBLE_CODE: result = new ConstantDoubleValue(stream);  break;
    case OBJECT_CODE:          result = stream->read_object_value();      break;
    case OBJECT_ID_CODE:       result = stream->get_cached_object();      break;
-#ifdef GRAAL
-   case DEFERRED_READ_CODE:   result = new DeferredReadValue(stream);    break;
-   case DEFERRED_WRITE_CODE:  result = new DeferredWriteValue(stream);   break;
-#endif // GRAAL
    default: ShouldNotReachHere();
   }
   return result;
@@ -117,63 +109,6 @@
   location().print_on(st);
 }
 
-#ifdef GRAAL
-
-// DeferredLocationValue
-
-DeferredLocationValue::DeferredLocationValue(DebugInfoReadStream* stream) {
-  _base = read_from(stream);
-  _index = read_from(stream);
-  _scale = stream->read_int();
-  _disp = stream->read_long();
-}
-
-void DeferredLocationValue::write_on(DebugInfoWriteStream* stream) {
-  _base->write_on(stream);
-  _index->write_on(stream);
-  stream->write_int(_scale);
-  stream->write_long(_disp);
-}
-
-void DeferredLocationValue::print_on(outputStream* st) const {
-  _base->print_on(st);
-  _index->print_on(st);
-  st->print("%i %i", _scale, _disp);
-}
-
-// DeferredReadValue
-
-DeferredReadValue::DeferredReadValue(DebugInfoReadStream* stream)
-: DeferredLocationValue(stream) {
-}
-
-void DeferredReadValue::write_on(DebugInfoWriteStream* st) {
-  DeferredLocationValue::write_on(st);
-}
-
-void DeferredReadValue::print_on(outputStream* st) const {
-  DeferredLocationValue::print_on(st);
-}
-
-// DeferredWriteValue
-
-DeferredWriteValue::DeferredWriteValue(DebugInfoReadStream* stream)
-: DeferredLocationValue(stream) {
-  _value = read_from(stream);
-}
-
-void DeferredWriteValue::write_on(DebugInfoWriteStream* st) {
-  DeferredLocationValue::write_on(st);
-  _value->write_on(st);
-}
-
-void DeferredWriteValue::print_on(outputStream* st) const {
-  DeferredLocationValue::print_on(st);
-  _value->print_on(st);
-}
-
-#endif // GRAAL
-
 // ObjectValue
 
 void ObjectValue::read_object(DebugInfoReadStream* stream) {
--- a/src/share/vm/code/debugInfo.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/debugInfo.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -61,11 +61,6 @@
   // Serialization of debugging information
   virtual void write_on(DebugInfoWriteStream* stream) = 0;
   static ScopeValue* read_from(DebugInfoReadStream* stream);
-
-#ifdef GRAAL
-  // Printing
-  virtual void print_on(outputStream* st) const = 0;
-#endif // GRAAL
 };
 
 
@@ -88,64 +83,6 @@
   void print_on(outputStream* st) const;
 };
 
-#ifdef GRAAL
-
-class DeferredLocationValue: public ScopeValue {
-private:
-  ScopeValue* _base;
-  ScopeValue* _index;
-  jint _scale;
-  jlong _disp;
-public:
-  DeferredLocationValue(ScopeValue* base, ScopeValue* index, jint scale, jlong disp)
-  : _base(base), _index(index), _scale(scale), _disp(disp) { }
-
-  ScopeValue* base() { return _base; }
-  ScopeValue* index() { return _index; }
-  jint scale() { return _scale; }
-  jlong disp() { return _disp; }
-
-  // Serialization of debugging information
-  DeferredLocationValue(DebugInfoReadStream* stream);
-  void write_on(DebugInfoWriteStream* stream);
-
-  // Printing
-  void print_on(outputStream* st) const;
-};
-
-
-class DeferredReadValue: public DeferredLocationValue {
-public:
-  DeferredReadValue(ScopeValue* base, ScopeValue* index, jint scale, jint disp)
-  : DeferredLocationValue(base, index, scale, disp) { }
-
-  // Serialization of debugging information
-  DeferredReadValue(DebugInfoReadStream* stream);
-  void write_on(DebugInfoWriteStream* stream);
-
-  // Printing
-  void print_on(outputStream* st) const;
-};
-
-class DeferredWriteValue: public DeferredLocationValue {
-private:
-  ScopeValue* _value;
-public:
-  DeferredWriteValue(ScopeValue* base, ScopeValue* index, jint scale, jint disp, ScopeValue* value)
-  : DeferredLocationValue(base, index, scale, disp), _value(value) { }
-
-  ScopeValue* value() { return _value; }
-
-  // Serialization of debugging information
-  DeferredWriteValue(DebugInfoReadStream* stream);
-  void write_on(DebugInfoWriteStream* stream);
-
-  // Printing
-  void print_on(outputStream* st) const;
-};
-
-#endif // GRAAL
-
 
 // An ObjectValue describes an object eliminated by escape analysis.
 
--- a/src/share/vm/code/debugInfoRec.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/debugInfoRec.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -289,8 +289,7 @@
                                               bool        return_oop,
                                               DebugToken* locals,
                                               DebugToken* expressions,
-                                              DebugToken* monitors
-                                              ) {
+                                              DebugToken* monitors) {
   assert(_recording_state != rs_null, "nesting of recording calls");
   PcDesc* last_pd = last_pc();
   assert(last_pd->pc_offset() == pc_offset, "must be last pc");
--- a/src/share/vm/code/debugInfoRec.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/debugInfoRec.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -107,8 +107,7 @@
                       bool        return_oop = false,
                       DebugToken* locals      = NULL,
                       DebugToken* expressions = NULL,
-                      DebugToken* monitors    = NULL
-                      );
+                      DebugToken* monitors    = NULL);
 
 
   void dump_object_pool(GrowableArray<ScopeValue*>* objects);
--- a/src/share/vm/code/dependencies.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/dependencies.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -563,6 +563,7 @@
   _size_in_bytes = bytes.position();
 }
 
+
 const char* Dependencies::_dep_name[TYPE_LIMIT] = {
   "end_marker",
   "evol_method",
--- a/src/share/vm/code/icBuffer.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/icBuffer.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -96,8 +96,8 @@
 void ICStub::verify() {
 }
 
-void ICStub::print_on(outputStream* st) {
-  st->print_cr("ICStub: site: " INTPTR_FORMAT, _ic_site);
+void ICStub::print() {
+  tty->print_cr("ICStub: site: " INTPTR_FORMAT, _ic_site);
 }
 #endif
 
--- a/src/share/vm/code/icBuffer.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/icBuffer.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -75,8 +75,8 @@
   void* cached_value() const;   // cached_value for stub
 
   // Debugging
-  void    verify()                   PRODUCT_RETURN;
-  void    print_on(outputStream* st) PRODUCT_RETURN;
+  void    verify()            PRODUCT_RETURN;
+  void    print()             PRODUCT_RETURN;
 
   // Creation
   friend ICStub* ICStub_from_destination_address(address destination_address);
--- a/src/share/vm/code/nmethod.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/nmethod.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -42,8 +42,6 @@
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/xmlstream.hpp"
-#include "utilities/debug.hpp"
-#include "utilities/machineCodePrinter.hpp"
 #ifdef SHARK
 #include "shark/sharkCompiler.hpp"
 #endif
@@ -126,6 +124,7 @@
 //   PrintC1Statistics, PrintOptoStatistics, LogVMOutput, and LogCompilation.
 // (In the latter two cases, they like other stats are printed to the log only.)
 
+#ifndef PRODUCT
 // These variables are put into one block to reduce relocations
 // and make it simpler to print from the debugger.
 static
@@ -215,6 +214,7 @@
                   pc_desc_tests, pc_desc_searches, pc_desc_adds);
   }
 } nmethod_stats;
+#endif //PRODUCT
 
 
 //---------------------------------------------------------------------------------
@@ -520,13 +520,9 @@
               code_buffer, frame_size,
               basic_lock_owner_sp_offset, basic_lock_sp_offset,
               oop_maps);
-    if (nm != NULL)  nmethod_stats.note_native_nmethod(nm);
+    NOT_PRODUCT(if (nm != NULL)  nmethod_stats.note_native_nmethod(nm));
     if (PrintAssembly && nm != NULL)
       Disassembler::decode(nm);
-
-    if (PrintMachineCodeToFile) {
-      MachineCodePrinter::print(nm);
-    }
   }
   // verify nmethod
   debug_only(if (nm) nm->verify();) // might block
@@ -558,7 +554,7 @@
 
     nm = new (nmethod_size) nmethod(method(), nmethod_size, &offsets, code_buffer, frame_size);
 
-    if (nm != NULL)  nmethod_stats.note_nmethod(nm);
+    NOT_PRODUCT(if (nm != NULL)  nmethod_stats.note_nmethod(nm));
     if (PrintAssembly && nm != NULL)
       Disassembler::decode(nm);
   }
@@ -637,13 +633,9 @@
         InstanceKlass::cast(klass)->add_dependent_nmethod(nm);
       }
     }
-    if (nm != NULL)  nmethod_stats.note_nmethod(nm);
+    NOT_PRODUCT(if (nm != NULL)  nmethod_stats.note_nmethod(nm));
     if (PrintAssembly && nm != NULL)
       Disassembler::decode(nm);
-
-    if (nm != NULL && PrintMachineCodeToFile) {
-      MachineCodePrinter::print(nm);
-    }
   }
 
   // verify nmethod
@@ -1819,8 +1811,8 @@
 // really alive.
 void nmethod::verify_metadata_loaders(address low_boundary, BoolObjectClosure* is_alive) {
 #ifdef ASSERT
-  RelocIterator iter(this, low_boundary);
-  while (iter.next()) {
+    RelocIterator iter(this, low_boundary);
+    while (iter.next()) {
     // static_stub_Relocations may have dangling references to
     // Method*s so trim them out here.  Otherwise it looks like
     // compiled code is maintaining a link to dead metadata.
@@ -1829,13 +1821,11 @@
       CompiledIC* cic = CompiledIC_at(iter.reloc());
       if (!cic->is_call_to_interpreted()) {
         static_call_addr = iter.addr();
-        cic->set_to_clean();
       }
     } else if (iter.type() == relocInfo::static_call_type) {
       CompiledStaticCall* csc = compiledStaticCall_at(iter.reloc());
       if (!csc->is_call_to_interpreted()) {
         static_call_addr = iter.addr();
-        csc->set_to_clean();
       }
     }
     if (static_call_addr != NULL) {
@@ -2512,9 +2502,7 @@
         // information in a table.
         break;
     }
-#ifndef GRAAL
     assert(stub == NULL || stub_contains(stub), "static call stub outside stub section");
-#endif
   }
 }
 
@@ -3006,8 +2994,6 @@
   ImplicitExceptionTable(this).print(code_begin());
 }
 
-#endif // PRODUCT
-
 void nmethod::print_statistics() {
   ttyLocker ttyl;
   if (xtty != NULL)  xtty->head("statistics type='nmethod'");
@@ -3019,18 +3005,4 @@
   if (xtty != NULL)  xtty->tail("statistics");
 }
 
-#ifdef GRAAL
-void DebugScopedNMethod::print_on(outputStream* st) {
-  if (_nm != NULL) {
-    st->print("nmethod@%p", _nm);
-    Method* method = _nm->method();
-    if (method != NULL) {
-      char holder[O_BUFLEN];
-      char nameAndSig[O_BUFLEN];
-      method->method_holder()->name()->as_C_string(holder, O_BUFLEN);
-      method->name_and_sig_as_C_string(nameAndSig, O_BUFLEN);
-      st->print(" - %s::%s", holder, nameAndSig);
-    }
-  }
-}
-#endif
+#endif // PRODUCT
--- a/src/share/vm/code/nmethod.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/nmethod.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -291,7 +291,7 @@
   // Inform external interfaces that a compiled method has been unloaded
   void post_compiled_method_unload();
 
-  // Initialize fields to their default values
+  // Initailize fields to their default values
   void init_defaults();
 
  public:
@@ -357,9 +357,6 @@
   bool is_compiled_by_c2() const;
   bool is_compiled_by_shark() const;
 
-
-#define CHECK_POSITIVE(val) assert(val, "should be positive")
-
   // boundaries for different parts
   address consts_begin          () const          { return           header_begin() + _consts_offset        ; }
   address consts_end            () const          { return           header_begin() +  code_offset()        ; }
@@ -367,8 +364,8 @@
   address insts_end             () const          { return           header_begin() + _stub_offset          ; }
   address stub_begin            () const          { return           header_begin() + _stub_offset          ; }
   address stub_end              () const          { return           header_begin() + _oops_offset          ; }
-  address exception_begin       () const          { assert(_exception_offset >= 0, "no exception handler"); return header_begin() + _exception_offset ; }
-  address deopt_handler_begin   () const          { assert(_deoptimize_offset >= 0, "no deopt handler"); return header_begin() + _deoptimize_offset ; }
+  address exception_begin       () const          { return           header_begin() + _exception_offset     ; }
+  address deopt_handler_begin   () const          { return           header_begin() + _deoptimize_offset    ; }
   address deopt_mh_handler_begin() const          { return           header_begin() + _deoptimize_mh_offset ; }
   address unwind_handler_begin  () const          { return _unwind_handler_offset != -1 ? (header_begin() + _unwind_handler_offset) : NULL; }
   oop*    oops_begin            () const          { return (oop*)   (header_begin() + _oops_offset)         ; }
@@ -689,7 +686,7 @@
 
   // Prints a comment for one native instruction (reloc info, pc desc)
   void print_code_comment_on(outputStream* st, int column, address begin, address end);
-  static void print_statistics();
+  static void print_statistics()                  PRODUCT_RETURN;
 
   // Compiler task identification.  Note that all OSR methods
   // are numbered in an independent sequence if CICountOSR is true,
@@ -774,19 +771,4 @@
   }
 };
 
-#ifdef GRAAL
-class DebugScopedNMethod : public DebugScopedValue {
-private:
-  nmethod* _nm;
-public:
-  DebugScopedNMethod(const char* file, int line, nmethod* nm) : DebugScopedValue(file, line), _nm(nm) {}
-  void print_on(outputStream* st);
-};
-#define DS_NMETHOD(nm) DebugScopedNMethod __dsnm__(__FILE__, __LINE__, nm)
-#define DS_NMETHOD1(name, nm) DebugScopedNMethod name(__FILE__, __LINE__, nm)
-#else
-#define DS_NMETHOD(nm) do {} while (0)
-#define DS_NMETHOD1(name, nm) do {} while (0)
-#endif
-
 #endif // SHARE_VM_CODE_NMETHOD_HPP
--- a/src/share/vm/code/pcDesc.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/pcDesc.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -81,8 +81,7 @@
   bool is_same_info(const PcDesc* pd) {
     return _scope_decode_offset == pd->_scope_decode_offset &&
       _obj_decode_offset == pd->_obj_decode_offset &&
-      _flags == pd->_flags
-      ;
+      _flags == pd->_flags;
   }
 
   bool     is_method_handle_invoke()       const { return (_flags & PCDESC_is_method_handle_invoke) != 0;     }
--- a/src/share/vm/code/stubs.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/stubs.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -254,9 +254,10 @@
   guarantee(_queue_begin != _queue_end || n == 0, "buffer indices must be the same");
 }
 
-void StubQueue::print_on(outputStream* st) const {
+
+void StubQueue::print() {
   MutexLockerEx lock(_mutex);
   for (Stub* s = first(); s != NULL; s = next(s)) {
-    stub_print(s, st);
+    stub_print(s);
   }
 }
--- a/src/share/vm/code/stubs.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/code/stubs.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -107,21 +107,20 @@
  public:
   // Initialization/finalization
   virtual void    initialize(Stub* self, int size,
-                             CodeComments& comments)           = 0; // called after creation (called twice if allocated via (request, commit))
-  virtual void    finalize(Stub* self)                         = 0; // called before deallocation
+                             CodeComments& comments)       = 0; // called after creation (called twice if allocated via (request, commit))
+  virtual void    finalize(Stub* self)                     = 0; // called before deallocation
 
   // General info/converters
-  virtual int     size(Stub* self) const                       = 0; // the total size of the stub in bytes (must be a multiple of CodeEntryAlignment)
-  virtual int     code_size_to_size(int code_size) const       = 0; // computes the total stub size in bytes given the code size in bytes
+  virtual int     size(Stub* self) const                   = 0; // the total size of the stub in bytes (must be a multiple of CodeEntryAlignment)
+  virtual int     code_size_to_size(int code_size) const   = 0; // computes the total stub size in bytes given the code size in bytes
 
   // Code info
-  virtual address code_begin(Stub* self) const                 = 0; // points to the first code byte
-  virtual address code_end(Stub* self) const                   = 0; // points to the first byte after the code
+  virtual address code_begin(Stub* self) const             = 0; // points to the first code byte
+  virtual address code_end(Stub* self) const               = 0; // points to the first byte after the code
 
   // Debugging
-  virtual void    verify(Stub* self) const                     = 0; // verifies the stub
-  NOT_PRODUCT(using AllocatedObj::print_on;)
-  virtual void    print_on(Stub* self, outputStream* st) const = 0; // prints information about the stub
+  virtual void    verify(Stub* self)                       = 0; // verifies the stub
+  virtual void    print(Stub* self)                        = 0; // prints information about the stub
 };
 
 
@@ -129,29 +128,28 @@
 // class, forwarding stub interface calls to the corresponding
 // stub calls.
 
-#define DEF_STUB_INTERFACE(stub)                                 \
-  class stub##Interface: public StubInterface {                  \
-   private:                                                      \
-    static stub*    cast(Stub* self)                             { return (stub*)self; }                 \
-                                                                 \
-   public:                                                       \
-    /* Initialization/finalization */                            \
-    virtual void    initialize(Stub* self, int size,             \
-                               CodeComments& comments)           { cast(self)->initialize(size, comments); } \
-    virtual void    finalize(Stub* self)                         { cast(self)->finalize(); }             \
-                                                                 \
-    /* General info */                                           \
-    virtual int     size(Stub* self) const                       { return cast(self)->size(); }          \
-    virtual int     code_size_to_size(int code_size) const       { return stub::code_size_to_size(code_size); } \
-                                                                 \
-    /* Code info */                                              \
-    virtual address code_begin(Stub* self) const                 { return cast(self)->code_begin(); }    \
-    virtual address code_end(Stub* self) const                   { return cast(self)->code_end(); }      \
-                                                                 \
-    /* Debugging */                                              \
-    virtual void    verify(Stub* self) const                     { cast(self)->verify(); }               \
-    NOT_PRODUCT(using AllocatedObj::print_on;)                   \
-    virtual void    print_on(Stub* self, outputStream* st) const { cast(self)->print_on(st); }           \
+#define DEF_STUB_INTERFACE(stub)                           \
+  class stub##Interface: public StubInterface {            \
+   private:                                                \
+    static stub*    cast(Stub* self)                       { return (stub*)self; }                 \
+                                                           \
+   public:                                                 \
+    /* Initialization/finalization */                      \
+    virtual void    initialize(Stub* self, int size,       \
+                               CodeComments& comments)     { cast(self)->initialize(size, comments); } \
+    virtual void    finalize(Stub* self)                   { cast(self)->finalize(); }             \
+                                                           \
+    /* General info */                                     \
+    virtual int     size(Stub* self) const                 { return cast(self)->size(); }          \
+    virtual int     code_size_to_size(int code_size) const { return stub::code_size_to_size(code_size); } \
+                                                           \
+    /* Code info */                                        \
+    virtual address code_begin(Stub* self) const           { return cast(self)->code_begin(); }    \
+    virtual address code_end(Stub* self) const             { return cast(self)->code_end(); }      \
+                                                           \
+    /* Debugging */                                        \
+    virtual void    verify(Stub* self)                     { cast(self)->verify(); }               \
+    virtual void    print(Stub* self)                      { cast(self)->print(); }                \
   };
 
 
@@ -184,7 +182,7 @@
   bool  stub_contains(Stub* s, address pc) const { return _stub_interface->code_begin(s) <= pc && pc < _stub_interface->code_end(s); }
   int   stub_code_size_to_size(int code_size) const { return _stub_interface->code_size_to_size(code_size); }
   void  stub_verify(Stub* s)                     { _stub_interface->verify(s); }
-  void  stub_print(Stub* s, outputStream* st) const { _stub_interface->print_on(s, st); }
+  void  stub_print(Stub* s)                      { _stub_interface->print(s); }
 
   static void register_queue(StubQueue*);
 
@@ -228,9 +226,8 @@
   address stub_code_end(Stub* s) const           { return _stub_interface->code_end(s);   }
 
   // Debugging/printing
-  void verify();                                 // verifies the stub queue
-  virtual void print() const                     { print_on(tty); }
-  virtual void print_on(outputStream* st) const;
+  void  verify();                                // verifies the stub queue
+  void  print();                                 // prints information about the stub queue
 };
 
 #endif // SHARE_VM_CODE_STUBS_HPP
--- a/src/share/vm/compiler/compileBroker.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/compiler/compileBroker.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -44,9 +44,6 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/sweeper.hpp"
 #include "utilities/dtrace.hpp"
-#ifdef GRAAL
-#include "graal/graalCompiler.hpp"
-#endif
 #include "utilities/events.hpp"
 #ifdef COMPILER1
 #include "c1/c1_Compiler.hpp"
--- a/src/share/vm/compiler/oopMap.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/compiler/oopMap.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -47,7 +47,7 @@
 class OopMapValue: public StackObj {
   friend class VMStructs;
 private:
-  int _value;
+  short _value;
   int value() const                                 { return _value; }
   void set_value(int value)                         { _value = value; }
   short _content_reg;
@@ -55,7 +55,7 @@
 public:
   // Constants
   enum { type_bits                = 5,
-         register_bits            = BitsPerJavaInteger - type_bits };
+         register_bits            = BitsPerShort - type_bits };
 
   enum { type_shift               = 0,
          register_shift           = type_bits };
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -617,7 +617,6 @@
 
   NativeInstruction* inst = nativeInstruction_at(_instructions->start() + pc_offset);
   jint next_pc_offset = 0x0;
-  bool is_call_reg = false;
   if (inst->is_call() || inst->is_jump()) {
     assert(NativeCall::instruction_size == (int)NativeJump::instruction_size, "unexpected size");
     next_pc_offset = pc_offset + NativeCall::instruction_size;
@@ -630,10 +629,8 @@
   } else if (inst->is_call_reg()) {
     // the inlined vtable stub contains a "call register" instruction
     assert(hotspot_method != NULL, "only valid for virtual calls");
-    is_call_reg = true;
     next_pc_offset = pc_offset + ((NativeCallReg *) inst)->next_instruction_offset();
   } else {
-    tty->print_cr("at pc_offset %d", pc_offset);
     fatal("unsupported type of instruction for call site");
   }
 
--- a/src/share/vm/graal/graalCompiler.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/graal/graalCompiler.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -159,11 +159,10 @@
 
   assert(_initialized, "must already be initialized");
   ResourceMark rm;
-  assert(JavaThread::current()->env() == NULL, "ciEnv should be null");
-  JavaThread::current()->set_compiling(true);
+  JavaThread::current()->set_is_compiling(true);
   Handle holder = GraalCompiler::createHotSpotResolvedObjectType(method, CHECK);
   jboolean success = VMToCompiler::compileMethod(method(), holder, entry_bci, blocking, method->graal_priority());
-  JavaThread::current()->set_compiling(false);
+  JavaThread::current()->set_is_compiling(false);
   if (success != JNI_TRUE) {
     method->clear_queued_for_compilation();
     CompilationPolicy::policy()->delay_compilation(method());
--- a/src/share/vm/graal/graalCompilerToVM.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/graal/graalCompilerToVM.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -877,7 +877,8 @@
     THROW_0(vmSymbols::MethodInvalidatedException());
   }
 
-  JavaCalls::call(&result, mh, nm, &jca, CHECK_NULL);
+  jca.set_alternative_target(nm);
+  JavaCalls::call(&result, mh, &jca, CHECK_NULL);
 
   if (jap.get_ret_type() == T_VOID) {
     return NULL;
@@ -906,7 +907,8 @@
     THROW_0(vmSymbols::MethodInvalidatedException());
   }
 
-  JavaCalls::call(&result, method, nm, &args, CHECK_NULL);
+  args.set_alternative_target(nm);
+  JavaCalls::call(&result, method, &args, CHECK_NULL);
 
   return JNIHandles::make_local((oop) result.get_jobject());
 C2V_END
--- a/src/share/vm/interpreter/interpreter.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/interpreter/interpreter.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -63,8 +63,9 @@
 
 void InterpreterCodelet::print_on(outputStream* st) const {
   ttyLocker ttyl;
-  if (PrintInterpreter || PrintMachineCodeToFile) {
 
+  if (PrintInterpreter) {
+    st->cr();
     st->print_cr("----------------------------------------------------------------------");
   }
 
@@ -73,7 +74,8 @@
   st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "]  %d bytes",
                 code_begin(), code_end(), code_size());
 
-  if (PrintInterpreter || PrintMachineCodeToFile) {
+  if (PrintInterpreter) {
+    st->cr();
     Disassembler::decode(code_begin(), code_end(), st, DEBUG_ONLY(_comments) NOT_DEBUG(CodeComments()));
   }
 }
@@ -388,7 +390,6 @@
   assert(method->contains(bcp), "just checkin'");
   Bytecodes::Code code   = Bytecodes::java_code_at(method, bcp);
 #if defined(COMPILER1) || defined(GRAAL)
-
   if(code == Bytecodes::_athrow ) {
     return Interpreter::rethrow_exception_entry();
   }
@@ -434,8 +435,7 @@
     case Bytecodes::_getstatic :
     case Bytecodes::_putstatic :
     case Bytecodes::_aastore   :
-#if defined(COMPILER1)
-
+#ifdef COMPILER1
     //special case of reexecution
     case Bytecodes::_athrow    :
 #endif
--- a/src/share/vm/interpreter/rewriter.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/interpreter/rewriter.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -115,9 +115,7 @@
   while (!bcs.is_last_bytecode()) {
     Bytecodes::Code opcode = bcs.raw_next();
     switch (opcode) {
-      case Bytecodes::_return:
-          *bcs.bcp() = Bytecodes::_return_register_finalizer;
-        break;
+      case Bytecodes::_return: *bcs.bcp() = Bytecodes::_return_register_finalizer; break;
 
       case Bytecodes::_istore:
       case Bytecodes::_lstore:
@@ -317,12 +315,12 @@
       switch (c) {
         case Bytecodes::_lookupswitch   : {
 #ifndef CC_INTERP
-            Bytecode_lookupswitch bc(method, bcp);
-            (*bcp) = (
-              bc.number_of_pairs() < BinarySwitchThreshold
-              ? Bytecodes::_fast_linearswitch
-              : Bytecodes::_fast_binaryswitch
-            );
+          Bytecode_lookupswitch bc(method, bcp);
+          (*bcp) = (
+            bc.number_of_pairs() < BinarySwitchThreshold
+            ? Bytecodes::_fast_linearswitch
+            : Bytecodes::_fast_binaryswitch
+          );
 #endif
           break;
         }
--- a/src/share/vm/interpreter/templateInterpreter.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/interpreter/templateInterpreter.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -27,7 +27,6 @@
 #include "interpreter/interpreterGenerator.hpp"
 #include "interpreter/interpreterRuntime.hpp"
 #include "interpreter/templateTable.hpp"
-#include "utilities/machineCodePrinter.hpp"
 
 #ifndef CC_INTERP
 
@@ -52,9 +51,6 @@
                           "Interpreter");
     InterpreterGenerator g(_code);
     if (PrintInterpreter) print();
-    if (PrintMachineCodeToFile) {
-      MachineCodePrinter::print(_code);
-    }
   }
 
   // initialize dispatch table
--- a/src/share/vm/memory/allocation.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/memory/allocation.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -34,9 +34,6 @@
 #ifdef COMPILER2
 #include "opto/c2_globals.hpp"
 #endif
-#ifdef GRAAL
-#include "graal/graalGlobals.hpp"
-#endif
 
 #include <new>
 
--- a/src/share/vm/memory/heap.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/memory/heap.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -127,7 +127,7 @@
   assert(_number_of_reserved_segments >= _number_of_committed_segments, "just checking");
 
   // reserve space for _segmap
-  if (!_segmap.initialize(align_to_allocation_size(_number_of_reserved_segments), align_to_allocation_size(_number_of_committed_segments))) {
+  if (!_segmap.initialize(align_to_page_size(_number_of_reserved_segments), align_to_page_size(_number_of_committed_segments))) {
     return false;
   }
 
--- a/src/share/vm/oops/instanceKlass.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/oops/instanceKlass.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -1024,6 +1024,7 @@
   void print_value_on(outputStream* st) const;
 
   void oop_print_value_on(oop obj, outputStream* st);
+
 #ifndef PRODUCT
   void oop_print_on      (oop obj, outputStream* st);
 
--- a/src/share/vm/oops/method.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/oops/method.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -54,9 +54,6 @@
 #include "runtime/signature.hpp"
 #include "utilities/quickSort.hpp"
 #include "utilities/xmlstream.hpp"
-#ifdef GRAAL
-#include "graal/graalJavaAccess.hpp"
-#endif
 
 
 // Implementation of Method
@@ -712,7 +709,6 @@
     tty->cr();
   }
   if ((TraceDeoptimization || LogCompilation) && (xtty != NULL)) {
-    ResourceMark rm;
     ttyLocker ttyl;
     xtty->begin_elem("make_not_%scompilable thread='" UINTX_FORMAT "'",
                      is_osr ? "osr_" : "", os::current_thread_id());
@@ -1944,16 +1940,3 @@
   guarantee(md == NULL ||
       md->is_methodData(), "should be method data");
 }
-
-#ifdef GRAAL
-void DebugScopedMethod::print_on(outputStream* st) {
-  if (_method != NULL) {
-    st->print("Method@%p", _method);
-    char holder[O_BUFLEN];
-    char nameAndSig[O_BUFLEN];
-    _method->method_holder()->name()->as_C_string(holder, O_BUFLEN);
-    _method->name_and_sig_as_C_string(nameAndSig, O_BUFLEN);
-    st->print(" - %s::%s", holder, nameAndSig);
-  }
-}
-#endif
--- a/src/share/vm/oops/method.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/oops/method.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -1000,20 +1000,4 @@
   }
 };
 
-#ifdef GRAAL
-class DebugScopedMethod : public DebugScopedValue {
-private:
-  Method* _method;
-public:
-  DebugScopedMethod(const char* file, int line, Method* method) : DebugScopedValue(file, line), _method(method) {}
-  void print_on(outputStream* st);
-};
-#define DS_METHOD(method) DebugScopedMethod __dsm__(__FILE__, __LINE__, method)
-#define DS_METHOD1(var, method) DebugScopedMethod var(__FILE__, __LINE__, method)
-#else
-#define DS_METHOD(method) do {} while (0)
-#define DS_METHOD1(var, method) do {} while (0)
-#endif
-
 #endif // SHARE_VM_OOPS_METHODOOP_HPP
-
--- a/src/share/vm/opto/bytecodeInfo.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/opto/bytecodeInfo.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -236,7 +236,8 @@
     return false;
   }
   if (callee_method->should_not_inline()) {
-    return "disallowed by CompilerOracle";
+    set_msg("disallowed by CompilerOracle");
+    return false;
   }
 
   // Now perform checks which are heuristic
--- a/src/share/vm/prims/jni.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/prims/jni.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -1319,7 +1319,6 @@
 }
 
 
-static bool first_time_InvokeMain = true;
 
 static void jni_invoke_static(JNIEnv *env, JavaValue* result, jobject receiver, JNICallType call_type, jmethodID method_id, JNI_ArgumentPusher *args, TRAPS) {
   methodHandle method(THREAD, Method::resolve_jmethod_id(method_id));
@@ -1328,8 +1327,6 @@
   // the jni parser
   ResourceMark rm(THREAD);
   int number_of_parameters = method->size_of_parameters();
-
-  // Invoke the method. Result is returned as oop.
   JavaCallArguments java_args(number_of_parameters);
   args->set_java_argument_object(&java_args);
 
@@ -1337,23 +1334,16 @@
 
   // Fill out JavaCallArguments object
   args->iterate( Fingerprinter(method).fingerprint() );
-  // Initialize result type (must be done after args->iterate())
+  // Initialize result type
   result->set_type(args->get_ret_type());
 
+  // Invoke the method. Result is returned as oop.
   JavaCalls::call(result, method, &java_args, CHECK);
 
   // Convert result
   if (result->get_type() == T_OBJECT || result->get_type() == T_ARRAY) {
     result->set_jobject(JNIHandles::make_local(env, (oop) result->get_jobject()));
   }
-
-#ifdef HIGH_LEVEL_INTERPRETER
-  if (invoked_main_method) {
-    assert(THREAD->is_Java_thread(), "other threads must not call into java");
-    JavaThread* thread = (JavaThread*)THREAD;
-    thread->set_high_level_interpreter_in_vm(false);
-  }
-#endif
 }
 
 
--- a/src/share/vm/runtime/arguments.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/arguments.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -2180,6 +2180,7 @@
 }
 
 // Parse JavaVMInitArgs structure
+
 jint Arguments::parse_vm_init_args(const JavaVMInitArgs* args) {
   // For components of the system classpath.
   SysClassPath scp(Arguments::get_sysclasspath());
--- a/src/share/vm/runtime/basicLock.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/basicLock.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -63,7 +63,6 @@
  public:
   // Manipulation
   oop      obj() const                                { return _obj;  }
-  oop*     obj_addr()                                 { return &_obj; }
   void set_obj(oop obj)                               { _obj = obj; }
   BasicLock* lock()                                   { return &_lock; }
 
--- a/src/share/vm/runtime/compilationPolicy.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/compilationPolicy.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -60,7 +60,7 @@
     break;
 
   case 1:
-#if defined(COMPILER2)
+#ifdef COMPILER2
     CompilationPolicy::set_policy(new StackWalkCompPolicy());
 #else
     Unimplemented();
@@ -81,7 +81,7 @@
 #endif
     break;
   case 4:
-#if defined(GRAALVM)
+#ifdef GRAALVM
     CompilationPolicy::set_policy(new GraalCompPolicy());
 #else
     Unimplemented();
@@ -188,7 +188,6 @@
 #endif
 
 #ifdef COMPILER1
-  GRAALVM_ONLY(ShouldNotReachHere();)
   if (is_c1_compile(comp_level)) {
     return _compiler_count;
   } else {
@@ -212,7 +211,6 @@
 }
 
 void NonTieredCompPolicy::reset_counter_for_back_branch_event(methodHandle m) {
-//  GRAAL_ONLY(assert(false, "unexpected"));
   // Delay next back-branch event but pump up invocation counter to triger
   // whole method compilation.
   InvocationCounter* i = m->invocation_counter();
@@ -510,7 +508,7 @@
 
 // StackWalkCompPolicy - walk up stack to find a suitable method to compile
 
-#if defined(COMPILER2)
+#ifdef COMPILER2
 const char* StackWalkCompPolicy::_msg = NULL;
 
 
--- a/src/share/vm/runtime/compilationPolicy.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/compilationPolicy.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -126,7 +126,7 @@
 
 // StackWalkCompPolicy - existing C2 policy
 
-#if defined(COMPILER2)
+#ifdef COMPILER2
 class StackWalkCompPolicy : public NonTieredCompPolicy {
  public:
   virtual void method_invocation_event(methodHandle m, JavaThread* thread);
--- a/src/share/vm/runtime/deoptimization.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/deoptimization.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -1325,7 +1325,7 @@
       GrowableArray<ScopeValue*>* expressions = trap_scope->expressions();
       guarantee(expressions != NULL, "must have exception to throw");
       ScopeValue* topOfStack = expressions->top();
-      Handle topOfStackObj = cvf->create_stack_value(topOfStack)->get_obj();
+      Handle topOfStackObj = StackValue::create_stack_value(&fr, &reg_map, topOfStack)->get_obj();
       THREAD->set_pending_exception(topOfStackObj(), NULL, 0);
     }
     
--- a/src/share/vm/runtime/deoptimization.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/deoptimization.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -37,7 +37,7 @@
   friend class VMStructs;
 
  public:
-  // What condition caused the deoptimization
+  // What condition caused the deoptimization?
   enum DeoptReason {
     Reason_many = -1,             // indicates presence of several reasons
     Reason_none = 0,              // indicates absence of a relevant deopt.
@@ -85,7 +85,7 @@
     // Note:  Reason_RECORDED_LIMIT should be < 8 to fit into 3 bits of
     // DataLayout::trap_bits.  This dependency is enforced indirectly
     // via asserts, to avoid excessive direct header-to-header dependencies.
-    // See Deoptimization::trap_state_reason and class DataLayout
+    // See Deoptimization::trap_state_reason and class DataLayout.
   };
 
   // What action must be taken by the runtime?
@@ -132,7 +132,7 @@
   // executing in a particular CodeBlob if UseBiasedLocking is enabled
   static void revoke_biases_of_monitors(CodeBlob* cb);
 
-//#ifdef COMPILER2
+#if defined(COMPILER2) || defined(GRAAL)
   // Support for restoring non-escaping objects
   static bool realloc_objects(JavaThread* thread, frame* fr, GrowableArray<ScopeValue*>* objects, TRAPS);
   static void reassign_type_array_elements(frame* fr, RegisterMap* reg_map, ObjectValue* sv, typeArrayOop obj, BasicType type);
@@ -140,7 +140,7 @@
   static void reassign_fields(frame* fr, RegisterMap* reg_map, GrowableArray<ScopeValue*>* objects);
   static void relock_objects(GrowableArray<MonitorInfo*>* monitors, JavaThread* thread);
   NOT_PRODUCT(static void print_objects(GrowableArray<ScopeValue*>* objects);)
-//#endif // COMPILER2
+#endif // COMPILER2 || GRAAL
 
   public:
   static vframeArray* create_vframeArray(JavaThread* thread, frame fr, RegisterMap *reg_map, GrowableArray<compiledVFrame*>* chunk);
@@ -319,12 +319,11 @@
     assert((1 << _reason_bits) >= Reason_LIMIT, "enough bits");
     assert((1 << _action_bits) >= Action_LIMIT, "enough bits");
     int trap_request;
-    if (index != -1) {
+    if (index != -1)
       trap_request = index;
-    } else {
+    else
       trap_request = (~(((reason) << _reason_shift)
                         + ((action) << _action_shift)));
-    }
     assert(reason == trap_request_reason(trap_request), "valid reason");
     assert(action == trap_request_action(trap_request), "valid action");
     assert(index  == trap_request_index(trap_request),  "valid index");
--- a/src/share/vm/runtime/fieldDescriptor.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/fieldDescriptor.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -25,10 +25,7 @@
 #ifndef SHARE_VM_RUNTIME_FIELDDESCRIPTOR_HPP
 #define SHARE_VM_RUNTIME_FIELDDESCRIPTOR_HPP
 
-#include "oops/annotations.hpp"
 #include "oops/constantPool.hpp"
-#include "oops/fieldInfo.hpp"
-#include "oops/instanceKlass.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/fieldType.hpp"
 #include "utilities/accessFlags.hpp"
--- a/src/share/vm/runtime/frame.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/frame.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -597,67 +597,44 @@
 void frame::interpreter_frame_print_on(outputStream* st) const {
 #ifndef PRODUCT
   assert(is_interpreted_frame(), "Not an interpreted frame");
-  assert(interpreter_frame_method() != NULL && interpreter_frame_method()->contains(interpreter_frame_bcp()), "must be");
   jint i;
-  st->print_cr(" - sp                                  = " INTPTR_FORMAT, sp());
-  // expressions
+  for (i = 0; i < interpreter_frame_method()->max_locals(); i++ ) {
+    intptr_t x = *interpreter_frame_local_at(i);
+    st->print(" - local  [" INTPTR_FORMAT "]", x);
+    st->fill_to(23);
+    st->print_cr("; #%d", i);
+  }
   for (i = interpreter_frame_expression_stack_size() - 1; i >= 0; --i ) {
-    intptr_t* x = interpreter_frame_expression_stack_at(i);
-    st->print(" - stack         at " INTPTR_FORMAT " = " INTPTR_FORMAT, x, *x);
-    st->fill_to(70);
+    intptr_t x = *interpreter_frame_expression_stack_at(i);
+    st->print(" - stack  [" INTPTR_FORMAT "]", x);
+    st->fill_to(23);
     st->print_cr("; #%d", i);
   }
   // locks for synchronization
-  st->print_cr(" - monitorend                          = " INTPTR_FORMAT, interpreter_frame_monitor_end());
   for (BasicObjectLock* current = interpreter_frame_monitor_end();
        current < interpreter_frame_monitor_begin();
        current = next_monitor_in_interpreter_frame(current)) {
-    st->print (" - lock          at " INTPTR_FORMAT " = ", current->lock());
+    st->print(" - obj    [");
+    current->obj()->print_value_on(st);
+    st->print_cr("]");
+    st->print(" - lock   [");
     current->lock()->print_on(st);
-    st->cr();
-    st->print (" - obj           at " INTPTR_FORMAT " = " INTPTR_FORMAT " ", current->obj_addr(), *current->obj_addr());
-    current->obj()->print_value_on(st);
-    st->cr();
+    st->print_cr("]");
   }
-  st->print_cr(" - monitorbegin                        = " INTPTR_FORMAT, interpreter_frame_monitor_begin());
-  
-  // bcp/bcx
-  st->print   (" - bcp           at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_bcx_addr(), interpreter_frame_bcp());
-  st->fill_to(70);
-  st->print_cr("; @%d - %s", interpreter_frame_bci(), Bytecodes::name(interpreter_frame_method()->code_at(interpreter_frame_bci())));
+  // monitor
+  st->print_cr(" - monitor[" INTPTR_FORMAT "]", interpreter_frame_monitor_begin());
+  // bcp
+  st->print(" - bcp    [" INTPTR_FORMAT "]", interpreter_frame_bcp());
+  st->fill_to(23);
+  st->print_cr("; @%d", interpreter_frame_bci());
   // locals
-  st->print_cr(" - locals        at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_locals_addr(), *interpreter_frame_locals_addr());
-  // constant pool cache
-  st->print_cr(" - constant pool at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_cache_addr(), *interpreter_frame_cache_addr());
-  // method data
-  st->print_cr(" - method data   at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_mdx_addr(), *interpreter_frame_mdx_addr());
+  st->print_cr(" - locals [" INTPTR_FORMAT "]", interpreter_frame_local_at(0));
   // method
-  st->print   (" - method        at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_method_addr(), *interpreter_frame_method_addr());
-  st->fill_to(70);
+  st->print(" - method [" INTPTR_FORMAT "]", (address)interpreter_frame_method());
+  st->fill_to(23);
   st->print("; ");
   interpreter_frame_method()->print_name(st);
   st->cr();
-#ifdef AMD64
-  // last sp
-  st->print_cr(" - last sp       at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_last_sp_addr(), *interpreter_frame_last_sp_addr());
-#endif
-  // sender sp
-  st->print_cr(" - sender sp     at " INTPTR_FORMAT " = " INTPTR_FORMAT, interpreter_frame_sender_sp_addr(), *interpreter_frame_sender_sp_addr());
-  // old fp
-  st->print_cr(" - old fp        at " INTPTR_FORMAT " = " INTPTR_FORMAT, link_addr(), *link_addr());
-  // return address
-  st->print_cr(" - return pc     at " INTPTR_FORMAT " = " INTPTR_FORMAT, sender_pc_addr(), *sender_pc_addr());
-
-  // locals
-  for (i = interpreter_frame_method()->max_locals() - 1; i >= 0; i--) {
-    intptr_t* x = interpreter_frame_local_at(i);
-    st->print (" - local         at " INTPTR_FORMAT " = " INTPTR_FORMAT, x, *x);
-    st->fill_to(70);
-    st->print_cr("; #%d", i);
-  }
-
-  // fp
-  st->print_cr(" - fp                                  = " INTPTR_FORMAT, fp());
 #endif
 }
 
@@ -735,9 +712,8 @@
     } else if (_cb->is_nmethod()) {
       Method* m = ((nmethod *)_cb)->method();
       if (m != NULL) {
-        address code = _cb->code_begin();
         m->name_and_sig_as_C_string(buf, buflen);
-        st->print("J  %s [" PTR_FORMAT "+%d]", buf, code, pc() - code);
+        st->print("J  %s", buf);
       } else {
         st->print("J  " PTR_FORMAT, pc());
       }
--- a/src/share/vm/runtime/frame.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/frame.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -204,11 +204,9 @@
  public:
   // Link (i.e., the pointer to the previous frame)
   intptr_t* link() const;
-  intptr_t** link_addr() const;
   void set_link(intptr_t* addr);
 
   // Return address
-  address* sender_pc_addr() const;
   address  sender_pc() const;
 
   // Support for deoptimization
@@ -305,7 +303,6 @@
   jint  interpreter_frame_expression_stack_size() const;
 
   intptr_t* interpreter_frame_sender_sp() const;
-  intptr_t** interpreter_frame_sender_sp_addr() const;
 
 #ifndef CC_INTERP
   // template based interpreter deoptimization support
--- a/src/share/vm/runtime/globals.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/globals.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -1218,9 +1218,6 @@
   notproduct(bool, TraceJVMCalls, false,                                    \
           "Trace JVM calls")                                                \
                                                                             \
-  product(bool, TraceSignals, false,                                        \
-          "Trace signals and implicit exception handling")                  \
-                                                                            \
   product(ccstr, TraceJVMTI, NULL,                                          \
           "Trace flags for JVMTI functions and events")                     \
                                                                             \
@@ -1252,7 +1249,7 @@
   develop(bool, TraceClassInitialization, false,                            \
           "Trace class initialization")                                     \
                                                                             \
-  product(bool, TraceExceptions, false,                                     \
+  develop(bool, TraceExceptions, false,                                     \
           "Trace exceptions")                                               \
                                                                             \
   develop(bool, TraceICs, false,                                            \
@@ -2621,9 +2618,6 @@
   diagnostic(bool, PrintInterpreter, false,                                 \
           "Prints the generated interpreter code")                          \
                                                                             \
-  product(bool, PrintMachineCodeToFile, false,                              \
-          "Prints the generated machine code to a file (int + comp)")       \
-                                                                            \
   product(bool, UseInterpreter, true,                                       \
           "Use interpreter for non-compiled methods")                       \
                                                                             \
--- a/src/share/vm/runtime/init.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/init.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -35,7 +35,6 @@
 #include "runtime/safepoint.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "utilities/macros.hpp"
-#include "utilities/machineCodePrinter.hpp"
 
 // Initialization done by VM thread in vm_init_globals()
 void check_ThreadShadow();
@@ -88,10 +87,6 @@
   mutex_init();
   chunkpool_init();
   perfMemory_init();
-
-  if(PrintMachineCodeToFile) {
-    MachineCodePrinter::initialize();
-  }
 }
 
 
--- a/src/share/vm/runtime/java.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/java.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -249,13 +249,10 @@
     Runtime1::print_statistics();
     Deoptimization::print_statistics();
     SharedRuntime::print_statistics();
+    nmethod::print_statistics();
   }
 #endif /* COMPILER1 */
 
-  if(PrintNMethodStatistics) {
-    nmethod::print_statistics();
-  }
-
 #ifdef COMPILER2
   if ((PrintOptoStatistics || LogVMOutput || LogCompilation) && UseCompiler) {
     FlagSetting fs(DisplayVMOutput, DisplayVMOutput && PrintOptoStatistics);
@@ -376,10 +373,6 @@
     CompileBroker::print_times();
   }
 
-  if(PrintNMethodStatistics) {
-    nmethod::print_statistics();
-  }
-
   if (PrintCodeCache) {
     MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
     CodeCache::print();
--- a/src/share/vm/runtime/javaCalls.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/javaCalls.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -39,21 +39,7 @@
 #include "runtime/mutexLocker.hpp"
 #include "runtime/signature.hpp"
 #include "runtime/stubRoutines.hpp"
-#ifdef HIGH_LEVEL_INTERPRETER
-# include "graal/graalVMToInterpreter.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_linux
-# include "thread_linux.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_solaris
-# include "thread_solaris.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_windows
-# include "thread_windows.inline.hpp"
-#endif
-#ifdef TARGET_OS_FAMILY_bsd
-# include "thread_bsd.inline.hpp"
-#endif
+#include "runtime/thread.inline.hpp"
 
 // -----------------------------------------------------
 // Implementation of JavaCallWrapper
@@ -335,19 +321,10 @@
   assert(THREAD->is_Java_thread(), "only JavaThreads can make JavaCalls");
   // Need to wrap each and everytime, since there might be native code down the
   // stack that has installed its own exception handlers
-  os::os_exception_wrapper(call_helper, result, &method, NULL, args, THREAD);
+  os::os_exception_wrapper(call_helper, result, &method, args, THREAD);
 }
 
-void JavaCalls::call(JavaValue* result, methodHandle method, nmethod* nm, JavaCallArguments* args, TRAPS) {
-  // Check if we need to wrap a potential OS exception handler around thread
-  // This is used for e.g. Win32 structured exception handlers
-  assert(THREAD->is_Java_thread(), "only JavaThreads can make JavaCalls");
-  // Need to wrap each and everytime, since there might be native code down the
-  // stack that has installed its own exception handlers
-  os::os_exception_wrapper(call_helper, result, &method, nm, args, THREAD);
-}
-
-void JavaCalls::call_helper(JavaValue* result, methodHandle* m, nmethod* nm, JavaCallArguments* args, TRAPS) {
+void JavaCalls::call_helper(JavaValue* result, methodHandle* m, JavaCallArguments* args, TRAPS) {
   methodHandle method = *m;
   JavaThread* thread = (JavaThread*)THREAD;
   assert(thread->is_Java_thread(), "must be called by a java thread");
@@ -373,6 +350,7 @@
   }
 #endif
 
+
 #ifdef ASSERT
   { InstanceKlass* holder = method->method_holder();
     // A klass might not be initialized since JavaCall's might be used during the executing of
@@ -427,26 +405,18 @@
     os::bang_stack_shadow_pages();
   }
 
+#ifdef GRAAL
+  nmethod* nm = args->alternative_target();
   if (nm != NULL) {
-#ifdef GRAAL
     if (nm->is_alive()) {
       ((JavaThread*) THREAD)->set_graal_alternate_call_target(nm->verified_entry_point());
       entry_point = method->adapter()->get_i2c_entry();
     } else {
       THROW(vmSymbols::MethodInvalidatedException());
     }
-#else
-    ShouldNotReachHere();
+  }
 #endif
-  }
   
-#ifdef HIGH_LEVEL_INTERPRETER
-  if (thread->high_level_interpreter_in_vm() && !method->is_native() && Interpreter::contains(entry_point)) {
-    assert(nm == NULL || !nm->is_alive(), "otherwise nm should be invoked");
-    VMToInterpreter::execute(result, m, args, result->get_type(), thread);
-    oop_result_flag = false; // result already holds the correct value
-  } else
-#endif
   // do call
   { JavaCallWrapper link(method, receiver, result, CHECK);
     { HandleMark hm(thread);  // HandleMark used by HandleMarkCleaner
@@ -482,6 +452,7 @@
   }
 }
 
+
 //--------------------------------------------------------------------------------------
 // Implementation of JavaCallArguments
 
--- a/src/share/vm/runtime/javaCalls.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/javaCalls.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -98,6 +98,9 @@
   int         _size;
   int         _max_size;
   bool        _start_at_zero;      // Support late setting of receiver
+#ifdef GRAAL
+  nmethod*    _alternative_target; // Nmethod that should be called instead of normal target
+#endif
 
   void initialize() {
     // Starts at first element to support set_receiver.
@@ -107,6 +110,7 @@
     _max_size = _default_size;
     _size = 0;
     _start_at_zero = false;
+    GRAAL_ONLY(_alternative_target = NULL;)
   }
 
  public:
@@ -128,11 +132,22 @@
       _max_size = max_size;
       _size = 0;
       _start_at_zero = false;
+      GRAAL_ONLY(_alternative_target = NULL;)
     } else {
       initialize();
     }
   }
 
+#ifdef GRAAL
+  void set_alternative_target(nmethod* target) {
+    _alternative_target = target;
+  }
+
+  nmethod* alternative_target() {
+    return _alternative_target;
+  }
+#endif
+
   inline void push_oop(Handle h)    { _is_oop[_size] = true;
                                JNITypes::put_obj((oop)h.raw_value(), _value, _size); }
 
@@ -148,12 +163,6 @@
   inline void push_float(float f)   { _is_oop[_size] = false;
                                JNITypes::put_float(f, _value, _size); }
 
-  inline oop* get_raw_oop(int& pos)   { return (oop*)JNITypes::get_obj(_value, pos); }
-  inline jint get_int(int& pos)       { return JNITypes::get_int(_value, pos); }
-  inline jdouble get_double(int& pos) { return JNITypes::get_double(_value, pos); }
-  inline jlong get_long(int& pos)     { return JNITypes::get_long(_value, pos); }
-  inline jfloat get_float(int& pos)   { return JNITypes::get_float(_value, pos); }
-
   // receiver
   Handle receiver() {
     assert(_size > 0, "must at least be one argument");
@@ -185,8 +194,8 @@
 //
 
 class JavaCalls: AllStatic {
-  static void call_helper(JavaValue* result, methodHandle* method, nmethod* nm, JavaCallArguments* args, TRAPS);
-public:
+  static void call_helper(JavaValue* result, methodHandle* method, JavaCallArguments* args, TRAPS);
+ public:
   // Optimized Constuctor call
   static void call_default_constructor(JavaThread* thread, methodHandle method, Handle receiver, TRAPS);
 
@@ -225,7 +234,6 @@
 
   // Low-level interface
   static void call(JavaValue* result, methodHandle method, JavaCallArguments* args, TRAPS);
-  static void call(JavaValue* result, methodHandle method, nmethod* nm, JavaCallArguments* args, TRAPS);
 };
 
 #endif // SHARE_VM_RUNTIME_JAVACALLS_HPP
--- a/src/share/vm/runtime/os.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/os.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -79,7 +79,7 @@
 };
 
 // Typedef for structured exception handling support
-typedef void (*java_call_t)(JavaValue* value, methodHandle* method, nmethod* nm, JavaCallArguments* args, Thread* thread);
+typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
 
 class os: AllStatic {
  public:
@@ -658,7 +658,7 @@
   static void init_random(long initval);   // initialize random sequence
 
   // Structured OS Exception support
-  static void os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, nmethod* nm, JavaCallArguments* args, Thread* thread);
+  static void os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
 
   // On Windows this will create an actual minidump, on Linux/Solaris it will simply check core dump limits
   static void check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize);
--- a/src/share/vm/runtime/reflectionUtils.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/reflectionUtils.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -26,9 +26,6 @@
 #include "classfile/javaClasses.hpp"
 #include "memory/universe.inline.hpp"
 #include "runtime/reflectionUtils.hpp"
-#ifdef GRAAL
-#include "graal/graalJavaAccess.hpp"
-#endif
 
 KlassStream::KlassStream(instanceKlassHandle klass, bool local_only, bool classes_only) {
   _klass = klass;
--- a/src/share/vm/runtime/safepoint.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/safepoint.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -80,9 +80,6 @@
 #ifdef COMPILER1
 #include "c1/c1_globals.hpp"
 #endif
-#ifdef GRAAL
-#include "graal/graalGlobals.hpp"
-#endif
 
 // --------------------------------------------------------------------------------------------------
 // Implementation of Safepoint begin/end
--- a/src/share/vm/runtime/sharedRuntime.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/sharedRuntime.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -773,9 +773,6 @@
 #ifdef GRAAL
 address SharedRuntime::deoptimize_for_implicit_exception(JavaThread* thread, address pc, nmethod* nm, int deopt_reason) {
   assert(deopt_reason > Deoptimization::Reason_none && deopt_reason < Deoptimization::Reason_LIMIT, "invalid deopt reason");
-  if (TraceSignals) {
-    tty->print_cr(err_msg("Deoptimizing on implicit exception at relative pc=%d in method %s", pc - nm->entry_point(), nm->method()->name()->as_C_string()));
-  }
   thread->_ScratchA = (intptr_t)pc;
   thread->_ScratchB = Deoptimization::make_trap_request((Deoptimization::DeoptReason)deopt_reason, Deoptimization::Action_reinterpret);
   return (SharedRuntime::deopt_blob()->implicit_exception_uncommon_trap());
@@ -899,9 +896,6 @@
 #endif
 #ifdef GRAAL
         if (nm->is_compiled_by_graal()) {
-          if (TraceSignals) {
-            tty->print_cr("Graal implicit div0");
-          }
           target_pc = deoptimize_for_implicit_exception(thread, pc, nm, Deoptimization::Reason_div0_check);
         } else {
 #endif
--- a/src/share/vm/runtime/stackValue.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/stackValue.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -118,22 +118,6 @@
          val = (oop)NULL;
       }
 #endif
-#ifndef PRODUCT
-      if (val != NULL && !val->is_oop()) {
-        ResourceMark rm;
-        tty->print_cr("found wrong oop " INTPTR_FORMAT " at location " INTPTR_FORMAT " (%d):", val, value_addr, val->is_oop());
-        if (fr->cb() != NULL) {
-          CodeBlob* cb = fr->cb();
-          if (cb->is_nmethod()) {
-            nmethod* nm = (nmethod*)cb;
-            tty->print_cr("method is %s", nm->method()->name()->as_C_string());
-          }
-        }
-        sv->print();
-        tty->print_cr("");
-        tty->print_cr("one less %d; one more %d", (*(((oop *)value_addr) - 1))->is_oop(), (*(((oop *)value_addr) + 1))->is_oop());
-      }
-#endif
       Handle h(val); // Wrap a handle around the oop
       return new StackValue(h);
     }
--- a/src/share/vm/runtime/thread.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/thread.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -1410,7 +1410,6 @@
   // Set the claimed par_id to -1 (ie not claiming any par_ids)
   set_claimed_par_id(-1);
   
-  _env   = NULL;
   _buffer_blob = NULL;
   set_saved_exception_pc(NULL);
   set_threadObj(NULL);
@@ -1441,10 +1440,6 @@
   _stack_guard_state = stack_guard_unused;
 #ifdef GRAAL
   _graal_alternate_call_target = NULL;
-  _debug_scope = NULL;
-#endif
-#ifdef HIGH_LEVEL_INTERPRETER
-  _high_level_interpreter_in_vm = false;
 #endif
   _exception_oop = NULL;
   _exception_pc  = 0;
@@ -2194,9 +2189,7 @@
 
   // Do not throw asynchronous exceptions against the compiler thread
   // (the compiler thread should not be a Java thread -- fix in 1.4.2)
-
-  // (thomaswue) May we do this?
-  //if (is_Compiler_thread()) return;
+  if (is_Compiler_thread()) return;
 
   {
     // Actually throw the Throwable against the target Thread - however
@@ -3240,6 +3233,7 @@
 // Create a CompilerThread
 CompilerThread::CompilerThread(CompileQueue* queue, CompilerCounters* counters)
 : JavaThread(&compiler_thread_entry) {
+  _env   = NULL;
   _log   = NULL;
   _task  = NULL;
   _queue = queue;
--- a/src/share/vm/runtime/thread.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/thread.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -769,13 +769,10 @@
   JavaThread*    _next;                          // The next thread in the Threads list
   oop            _threadObj;                     // The Java level thread object
 
-  // (thomaswue) Necessary for holding a compilation buffer and ci environment.
+  // (thomaswue) Necessary for holding a compilation buffer.
   // Moved up from CompilerThread to JavaThread in order to enable code
   // installation from Java application code.
   BufferBlob*   _buffer_blob;
-  ciEnv*        _env;
-  bool          _is_compiling;
-
 #ifdef ASSERT
  private:
   int _java_call_counter;
@@ -905,12 +902,7 @@
 
 #ifdef GRAAL
   address _graal_alternate_call_target;
-  DebugScopedValue* _debug_scope;
 #endif
-#ifdef HIGH_LEVEL_INTERPRETER
-  bool _high_level_interpreter_in_vm;
-#endif
-
   StackGuardState        _stack_guard_state;
 
   nmethod*      _scanned_nmethod;  // nmethod being scanned by the sweeper
@@ -923,6 +915,9 @@
   volatile address _exception_handler_pc;        // PC for handler of exception
   volatile int     _is_method_handle_return;     // true (== 1) if the current exception PC is a MethodHandle call site.
 
+  // support for compilation
+  bool    _is_compiling;                         // is true if a compilation is active inthis thread (one compilation per thread possible)
+
   // support for JNI critical regions
   jint    _jni_active_critical;                  // count of entries into JNI critical region
 
@@ -982,13 +977,7 @@
   struct JNINativeInterface_* get_jni_functions() {
     return (struct JNINativeInterface_ *)_jni_environment.functions;
   }
-  
-  bool is_compiling() const                      { return _is_compiling; }
-  void set_compiling(bool b)                     { _is_compiling = b; }
 
-  // Get/set the thread's compilation environment.
-  ciEnv*        env()                            { return _env; }
-  void          set_env(ciEnv* env)              { _env = env; }
 
   BufferBlob*   get_buffer_blob()                { return _buffer_blob; }
   void          set_buffer_blob(BufferBlob* b)   { _buffer_blob = b; };
@@ -1018,6 +1007,10 @@
   // Testers
   virtual bool is_Java_thread() const            { return true;  }
 
+  // compilation
+  void set_is_compiling(bool f)                  { _is_compiling = f; }
+  bool is_compiling() const                      { return _is_compiling; }
+
   // Thread chain operations
   JavaThread* next() const                       { return _next; }
   void set_next(JavaThread* p)                   { _next = p; }
@@ -1283,13 +1276,6 @@
 
 #ifdef GRAAL
   void set_graal_alternate_call_target(address a) { _graal_alternate_call_target = a; }
-
-  DebugScopedValue* debug_scope() const                { return _debug_scope; }
-  void set_debug_scope(DebugScopedValue* ds)           { _debug_scope = ds; }
-#endif
-#ifdef HIGH_LEVEL_INTERPRETER
-  bool high_level_interpreter_in_vm()            { return _high_level_interpreter_in_vm; }
-  void set_high_level_interpreter_in_vm(bool value) { _high_level_interpreter_in_vm = value; }
 #endif
 
   // Exception handling for compiled methods
@@ -1374,9 +1360,6 @@
 #ifdef GRAAL
   static ByteSize graal_alternate_call_target_offset() { return byte_offset_of(JavaThread, _graal_alternate_call_target); }
 #endif
-#ifdef HIGH_LEVEL_INTERPRETER
-  static ByteSize high_level_interpreter_in_vm_offset() { return byte_offset_of(JavaThread, _high_level_interpreter_in_vm); }
-#endif
   static ByteSize exception_oop_offset()         { return byte_offset_of(JavaThread, _exception_oop       ); }
   static ByteSize exception_pc_offset()          { return byte_offset_of(JavaThread, _exception_pc        ); }
   static ByteSize exception_handler_pc_offset()  { return byte_offset_of(JavaThread, _exception_handler_pc); }
@@ -1832,6 +1815,7 @@
  private:
   CompilerCounters* _counters;
 
+  ciEnv*        _env;
   CompileLog*   _log;
   CompileTask*  _task;
   CompileQueue* _queue;
@@ -1845,18 +1829,15 @@
 
   bool is_Compiler_thread() const                { return true; }
   // Hide this compiler thread from external view.
-  // (thomaswue) For Graal, the compiler thread should be visible.
-  bool is_hidden_from_external_view() const      {
-#ifdef GRAALVM
-    return !DebugGraal;
-#else
-    return true;
-#endif
-  }
+  bool is_hidden_from_external_view() const      { return true; }
 
   CompileQueue* queue()                          { return _queue; }
   CompilerCounters* counters()                   { return _counters; }
 
+  // Get/set the thread's compilation environment.
+  ciEnv*        env()                            { return _env; }
+  void          set_env(ciEnv* env)              { _env = env; }
+
   // Get/set the thread's logging information
   CompileLog*   log()                            { return _log; }
   void          init_log(CompileLog* log) {
--- a/src/share/vm/runtime/vframe.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/vframe.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -266,8 +266,8 @@
 
   // Get oopmap describing oops and int for current bci
   InterpreterOopMap oop_mask;
-  if (PrintDeoptimizationDetails) {
-    methodHandle m_h(method());
+  if (TraceDeoptimization && Verbose) {
+    methodHandle m_h(thread(), method());
     OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
   } else {
     method()->mask_for(bci(), &oop_mask);
@@ -333,7 +333,7 @@
 
   InterpreterOopMap oop_mask;
   // Get oopmap describing oops and int for current bci
-  if (PrintDeoptimizationDetails) {
+  if (TraceDeoptimization && Verbose) {
     methodHandle m_h(method());
     OopMapCache::compute_one_oop_map(m_h, bci(), &oop_mask);
   } else {
--- a/src/share/vm/runtime/vframeArray.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/vframeArray.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -63,7 +63,7 @@
   _method = vf->method();
   _bci    = vf->raw_bci();
   _reexecute = vf->should_reexecute();
-  
+
   int index;
 
   // Get the monitors off-stack
@@ -429,6 +429,11 @@
     RegisterMap map(thread);
     vframe* f = vframe::new_vframe(iframe(), &map, thread);
     f->print();
+
+    tty->print_cr("locals size     %d", locals()->size());
+    tty->print_cr("expression size %d", expressions()->size());
+
+    method()->print_value();
     tty->cr();
     // method()->print_codes();
   } else if (TraceDeoptimization) {
--- a/src/share/vm/runtime/vframe_hp.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/vframe_hp.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -70,12 +70,6 @@
     }
   }
 
-  if (PrintDeoptimizationDetails) {
-    tty->print_cr("bci=%d length=%d", this->bci(), length);
-    tty->print_cr(err_msg("method name = %s", this->method()->name()->as_C_string()));
-    tty->print_cr("relative pc=%d", this->fr().pc() - this->nm()->code_begin());
-  }
-
   for( int i = 0; i < length; i++ ) {
     result->add( create_stack_value(scv_list->at(i)) );
   }
--- a/src/share/vm/runtime/vframe_hp.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/vframe_hp.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -66,7 +66,7 @@
   // Returns SynchronizationEntryBCI or bci() (used for synchronization)
   int raw_bci() const;
 
- //protected:
+ protected:
   ScopeDesc* _scope;
 
 
--- a/src/share/vm/runtime/vmStructs.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/runtime/vmStructs.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -209,7 +209,7 @@
 // type name, indicating an "opaque" type to the serviceability agent.
 
 // NOTE: there is an interdependency between this file and
-// HotSpotJavaTypeDataBase.java, which parses the type strings.
+// HotSpotTypeDataBase.java, which parses the type strings.
 
 #ifndef REG_COUNT
   #define REG_COUNT 0
@@ -2384,32 +2384,26 @@
   declare_constant(Location::on_stack)                                    \
   declare_constant(Location::in_register)                                 \
                                                                           \
-  /* TODO (chaeubl) those constants should be graal/c1/c2 specific */         \
-  /*declare_constant(Deoptimization::Reason_many)*/                           \
-  /*declare_constant(Deoptimization::Reason_none)*/                           \
-  /*declare_constant(Deoptimization::Reason_null_check)*/                     \
-  /*declare_constant(Deoptimization::Reason_range_check)*/                    \
-  /*declare_constant(Deoptimization::Reason_class_check)*/                    \
-  /*declare_constant(Deoptimization::Reason_array_check)*/                    \
-  /*declare_constant(Deoptimization::Reason_unreached)*/                      \
-  /*declare_constant(Deoptimization::Reason_constraint)*/                     \
-  /*declare_constant(Deoptimization::Reason_div0_check)*/                     \
-  /*declare_constant(Deoptimization::Reason_type_checked_inlining)*/          \
-  /*declare_constant(Deoptimization::Reason_optimized_type_check)*/           \
-  /*declare_constant(Deoptimization::Reason_not_compiled_exception_handler)*/ \
-  /*declare_constant(Deoptimization::Reason_unresolved)*/                     \
-  /*declare_constant(Deoptimization::Reason_jsr_mismatch)*/                   \
-  /*declare_constant(Deoptimization::Reason_LIMIT)*/                          \
-  /*declare_constant(Deoptimization::Reason_RECORDED_LIMIT)*/                 \
-  /*declare_constant(Deoptimization::Reason_null_assert)*/                    \
-  /*declare_constant(Deoptimization::Reason_intrinsic)*/                      \
-  /*declare_constant(Deoptimization::Reason_bimorphic)*/                      \
-  /*declare_constant(Deoptimization::Reason_unloaded)*/                       \
-  /*declare_constant(Deoptimization::Reason_uninitialized) */                 \
-  /*declare_constant(Deoptimization::Reason_unhandled)*/                      \
-  /*declare_constant(Deoptimization::Reason_age)*/                            \
-  /*declare_constant(Deoptimization::Reason_predicate)*/                      \
-  /*declare_constant(Deoptimization::Reason_loop_limit_check)*/               \
+  declare_constant(Deoptimization::Reason_many)                           \
+  declare_constant(Deoptimization::Reason_none)                           \
+  declare_constant(Deoptimization::Reason_null_check)                     \
+  declare_constant(Deoptimization::Reason_null_assert)                    \
+  declare_constant(Deoptimization::Reason_range_check)                    \
+  declare_constant(Deoptimization::Reason_class_check)                    \
+  declare_constant(Deoptimization::Reason_array_check)                    \
+  declare_constant(Deoptimization::Reason_intrinsic)                      \
+  declare_constant(Deoptimization::Reason_bimorphic)                      \
+  declare_constant(Deoptimization::Reason_unloaded)                       \
+  declare_constant(Deoptimization::Reason_uninitialized)                  \
+  declare_constant(Deoptimization::Reason_unreached)                      \
+  declare_constant(Deoptimization::Reason_unhandled)                      \
+  declare_constant(Deoptimization::Reason_constraint)                     \
+  declare_constant(Deoptimization::Reason_div0_check)                     \
+  declare_constant(Deoptimization::Reason_age)                            \
+  declare_constant(Deoptimization::Reason_predicate)                      \
+  declare_constant(Deoptimization::Reason_loop_limit_check)               \
+  declare_constant(Deoptimization::Reason_LIMIT)                          \
+  declare_constant(Deoptimization::Reason_RECORDED_LIMIT)                 \
                                                                           \
   /*********************/                                                 \
   /* Matcher (C2 only) */                                                 \
--- a/src/share/vm/utilities/debug.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/utilities/debug.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -830,37 +830,3 @@
 #endif
 
 #endif // !PRODUCT
-
-#ifdef GRAAL
-
-DebugScopedValue::DebugScopedValue(const char* file, int line) {
-  _file = file;
-  _line = line;
-  Thread* thread = Thread::current();
-  if (thread != NULL && thread->is_Java_thread()) {
-    JavaThread* javaThread = (JavaThread*) thread;
-    _parent = javaThread->debug_scope();
-    javaThread->set_debug_scope(this);
-  } else {
-    _parent = NULL;
-  }
-}
-
-DebugScopedValue::~DebugScopedValue() {
-  Thread* thread = Thread::current();
-  if (thread != NULL && thread->is_Java_thread()) {
-    JavaThread* javaThread = (JavaThread*) thread;
-    javaThread->set_debug_scope(_parent);
-    _parent = NULL;
-  }
-}
-
-void DebugScopedValue::print(outputStream* st) {
-  st->print("%s:%d: ", _file, _line);
-  print_on(st);
-}
-
-void DebugScopedScalar::print_on(outputStream* st) {
-  st->print("int: %d, char: %c, long: %ld, hex: %p", _value, _value, _value, _value);
-}
-#endif
--- a/src/share/vm/utilities/debug.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/utilities/debug.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -30,35 +30,6 @@
 
 #include <stdarg.h>
 
-#ifdef GRAAL
-// Scopes a value that may be of interest in a crash log.
-class DebugScopedValue {
-protected:
-  DebugScopedValue *_parent;
-  const char* _file;
-  int _line;
-public:
-  DebugScopedValue(const char* file, int line);
-  ~DebugScopedValue();
-  void print(outputStream* st);
-  virtual void print_on(outputStream* st) = 0;
-  DebugScopedValue* parent() { return _parent; }
-};
-
-class DebugScopedScalar : DebugScopedValue {
-private:
-  void* _value;
-public:
-  DebugScopedScalar(const char* file, int line, void* v) : DebugScopedValue(file, line), _value(v) {}
-  void print_on(outputStream* st);
-};
-#define DS_SCALAR(val) DebugScopedScalar __dss__(__FILE__, __LINE__, (void*) val)
-#define DS_SCALAR1(name, val) DebugScopedScalar name(__FILE__, __LINE__, (void*) val)
-#else
-#define DS_SCALAR(name) do {} while (0)
-#define DS_SCALAR1(name, val) do {} while (0)
-#endif
-
 // Simple class to format the ctor arguments into a fixed-sized buffer.
 class FormatBufferBase {
  protected:
--- a/src/share/vm/utilities/machineCodePrinter.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "precompiled.hpp"
-#include "code/stubs.hpp"
-#include "compiler/disassembler.hpp"
-#include "runtime/thread.hpp"
-#include "utilities/machineCodePrinter.hpp"
-#include "utilities/ostream.hpp"
-
-fileStream* MachineCodePrinter::_st = NULL;
-volatile int MachineCodePrinter::_write_lock = 0;
-
-void MachineCodePrinter::initialize() {
-  _st = new (ResourceObj::C_HEAP, mtInternal) fileStream("machineCode.txt");
-}
-
-void MachineCodePrinter::print(nmethod* nm) {
-  lock();
-  Disassembler::decode(nm, _st);
-  unlock();
-}
-
-void MachineCodePrinter::print(CodeBlob* cb) {
-  lock();
-  Disassembler::decode(cb, _st);
-  unlock();
-}
-
-void MachineCodePrinter::print(StubQueue* stub_queue) {
-  lock();
-  stub_queue->print_on(_st);
-  unlock();
-}
-
-void MachineCodePrinter::flush() {
-  _st->flush();
-}
-
-void MachineCodePrinter::lock() {
-  Thread::SpinAcquire(&_write_lock, "Put");
-}
-
-void MachineCodePrinter::unlock() {
-  Thread::SpinRelease(&_write_lock);
-}
--- a/src/share/vm/utilities/machineCodePrinter.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#ifndef SHARE_VM_UTILITIES_MACHINE_CODE_PRINTER_HPP
-#define SHARE_VM_UTILITIES_MACHINE_CODE_PRINTER_HPP
-
-#include "memory/allocation.hpp"
-#include "utilities/ostream.hpp"
-
-class MachineCodePrinter : public AllStatic {
-private:
-  static fileStream* _st;
-  static volatile int _write_lock;
-
-public:
-  static void initialize();
-  static void print(nmethod* nm);
-  static void print(CodeBlob* cb);
-  static void print(StubQueue* stub_queue);
-  static void flush();
-
-private:
-  static void lock();
-  static void unlock();
-};
-
-#endif // SHARE_VM_UTILITIES_MACHINE_CODE_PRINTER_HPP
--- a/src/share/vm/utilities/macros.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/utilities/macros.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -201,14 +201,6 @@
 #define NOT_GRAALVM(code) code
 #endif // GRAAL
 
-#ifdef HIGH_LEVEL_INTERPRETER
-#define HIGH_LEVEL_INTERPRETER_ONLY(code) code
-#define NOT_HIGH_LEVEL_INTERPRETER(code)
-#else
-#define HIGH_LEVEL_INTERPRETER_ONLY(code)
-#define NOT_HIGH_LEVEL_INTERPRETER(code) code
-#endif // HIGH_LEVEL_INTERPRETER
-
 #ifdef TIERED
 #define TIERED_ONLY(code) code
 #define NOT_TIERED(code)
--- a/src/share/vm/utilities/ostream.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/utilities/ostream.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -102,7 +102,6 @@
     result_len = strlen(result);
   } else {
     DEBUG_ONLY(warning("increase O_BUFLEN in ostream.hpp -- output truncated");)
-
     result = buffer;
     result_len = buflen - 1;
     buffer[result_len] = 0;
@@ -658,9 +657,7 @@
       // Print it as a java-style property list.
       // System properties don't generally contain newlines, so don't bother with unparsing.
       for (SystemProperty* p = Arguments::system_properties(); p != NULL; p = p->next()) {
-        xs->text()->print(p->key() ? p->key() : "");
-        xs->text()->print("=");
-        xs->text()->print_cr(p->value() ? p->value() : "");
+        xs->text()->print_cr("%s=%s", p->key(), p->value());
       }
       xs->tail("properties");
     }
--- a/src/share/vm/utilities/top.hpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/utilities/top.hpp	Fri Mar 08 13:19:28 2013 +0100
@@ -39,12 +39,12 @@
 #ifdef COMPILER1
 #include "c1/c1_globals.hpp"
 #endif
+#ifdef COMPILER2
+#include "opto/c2_globals.hpp"
+#endif
 #ifdef GRAAL
 #include "graal/graalGlobals.hpp"
 #endif
-#ifdef COMPILER2
-#include "opto/c2_globals.hpp"
-#endif
 
 // THIS FILE IS INTESIONALLY LEFT EMPTY
 // IT IS USED TO MINIMIZE THE NUMBER OF DEPENDENCIES IN includeDB
--- a/src/share/vm/utilities/vmError.cpp	Thu Mar 07 18:24:15 2013 +0100
+++ b/src/share/vm/utilities/vmError.cpp	Fri Mar 08 13:19:28 2013 +0100
@@ -491,30 +491,6 @@
        print_bug_submit_message(st, _thread);
      }
 
-#ifdef GRAAL
-  STEP(67, "(printing debug scope)" )
-
-     if (_verbose) {
-       if (_thread != NULL && _thread->is_Java_thread()) {
-         JavaThread* javaThread = (JavaThread*) _thread;
-         DebugScopedValue* ds = javaThread->debug_scope();
-         int level = 0;
-         while (ds != NULL) {
-           if (level == 0) {
-             st->cr();
-             st->print_cr("---------------  D E B U G  S C O P E ---------------");
-             st->cr();
-           }
-           st->print("%d: ", level);
-           ds->print(st);
-           st->cr();
-           ds = ds->parent();
-           level++;
-         }
-       }
-     }
-#endif
-
   STEP(70, "(printing thread)" )
 
      if (_verbose) {