Mercurial > hg > graal-jvmci-8
comparison src/share/vm/prims/methodHandleWalk.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 | 70427f06ea47 |
children | c5a923563727 |
comparison
equal
deleted
inserted
replaced
2176:27e4ea99855d | 2177:3582bf76420e |
---|---|
118 if (!m->is_static()) { | 118 if (!m->is_static()) { |
119 cur_slot -= type2size[T_OBJECT]; | 119 cur_slot -= type2size[T_OBJECT]; |
120 if (cur_slot == arg_slot) | 120 if (cur_slot == arg_slot) |
121 return T_OBJECT; | 121 return T_OBJECT; |
122 } | 122 } |
123 ResourceMark rm(THREAD); | |
123 for (SignatureStream ss(m->signature()); !ss.is_done(); ss.next()) { | 124 for (SignatureStream ss(m->signature()); !ss.is_done(); ss.next()) { |
124 BasicType bt = ss.type(); | 125 BasicType bt = ss.type(); |
125 cur_slot -= type2size[bt]; | 126 cur_slot -= type2size[bt]; |
126 if (cur_slot <= arg_slot) { | 127 if (cur_slot <= arg_slot) { |
127 if (cur_slot == arg_slot) | 128 if (cur_slot == arg_slot) |
959 if (m == NULL) { | 960 if (m == NULL) { |
960 // Get the intrinsic methodOop. | 961 // Get the intrinsic methodOop. |
961 m = vmIntrinsics::method_for(iid); | 962 m = vmIntrinsics::method_for(iid); |
962 } | 963 } |
963 | 964 |
964 klassOop klass = m->method_holder(); | 965 klassOop klass = m->method_holder(); |
965 symbolOop name = m->name(); | 966 Symbol* name = m->name(); |
966 symbolOop signature = m->signature(); | 967 Symbol* signature = m->signature(); |
967 | 968 |
968 if (tailcall) { | 969 if (tailcall) { |
969 // Actually, in order to make these methods more recognizable, | 970 // Actually, in order to make these methods more recognizable, |
970 // let's put them in holder class MethodHandle. That way stack | 971 // let's put them in holder class MethodHandle. That way stack |
971 // walkers and compiler heuristics can recognize them. | 972 // walkers and compiler heuristics can recognize them. |
1139 | 1140 |
1140 // Fill the real constant pool skipping the zero element. | 1141 // Fill the real constant pool skipping the zero element. |
1141 for (int i = 1; i < _constants.length(); i++) { | 1142 for (int i = 1; i < _constants.length(); i++) { |
1142 ConstantValue* cv = _constants.at(i); | 1143 ConstantValue* cv = _constants.at(i); |
1143 switch (cv->tag()) { | 1144 switch (cv->tag()) { |
1144 case JVM_CONSTANT_Utf8: cpool->symbol_at_put( i, cv->symbol_oop() ); break; | 1145 case JVM_CONSTANT_Utf8: cpool->symbol_at_put( i, cv->symbol() ); break; |
1145 case JVM_CONSTANT_Integer: cpool->int_at_put( i, cv->get_jint() ); break; | 1146 case JVM_CONSTANT_Integer: cpool->int_at_put( i, cv->get_jint() ); break; |
1146 case JVM_CONSTANT_Float: cpool->float_at_put( i, cv->get_jfloat() ); break; | 1147 case JVM_CONSTANT_Float: cpool->float_at_put( i, cv->get_jfloat() ); break; |
1147 case JVM_CONSTANT_Long: cpool->long_at_put( i, cv->get_jlong() ); break; | 1148 case JVM_CONSTANT_Long: cpool->long_at_put( i, cv->get_jlong() ); break; |
1148 case JVM_CONSTANT_Double: cpool->double_at_put( i, cv->get_jdouble() ); break; | 1149 case JVM_CONSTANT_Double: cpool->double_at_put( i, cv->get_jdouble() ); break; |
1149 case JVM_CONSTANT_Class: cpool->klass_at_put( i, cv->klass_oop() ); break; | 1150 case JVM_CONSTANT_Class: cpool->klass_at_put( i, cv->klass_oop() ); break; |
1329 return maybe_make_temp("fetch", type, "x"); | 1330 return maybe_make_temp("fetch", type, "x"); |
1330 } | 1331 } |
1331 virtual ArgToken make_invoke(methodOop m, vmIntrinsics::ID iid, | 1332 virtual ArgToken make_invoke(methodOop m, vmIntrinsics::ID iid, |
1332 Bytecodes::Code op, bool tailcall, | 1333 Bytecodes::Code op, bool tailcall, |
1333 int argc, ArgToken* argv, TRAPS) { | 1334 int argc, ArgToken* argv, TRAPS) { |
1334 symbolOop name, sig; | 1335 Symbol* name, sig; |
1335 if (m != NULL) { | 1336 if (m != NULL) { |
1336 name = m->name(); | 1337 name = m->name(); |
1337 sig = m->signature(); | 1338 sig = m->signature(); |
1338 } else { | 1339 } else { |
1339 name = vmSymbols::symbol_at(vmIntrinsics::name_for(iid)); | 1340 name = vmSymbols::symbol_at(vmIntrinsics::name_for(iid)); |