Mercurial > hg > graal-compiler
comparison src/share/vm/ci/ciSignature.cpp @ 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 | 1d1603768966 |
comparison
equal
deleted
inserted
replaced
2176:27e4ea99855d | 2177:3582bf76420e |
---|---|
45 Arena* arena = env->arena(); | 45 Arena* arena = env->arena(); |
46 _types = new (arena) GrowableArray<ciType*>(arena, 8, 0, NULL); | 46 _types = new (arena) GrowableArray<ciType*>(arena, 8, 0, NULL); |
47 | 47 |
48 int size = 0; | 48 int size = 0; |
49 int count = 0; | 49 int count = 0; |
50 symbolHandle sh (THREAD, symbol->get_symbolOop()); | 50 ResourceMark rm(THREAD); |
51 Symbol* sh = symbol->get_symbol(); | |
51 SignatureStream ss(sh); | 52 SignatureStream ss(sh); |
52 for (; ; ss.next()) { | 53 for (; ; ss.next()) { |
53 // Process one element of the signature | 54 // Process one element of the signature |
54 ciType* type; | 55 ciType* type; |
55 if (!ss.is_object()) { | 56 if (!ss.is_object()) { |
56 type = ciType::make(ss.type()); | 57 type = ciType::make(ss.type()); |
57 } else { | 58 } else { |
58 symbolOop name = ss.as_symbol(THREAD); | 59 Symbol* name = ss.as_symbol(THREAD); |
59 if (HAS_PENDING_EXCEPTION) { | 60 if (HAS_PENDING_EXCEPTION) { |
60 type = ss.is_array() ? (ciType*)ciEnv::unloaded_ciobjarrayklass() | 61 type = ss.is_array() ? (ciType*)ciEnv::unloaded_ciobjarrayklass() |
61 : (ciType*)ciEnv::unloaded_ciinstance_klass(); | 62 : (ciType*)ciEnv::unloaded_ciinstance_klass(); |
62 env->record_out_of_memory_failure(); | 63 env->record_out_of_memory_failure(); |
63 CLEAR_PENDING_EXCEPTION; | 64 CLEAR_PENDING_EXCEPTION; |
64 } else { | 65 } else { |
65 ciSymbol* klass_name = env->get_object(name)->as_symbol(); | 66 ciSymbol* klass_name = env->get_symbol(name); |
66 type = env->get_klass_by_name_impl(_accessing_klass, klass_name, false); | 67 type = env->get_klass_by_name_impl(_accessing_klass, klass_name, false); |
67 } | 68 } |
68 } | 69 } |
69 _types->append(type); | 70 _types->append(type); |
70 if (ss.at_return_type()) { | 71 if (ss.at_return_type()) { |