changeset 3634:076542d505cd

Remove the need for a global stub array.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 14 Nov 2011 22:38:54 +0100
parents fc07cf6848fb
children cb1181db8bec 753443a8c4ff
files src/share/vm/graal/graalCompiler.cpp src/share/vm/graal/graalVmIds.cpp src/share/vm/graal/graalVmIds.hpp
diffstat 3 files changed, 2 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/graal/graalCompiler.cpp	Mon Nov 14 22:34:14 2011 +0100
+++ b/src/share/vm/graal/graalCompiler.cpp	Mon Nov 14 22:38:54 2011 +0100
@@ -45,8 +45,6 @@
   CompilerThread* THREAD = CompilerThread::current();
   TRACE_graal_1("GraalCompiler::initialize");
 
-  VmIds::initializeObjects();
-
   initialize_buffer_blob();
   Runtime1::initialize(THREAD->get_buffer_blob());
 
@@ -104,8 +102,6 @@
   ResourceMark rm;
   HandleMark hm;
 
-  VmIds::initializeObjects();
-
   TRACE_graal_2("GraalCompiler::compile_method");
 
   CompilerThread::current()->set_compiling(true);
--- a/src/share/vm/graal/graalVmIds.cpp	Mon Nov 14 22:34:14 2011 +0100
+++ b/src/share/vm/graal/graalVmIds.cpp	Mon Nov 14 22:38:54 2011 +0100
@@ -27,25 +27,11 @@
 
 // VmIds implementation
 
-GrowableArray<address>* VmIds::_stubs = NULL;
-
-
-void VmIds::initializeObjects() {
-  if (_stubs == NULL) {
-    assert(_localHandles == NULL, "inconsistent state");
-    _stubs = new (ResourceObj::C_HEAP) GrowableArray<address> (64, true);
-  }
-  assert(_localHandles->length() == 0, "invalid state");
-}
-
 jlong VmIds::addStub(address stub) {
-  assert(!_stubs->contains(stub), "duplicate stub");
-  return _stubs->append(stub) | STUB;
+  return (jlong)stub;
 }
 
 address VmIds::getStub(jlong id) {
-  assert((id & TYPE_MASK) == STUB, "wrong id type, STUB expected");
-  assert((id & ~TYPE_MASK) >= 0 && (id & ~TYPE_MASK) < _stubs->length(), "STUB index out of bounds");
-  return _stubs->at(id & ~TYPE_MASK);
+  return (address)id;
 }
 
--- a/src/share/vm/graal/graalVmIds.hpp	Mon Nov 14 22:34:14 2011 +0100
+++ b/src/share/vm/graal/graalVmIds.hpp	Mon Nov 14 22:38:54 2011 +0100
@@ -31,24 +31,7 @@
 
 class VmIds : public AllStatic {
 
-private:
-  static GrowableArray<address>* _stubs;
-
-  static oop getObject(jlong id);
-
 public:
-  // these constants needs to have the same values as the one in HotSpotProxy.java
-  static const jlong STUB           = 0x100000000000000LL;        // address
-  static const jlong METHOD         = 0x200000000000000LL;        // methodOop
-  static const jlong CLASS          = 0x300000000000000LL;        // klassOop
-  static const jlong CONSTANT_POOL  = 0x500000000000000LL;        // constantPoolOop
-  static const jlong CONSTANT       = 0x600000000000000LL;        // oop
-  static const jlong TYPE_MASK      = 0xf00000000000000LL;
-  static const jlong DUMMY_CONSTANT = 0x6ffffffffffffffLL;
-
-  // Initializes the VmIds for a compilation, by creating the arrays
-  static void initializeObjects();
-
   // Adds a stub address, and returns the corresponding vmId (which is of type STUB)
   static jlong addStub(address stub);