diff src/share/vm/graal/graalCompilerToVM.hpp @ 14093:dd783f0ecf17

refactor CompilerToVM interface
author twisti
date Thu, 06 Mar 2014 15:18:47 -0800
parents 431eca622358
children a38a54030ea2
line wrap: on
line diff
--- a/src/share/vm/graal/graalCompilerToVM.hpp	Thu Mar 06 23:17:10 2014 +0100
+++ b/src/share/vm/graal/graalCompilerToVM.hpp	Thu Mar 06 15:18:47 2014 -0800
@@ -27,6 +27,27 @@
 #include "prims/jni.h"
 #include "runtime/javaCalls.hpp"
 
+class CompilerToVM {
+public:
+  /**
+   * Tag bits used by lookupKlassInPool to distinguish the types in Java.
+   */
+  enum Tags {
+    KLASS_TAG = 0x0,
+    SYMBOL_TAG = 0x1
+  };
+
+  static intptr_t tag_pointer(Klass* klass) {
+    return ((intptr_t) klass) | KLASS_TAG;
+  }
+
+  static intptr_t tag_pointer(Symbol* symbol) {
+    return ((intptr_t) symbol) | SYMBOL_TAG;
+  }
+
+  // nothing here - no need to define the jni method implementations in a header file
+};
+
 extern JNINativeMethod CompilerToVM_methods[];
 int CompilerToVM_methods_count();
 
@@ -89,6 +110,4 @@
   inline void do_void()                     { }
 };
 
-// nothing here - no need to define the jni method implementations in a header file
-
 #endif // SHARE_VM_GRAAL_GRAAL_COMPILER_TO_VM_HPP