comparison src/share/vm/memory/oopFactory.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 f95d63e2154a
children c5a923563727
comparison
equal deleted inserted replaced
2176:27e4ea99855d 2177:3582bf76420e
62 static typeArrayOop new_permanent_shortArray(int length, TRAPS); // used for class file structures 62 static typeArrayOop new_permanent_shortArray(int length, TRAPS); // used for class file structures
63 static typeArrayOop new_permanent_intArray (int length, TRAPS); // used for class file structures 63 static typeArrayOop new_permanent_intArray (int length, TRAPS); // used for class file structures
64 64
65 static typeArrayOop new_typeArray(BasicType type, int length, TRAPS); 65 static typeArrayOop new_typeArray(BasicType type, int length, TRAPS);
66 66
67 // Symbols
68 static symbolOop new_symbol(const char* utf8_buffer, int length, TRAPS) {
69 assert(utf8_buffer != NULL, "just checking");
70 return SymbolTable::lookup(utf8_buffer, length, CHECK_NULL);
71 }
72 static void new_symbols(constantPoolHandle cp, int names_count,
73 const char** name, int* lengths,
74 int* cp_indices, unsigned int* hashValues,
75 TRAPS) {
76 SymbolTable::add(cp, names_count, name, lengths, cp_indices,
77 hashValues, CHECK);
78 }
79
80 static symbolOop new_symbol(char* name, TRAPS) { return new_symbol(name, (int)strlen(name), CHECK_NULL); }
81 static symbolOop new_symbol(const char* name, TRAPS) { return new_symbol(name, (int)strlen(name), CHECK_NULL); }
82 static symbolOop new_symbol(symbolHandle sym, int begin, int end, TRAPS) {
83 assert(begin <= end && end <= sym->utf8_length(), "just checking");
84 return SymbolTable::lookup(sym, begin, end, CHECK_NULL);
85 }
86
87 // Create symbols as above but return a handle
88 static symbolHandle new_symbol_handle(const char* name, int length, TRAPS) {
89 symbolOop sym = new_symbol(name, length, THREAD);
90 return symbolHandle(THREAD, sym);
91 }
92 static symbolHandle new_symbol_handle(char* name, TRAPS) { return new_symbol_handle(name, (int)strlen(name), CHECK_(symbolHandle())); }
93 static symbolHandle new_symbol_handle(const char* name, TRAPS) { return new_symbol_handle(name, (int)strlen(name), CHECK_(symbolHandle())); }
94
95 // Constant pools 67 // Constant pools
96 static constantPoolOop new_constantPool (int length, 68 static constantPoolOop new_constantPool (int length,
97 bool is_conc_safe, 69 bool is_conc_safe,
98 TRAPS); 70 TRAPS);
99 static constantPoolCacheOop new_constantPoolCache(int length, 71 static constantPoolCacheOop new_constantPoolCache(int length,