changeset 7068:263bc2349f15

removed high-level interpreter code from HotSpot fixed VS2010 warnings and javac issues
author Christian Haeubl <haeubl@ssw.jku.at>
date Fri, 23 Nov 2012 14:08:03 +0100
parents 7ead04aea1e4
children e5ec98288b91
files graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/IfBoxingEliminationTest.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java src/share/vm/graal/graalCodeInstaller.cpp src/share/vm/graal/graalEnv.cpp src/share/vm/graal/graalInterpreterToVM.cpp src/share/vm/graal/graalInterpreterToVM.hpp src/share/vm/graal/graalVMToInterpreter.cpp src/share/vm/graal/graalVMToInterpreter.hpp src/share/vm/prims/jni.cpp src/share/vm/runtime/globals.hpp
diffstat 12 files changed, 8 insertions(+), 512 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/IfBoxingEliminationTest.java	Fri Nov 23 12:06:31 2012 +0100
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/IfBoxingEliminationTest.java	Fri Nov 23 14:08:03 2012 +0100
@@ -31,7 +31,7 @@
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.extended.*;
 import com.oracle.graal.phases.*;
-import com.oracle.graal.phases.PhasePlan.*;
+import com.oracle.graal.phases.PhasePlan.PhasePosition;
 import com.oracle.graal.phases.common.*;
 
 public class IfBoxingEliminationTest extends GraalCompilerTest {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Fri Nov 23 12:06:31 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Fri Nov 23 14:08:03 2012 +0100
@@ -39,7 +39,6 @@
 import com.oracle.graal.hotspot.*;
 import com.oracle.graal.hotspot.meta.*;
 import com.oracle.graal.hotspot.phases.*;
-import com.oracle.graal.hotspot.snippets.*;
 import com.oracle.graal.java.*;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.phases.*;
@@ -52,7 +51,6 @@
 public class VMToCompilerImpl implements VMToCompiler {
 
     private final HotSpotGraalRuntime graalRuntime;
-    private IntrinsifyArrayCopyPhase intrinsifyArrayCopy;
 
     public final HotSpotTypePrimitive typeBoolean;
     public final HotSpotTypePrimitive typeChar;
@@ -573,9 +571,6 @@
         if (onStackReplacement) {
             phasePlan.addPhase(PhasePosition.AFTER_PARSING, new OnStackReplacementPhase());
         }
-        if (GraalOptions.Intrinsify) {
-            phasePlan.addPhase(PhasePosition.HIGH_LEVEL, intrinsifyArrayCopy);
-        }
         return phasePlan;
     }
 
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java	Fri Nov 23 12:06:31 2012 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java	Fri Nov 23 14:08:03 2012 +0100
@@ -393,7 +393,7 @@
                 scanInvokes(graph.getNodes(InvokeNode.class));
                 scanInvokes(graph.getNodes(InvokeWithExceptionNode.class));
             } else {
-                scanInvokes((Iterable<? extends Node>) hints);
+                scanInvokes((Iterable<? extends Node>) (Iterable<?>) hints);
             }
         }
 
@@ -521,7 +521,7 @@
         }
     }
 
