Mercurial > hg > graal-jvmci-8
diff src/share/vm/prims/methodHandleWalk.hpp @ 2177:3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
Summary: move symbols from permgen into C heap and reference count them
Reviewed-by: never, acorn, jmasa, stefank
author | coleenp |
---|---|
date | Thu, 27 Jan 2011 16:11:27 -0800 |
parents | f2da85a9b08e |
children | 8033953d67ff |
line wrap: on
line diff
--- a/src/share/vm/prims/methodHandleWalk.hpp Thu Jan 27 13:42:28 2011 -0800 +++ b/src/share/vm/prims/methodHandleWalk.hpp Thu Jan 27 16:11:27 2011 -0800 @@ -258,16 +258,20 @@ int _tag; // Constant pool tag type. JavaValue _value; Handle _handle; + Symbol* _sym; public: // Constructor for oop types. ConstantValue(int tag, Handle con) : _tag(tag), _handle(con) { - assert(tag == JVM_CONSTANT_Utf8 || - tag == JVM_CONSTANT_Class || + assert(tag == JVM_CONSTANT_Class || tag == JVM_CONSTANT_String || tag == JVM_CONSTANT_Object, "must be oop type"); } + ConstantValue(int tag, Symbol* con) : _tag(tag), _sym(con) { + assert(tag == JVM_CONSTANT_Utf8, "must be symbol type"); + } + // Constructor for oop reference types. ConstantValue(int tag, int index) : _tag(tag) { assert(JVM_CONSTANT_Fieldref <= tag && tag <= JVM_CONSTANT_NameAndType, "must be ref type"); @@ -291,7 +295,7 @@ } int tag() const { return _tag; } - symbolOop symbol_oop() const { return (symbolOop) _handle(); } + Symbol* symbol() const { return _sym; } klassOop klass_oop() const { return (klassOop) _handle(); } oop object_oop() const { return _handle(); } int index() const { return _value.get_jint(); } @@ -336,6 +340,12 @@ return _constants.append(cv); } + int cpool_symbol_put(int tag, Symbol* con) { + if (con == NULL) return 0; + ConstantValue* cv = new ConstantValue(tag, con); + return _constants.append(cv); + } + int cpool_oop_reference_put(int tag, int first_index, int second_index) { if (first_index == 0 && second_index == 0) return 0; assert(first_index != 0 && second_index != 0, "no zero indexes"); @@ -365,8 +375,8 @@ int cpool_object_put(Handle obj) { return cpool_oop_put(JVM_CONSTANT_Object, obj); } - int cpool_symbol_put(symbolOop sym) { - return cpool_oop_put(JVM_CONSTANT_Utf8, sym); + int cpool_symbol_put(Symbol* sym) { + return cpool_symbol_put(JVM_CONSTANT_Utf8, sym); } int cpool_klass_put(klassOop klass) { return cpool_oop_put(JVM_CONSTANT_Class, klass);