# HG changeset patch # User Thomas Wuerthinger # Date 1321306734 -3600 # Node ID 076542d505cd0c449eef9f6966e1406129ebed3a # Parent fc07cf6848fbe78d7c2dd9553cf16f08bb329e39 Remove the need for a global stub array. diff -r fc07cf6848fb -r 076542d505cd src/share/vm/graal/graalCompiler.cpp --- 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); diff -r fc07cf6848fb -r 076542d505cd src/share/vm/graal/graalVmIds.cpp --- 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
* VmIds::_stubs = NULL; - - -void VmIds::initializeObjects() { - if (_stubs == NULL) { - assert(_localHandles == NULL, "inconsistent state"); - _stubs = new (ResourceObj::C_HEAP) GrowableArray
(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; } diff -r fc07cf6848fb -r 076542d505cd src/share/vm/graal/graalVmIds.hpp --- 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
* _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);