-    private static InliningPolicy createInliningPolicy(GraalCodeCacheProvider runtime, Assumptions assumptions,  OptimisticOptimizations optimisticOpts, Collection<Invoke> hints) {
+    private static InliningPolicy createInliningPolicy(GraalCodeCacheProvider runtime, Assumptions assumptions, OptimisticOptimizations optimisticOpts, Collection<Invoke> hints) {
         switch(GraalOptions.InliningPolicy) {
             case 0: return new CFInliningPolicy(createInliningDecision(), createWeightComputationPolicy(), hints, runtime, assumptions, optimisticOpts);
             case 1: return new PriorityInliningPolicy(createInliningDecision(), createWeightComputationPolicy(), hints, runtime, assumptions, optimisticOpts);
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java	Fri Nov 23 12:06:31 2012 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java	Fri Nov 23 14:08:03 2012 +0100
@@ -84,7 +84,7 @@
     private static boolean logNotInlinedMethodAndReturnFalse(Invoke invoke, String msg) {
         if (shouldLogInliningDecision()) {
             String methodString = invoke.callTarget() == null ? "callTarget=null" : invoke.callTarget().targetName();
-            logInliningDecision(methodString, false, msg);
+            logInliningDecision(methodString, false, msg, new Object[0]);
         }
         return false;
     }
@@ -92,7 +92,7 @@
     private static InlineInfo logNotInlinedMethodAndReturnNull(Invoke invoke, ResolvedJavaMethod method, String msg) {
         if (shouldLogInliningDecision()) {
             String methodString = methodName(method, invoke);
-            logInliningDecision(methodString, false, msg);
+            logInliningDecision(methodString, false, msg, new Object[0]);
         }
         return null;
     }
@@ -100,7 +100,7 @@
     private static boolean logNotInlinedMethodAndReturnFalse(Invoke invoke, ResolvedJavaMethod method, String msg) {
         if (shouldLogInliningDecision()) {
             String methodString = methodName(method, invoke);
-            logInliningDecision(methodString, false, msg);
+            logInliningDecision(methodString, false, msg, new Object[0]);
         }
         return false;
     }
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Fri Nov 23 12:06:31 2012 +0100
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Fri Nov 23 14:08:03 2012 +0100
@@ -680,7 +680,7 @@
 void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, oop site) {
   oop constant = CompilationResult_DataPatch::constant(site);
   int alignment = CompilationResult_DataPatch::alignment(site);
-  bool inlined = CompilationResult_DataPatch::inlined(site);
+  bool inlined = CompilationResult_DataPatch::inlined(site) == JNI_TRUE;
   oop kind = Constant::kind(constant);
 
   address instruction = _instructions->start() + pc_offset;
--- a/src/share/vm/graal/graalEnv.cpp	Fri Nov 23 12:06:31 2012 +0100
+++ b/src/share/vm/graal/graalEnv.cpp	Fri Nov 23 14:08:03 2012 +0100
@@ -177,7 +177,7 @@
     {
       // We have to lock the cpool to keep the oop from being resolved
       // while we are accessing it.
-      MutexLockerEx ml(cpool->lock(), THREAD);
+      MutexLockerEx ml(cpool->lock());
 
       constantTag tag = cpool->tag_at(index);
       if (tag.is_klass()) {
--- a/src/share/vm/graal/graalInterpreterToVM.cpp	Fri Nov 23 12:06:31 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2011, 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 "prims/jni.h"
-#include "runtime/javaCalls.hpp"
-#include "memory/oopFactory.hpp"
-#include "graal/graalInterpreterToVM.hpp"
-#include "graal/graalCompiler.hpp"
-#include "graal/graalCompilerToVM.hpp"
-
-#ifdef HIGH_LEVEL_INTERPRETER
-
-// public Object invoke(HotSpotResolvedJavaMethod method, boolean highLevel, Object... args);
-JNIEXPORT jobject JNICALL Java_com_oracle_graal_hotspot_HotSpotRuntimeInterpreterInterface_invoke(JNIEnv *env, jobject, jobject method, jobject args) {
-  TRACE_graal_3("InterpreterToVM::invoke");
-
-  VM_ENTRY_MARK;
-  HandleMark hm;
-  
-  assert(method != NULL, "just checking");
-  assert(thread->is_Java_thread(), "must be");
-  methodHandle mh = getMethodFromHotSpotMethod(method);
-    
-  JavaCallArguments jca;
-  JavaArgumentUnboxer jap(mh->signature(), &jca, (arrayOop) JNIHandles::resolve(args), mh->is_static());
-  
-#ifndef PRODUCT
-  if (PrintHighLevelInterpreterVMTransitions) {
-    ResourceMark rm;
-    tty->print_cr("High level interpreter -> VM (%s)", mh->name_and_sig_as_C_string());
-  }
-#endif
-
-  JavaValue result(jap.get_ret_type());
-  thread->set_high_level_interpreter_in_vm(true);
-  JavaCalls::call(&result, mh, &jca, THREAD);
-  thread->set_high_level_interpreter_in_vm(false);
-
-#ifndef PRODUCT
-  if (PrintHighLevelInterpreterVMTransitions) {
-    ResourceMark rm;
-    tty->print_cr("VM (%s) -> high level interpreter", mh->name_and_sig_as_C_string());
-  }
-#endif
-
-  if (thread->has_pending_exception()) {
-    return NULL;
-  }
-
-  if (jap.get_ret_type() == T_VOID) {
-    return NULL;
-  } else if (jap.get_ret_type() == T_OBJECT || jap.get_ret_type() == T_ARRAY) {
-    return JNIHandles::make_local((oop) result.get_jobject());
-  } else {
-    oop o = java_lang_boxing_object::create(jap.get_ret_type(), (jvalue *) result.get_value_addr(), CHECK_NULL);
-    return JNIHandles::make_local(o);
-  }
-}
-
-#define CC (char*)  /*cast a literal from (const char*)*/
-#define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(Java_com_oracle_graal_hotspot_HotSpotRuntimeInterpreterInterface_##f))
-
-#define RESOLVED_METHOD "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;"
-#define OBJECT          "Ljava/lang/Object;"
-
-JNINativeMethod InterpreterToVM_methods[] = {
-  {CC"invoke",                     CC"("RESOLVED_METHOD "["OBJECT")"OBJECT,     FN_PTR(invoke)}
-};
-
-int InterpreterToVM_methods_count() {
-  return sizeof(InterpreterToVM_methods) / sizeof(JNINativeMethod);
-}
-
-#endif // HIGH_LEVEL_INTERPRETER
--- a/src/share/vm/graal/graalInterpreterToVM.hpp	Fri Nov 23 12:06:31 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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.
- */
-
-#ifdef HIGH_LEVEL_INTERPRETER
-#ifndef SHARE_VM_GRAAL_GRAAL_INTERPRETER_TO_VM_HPP
-#define SHARE_VM_GRAAL_GRAAL_INTERPRETER_TO_VM_HPP
-
-#include "prims/jni.h"
-
-extern JNINativeMethod InterpreterToVM_methods[];
-int InterpreterToVM_methods_count();
-
-// nothing here - no need to define the jni method implementations in a header file
-
-#endif // SHARE_VM_GRAAL_GRAAL_INTERPRETER_TO_VM_HPP
-#endif // HIGH_LEVEL_INTERPRETER
--- a/src/share/vm/graal/graalVMToInterpreter.cpp	Fri Nov 23 12:06:31 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,280 +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 "graal/graalVMToInterpreter.hpp"
-#include "graal/graalInterpreterToVM.hpp"
-#include "classfile/systemDictionary.hpp"
-#include "classfile/vmSymbols.hpp"
-#include "graal/graalCompiler.hpp"
-
-#ifdef HIGH_LEVEL_INTERPRETER
-
-// those are *global* handles
-jobject VMToInterpreter::_interpreterPermObject = NULL;
-jobject VMToInterpreter::_interpreterPermKlass = NULL;
-
-class JavaArgumentBoxer : public SignatureIterator {
- protected:
-  JavaCallArguments* _args;
-  Thread* _thread;
-  objArrayHandle _obj_array;
-  int _index;
-  int _position;
-
- public:
-  JavaArgumentBoxer(Symbol* signature, objArrayHandle obj_array, JavaCallArguments* args, bool is_static, TRAPS) : SignatureIterator(signature) {
-    _obj_array = obj_array;
-    _args = args;
-    _index = _position = 0;
-    _thread = THREAD;
-    if (!is_static) {
-      push(next_object(T_OBJECT));
-    }
-    iterate();
-    assert(_index == _obj_array->length(), "arg count mismatch with signature");
-  }
-
-  inline void do_bool()   {
-    if (!is_return_type()) {
-      jvalue value;
-      value.z = (jboolean)_args->get_int(_position);
-      push(java_lang_boxing_object::create(T_BOOLEAN, &value, _thread));
-    }
-  }
-  inline void do_char()   {
-    if (!is_return_type()) {
-      jvalue value;
-      value.c = (jchar)_args->get_int(_position);
-      push(java_lang_boxing_object::create(T_CHAR, &value, _thread));
-    }
-  }
-  inline void do_short()  {
-    if (!is_return_type()) {
-      jvalue value;
-      value.s = (jshort)_args->get_int(_position);
-      push(java_lang_boxing_object::create(T_SHORT, &value, _thread));
-    }
-  }
-  inline void do_byte()   {
-    if (!is_return_type()) {
-      jvalue value;
-      value.b = (jbyte)_args->get_int(_position);
-      push(java_lang_boxing_object::create(T_BYTE, &value, _thread));
-    }
-  }
-  inline void do_int()    {
-    if (!is_return_type()) {
-      jvalue value;
-      value.i = (jint)_args->get_int(_position);
-      push(java_lang_boxing_object::create(T_INT, &value, _thread));
-    }
-  }
-
-  inline void do_long()   {
-    if (!is_return_type()) {
-      jvalue value;
-      value.j = (jlong)_args->get_long(_position);
-      push(java_lang_boxing_object::create(T_LONG, &value, _thread));
-    }
-  }
-
-  inline void do_float()  {
-    if (!is_return_type()) {
-      jvalue value;
-      value.f = (jfloat)_args->get_float(_position);
-      push(java_lang_boxing_object::create(T_FLOAT, &value, _thread));
-    }
-  }
-
-  inline void do_double() {
-    if (!is_return_type()) {
-      jvalue value;
-      value.d = (jdouble)_args->get_double(_position);
-      push(java_lang_boxing_object::create(T_DOUBLE, &value, _thread));
-    }
-  }
-
-  inline void do_object(int begin, int end) { if (!is_return_type()) push(next_object(T_OBJECT)); }
-  inline void do_array(int begin, int end)  { if (!is_return_type()) push(next_object(T_ARRAY)); }
-  inline void do_void()                     { }
-  
-  inline oop next_object(BasicType type) {
-    assert(type == T_OBJECT || type == T_ARRAY, "must be");
-    return *(_args->get_raw_oop(_position));
-  }
-  
-  inline void push(oop obj) {
-    _obj_array->obj_at_put(_index, obj);
-    _index++;
-  }
-};
-
-bool VMToInterpreter::allocate_interpreter(const char* interpreter_class_name, const char* interpreter_arguments, TRAPS) {
-  assert(_interpreterPermObject == NULL && _interpreterPermKlass == NULL, "no need to allocate twice");
-
-  HandleMark hm;
-  // load the interpreter class using its fully qualified class name
-  Symbol* class_name = SymbolTable::lookup(interpreter_class_name, (int)strlen(interpreter_class_name), CHECK_false);
-  instanceKlassHandle interpreter_klass = SystemDictionary::resolve_or_null(class_name, SystemDictionary::java_system_loader(), NULL, CHECK_false);
-  if (interpreter_klass.is_null()) {
-    tty->print_cr("Could not load HighLevelInterpreterClass '%s'", interpreter_class_name);
-    return false;
-  }
-
-  // allocate an interpreter instance
-  interpreter_klass->initialize(CHECK_false);
-  instanceHandle interpreter_instance = interpreter_klass->allocate_instance_handle(CHECK_false);
-  
-  // initialize the interpreter instance
-  Handle args;
-  if (interpreter_arguments != NULL) {
-    args = java_lang_String::create_from_platform_dependent_str(interpreter_arguments, CHECK_false);
-  }
-
-  JavaValue result(T_BOOLEAN);
-  JavaCalls::call_virtual(&result, interpreter_instance, interpreter_klass, vmSymbols::initialize_name(), vmSymbols::setOption_signature(), args, CHECK_false);
-  if (result.get_jboolean() != JNI_TRUE) {
-    tty->print_cr("Could not invoke '%s::initialize(String)'", interpreter_class_name);
-    return false;
-  }
-
-  // store the instance globally and keep it alive
-  _interpreterPermObject = JNIHandles::make_global(interpreter_instance);
-  _interpreterPermKlass = JNIHandles::make_global(interpreter_klass);
-
-  // register the native functions that are needed by the interpreter
-  {
-    assert(THREAD->is_Java_thread(), "must be");
-    JavaThread* thread = (JavaThread*) THREAD;
-    ThreadToNativeFromVM trans(thread);
-    JNIEnv *env = thread->jni_environment();
-    jclass klass = env->FindClass("com/oracle/graal/hotspot/HotSpotRuntimeInterpreterInterface");
-    if (klass == NULL) {
-      tty->print_cr("Could not find class HotSpotRuntimeInterpreterInterface");
-      return false;
-    }
-    env->RegisterNatives(klass, InterpreterToVM_methods, InterpreterToVM_methods_count());
-    if (thread->has_pending_exception()) {
-      tty->print_cr("Could not register HotSpotRuntimeInterpreterInterface native methods");
-      return false;
-    }
-  }
-
-  return true;
-}
-
-Handle VMToInterpreter::interpreter_instance() {
-  return Handle(JNIHandles::resolve_non_null(_interpreterPermObject));
-}
-
-KlassHandle VMToInterpreter::interpreter_klass() {
-  return KlassHandle(JNIHandles::resolve_non_null(_interpreterPermKlass));
-}
-
-void VMToInterpreter::execute(JavaValue* result, methodHandle* m, JavaCallArguments* args, BasicType expected_result_type, TRAPS) {
-  assert(interpreter_instance().not_null(), "must be allocated before the first call");
-  assert(THREAD->is_Java_thread(), "must be");
-  assert(m != NULL, "must be");
-  assert(args != NULL, "must be");
-
-  JavaThread* thread = (JavaThread*)THREAD;
-  methodHandle method = *m;
-  int parameter_count = ArgumentCount(method->signature()).size() + (method->is_static() ? 0 : 1);
-  objArrayHandle args_array = oopFactory::new_objArray(SystemDictionary::Object_klass(), parameter_count, CHECK);
-  JavaArgumentBoxer jab(method->signature(), args_array, args, method->is_static(), thread);
-  Handle hotspot_method = GraalCompiler::createHotSpotResolvedJavaMethod(method, CHECK);
-
-  JavaValue boxed_result(T_OBJECT);
-  JavaCallArguments boxed_args;
-  boxed_args.set_receiver(interpreter_instance());
-  boxed_args.push_oop(hotspot_method);
-  boxed_args.push_oop(args_array);
-  
-#ifndef PRODUCT
-  if (PrintHighLevelInterpreterVMTransitions) {
-    ResourceMark m;
-    tty->print_cr("VM -> high level interpreter (%s)", method->name_and_sig_as_C_string());
-  }
-#endif
-  
-  thread->set_high_level_interpreter_in_vm(false);
-  JavaCalls::call_virtual(&boxed_result, interpreter_klass(), vmSymbols::interpreter_execute_name(), vmSymbols::interpreter_execute_signature(), &boxed_args, thread);
-  thread->set_high_level_interpreter_in_vm(true);
-  
-#ifndef PRODUCT
-  if (PrintHighLevelInterpreterVMTransitions) {
-    ResourceMark m;
-    tty->print_cr("High level interpreter (%s) -> VM", method->name_and_sig_as_C_string());
-  }
-#endif
-  
-  if (HAS_PENDING_EXCEPTION) {
-    return;
-  }
-
-  // unbox the result if necessary
-  if (is_java_primitive(expected_result_type)) {
-    unbox_primitive(&boxed_result, result);
-  } else if (expected_result_type == T_OBJECT || expected_result_type == T_ARRAY) {
-    result->set_jobject(boxed_result.get_jobject());
-  }
-}
-
-void VMToInterpreter::unbox_primitive(JavaValue* boxed, JavaValue* result) {
-  oop box = JNIHandles::resolve(boxed->get_jobject());
-
-  jvalue value;
-  BasicType type = java_lang_boxing_object::get_value(box, &value);
-    switch (type) {
-    case T_BOOLEAN:
-      result->set_jint(value.z);
-      break;
-    case T_CHAR:
-      result->set_jint(value.c);
-      break;
-    case T_FLOAT:
-      result->set_jfloat(value.f);
-      break;
-    case T_DOUBLE:
-      result->set_jdouble(value.d);
-      break;
-    case T_BYTE:
-      result->set_jint(value.b);
-      break;
-    case T_SHORT:
-      result->set_jint(value.s);
-      break;
-    case T_INT:
-      result->set_jint(value.i);
-      break;
-    case T_LONG:
-      result->set_jlong(value.j);
-      break;
-    default:
-      ShouldNotReachHere();
-      break;
-  }
-}
-
-#endif // HIGH_LEVEL_INTERPRETER
--- a/src/share/vm/graal/graalVMToInterpreter.hpp	Fri Nov 23 12:06:31 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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 "memory/allocation.hpp"
-#include "oops/oop.hpp"
-#include "runtime/handles.hpp"
-#include "runtime/thread.hpp"
-#include "classfile/javaClasses.hpp"
-#include "runtime/jniHandles.hpp"
-#include "runtime/javaCalls.hpp"
-
-#ifdef HIGH_LEVEL_INTERPRETER
-#ifndef SHARE_VM_GRAAL_GRAAL_VM_TO_INTERPRETER_HPP
-#define SHARE_VM_GRAAL_GRAAL_VM_TO_INTERPRETER_HPP
-
-class VMToInterpreter : public AllStatic {
-
-private:
-  static jobject _interpreterPermObject;
-  static jobject _interpreterPermKlass;
-
-  static Handle interpreter_instance();
-  static KlassHandle interpreter_klass();
-  static void unbox_primitive(JavaValue* boxed, JavaValue* result);
-
-public:
-  static bool allocate_interpreter(const char* interpreter_class_name, const char* interpreter_arguments, TRAPS);
- 
-  // invokes the interpreter method execute(ResolvedJavaMethod method, Object... arguments)
-  static void execute(JavaValue* result, methodHandle* m, JavaCallArguments* args, BasicType expected_result_type, TRAPS);
-};
-
-#endif // SHARE_VM_GRAAL_GRAAL_VM_TO_INTERPRETER_HPP
-#endif // HIGH_LEVEL_INTERPRETER
--- a/src/share/vm/prims/jni.cpp	Fri Nov 23 12:06:31 2012 +0100
+++ b/src/share/vm/prims/jni.cpp	Fri Nov 23 14:08:03 2012 +0100
@@ -35,9 +35,6 @@
 #ifdef GRAAL
 #include "graal/graalCompiler.hpp"
 #endif
-#ifdef HIGH_LEVEL_INTERPRETER
-#include "graal/graalVMToInterpreter.hpp"
-#endif
 #ifndef SERIALGC
 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
 #endif // SERIALGC
@@ -1345,18 +1342,6 @@
   // Initialize result type (must be done after args->iterate())
   result->set_type(args->get_ret_type());
 
-#ifdef HIGH_LEVEL_INTERPRETER
-  // TODO (chaeubl): this is quite a hack. The launcher should take care about that instead.
-  bool invoked_main_method = false;
-  if (HighLevelInterpreterClass != NULL && first_time_InvokeMain && method->name() == vmSymbols::main_name() && method->result_type() == T_VOID) {
-    assert(THREAD->is_Java_thread(), "other threads must not call into java");
-    JavaThread* thread = (JavaThread*)THREAD;
-    first_time_InvokeMain = false;
-    invoked_main_method = true;
-    thread->set_high_level_interpreter_in_vm(true);
-  }
-#endif
-
   JavaCalls::call(result, method, &java_args, CHECK);
 
   // Convert result
@@ -5172,16 +5157,6 @@
       compiler->initialize();
 #endif
 
-#ifdef HIGH_LEVEL_INTERPRETER
-      if (HighLevelInterpreterClass != NULL) {
-        bool result = VMToInterpreter::allocate_interpreter(HighLevelInterpreterClass, HighLevelInterpreterArguments, thread);
-        if (!result) {
-          vm_abort(false);
-          return JNI_ERR;
-        }
-      }
-#endif
-
     // Tracks the time application was running before GC
     RuntimeService::record_application_start();
 
--- a/src/share/vm/runtime/globals.hpp	Fri Nov 23 12:06:31 2012 +0100
+++ b/src/share/vm/runtime/globals.hpp	Fri Nov 23 14:08:03 2012 +0100
@@ -623,15 +623,6 @@
   develop(bool, InlineClassNatives, true,                                   \
           "inline Class.isInstance, etc")                                   \
                                                                             \
-  product(ccstr, HighLevelInterpreterClass, NULL,                           \
-          "fully qualified class name of the high-level interpreter")       \
-                                                                            \
-  product(ccstr, HighLevelInterpreterArguments, NULL,                       \
-          "arguments that are passed to the high-level interpreter")        \
-                                                                            \
-  notproduct(bool, PrintHighLevelInterpreterVMTransitions, false,           \
-          "print transitions between VM and high-level interpreter")        \
-                                                                            \
   develop(bool, InlineThreadNatives, true,                                  \
           "inline Thread.currentThread, etc")                               \
                                                                             \