Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/deoptimization.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 | 8012aa3ccede |
children | d25d4ca69222 b92c45f2bc75 |
comparison
equal
deleted
inserted
replaced
2176:27e4ea99855d | 2177:3582bf76420e |
---|---|
394 BasicType return_type; | 394 BasicType return_type; |
395 { | 395 { |
396 HandleMark hm; | 396 HandleMark hm; |
397 methodHandle method(thread, array->element(0)->method()); | 397 methodHandle method(thread, array->element(0)->method()); |
398 Bytecode_invoke invoke = Bytecode_invoke_check(method, array->element(0)->bci()); | 398 Bytecode_invoke invoke = Bytecode_invoke_check(method, array->element(0)->bci()); |
399 return_type = invoke.is_valid() ? invoke.result_type(thread) : T_ILLEGAL; | 399 return_type = invoke.is_valid() ? invoke.result_type() : T_ILLEGAL; |
400 } | 400 } |
401 | 401 |
402 // Compute information for handling adapters and adjusting the frame size of the caller. | 402 // Compute information for handling adapters and adjusting the frame size of the caller. |
403 int caller_adjustment = 0; | 403 int caller_adjustment = 0; |
404 | 404 |
599 if (cur_code == Bytecodes::_invokevirtual || | 599 if (cur_code == Bytecodes::_invokevirtual || |
600 cur_code == Bytecodes::_invokespecial || | 600 cur_code == Bytecodes::_invokespecial || |
601 cur_code == Bytecodes::_invokestatic || | 601 cur_code == Bytecodes::_invokestatic || |
602 cur_code == Bytecodes::_invokeinterface) { | 602 cur_code == Bytecodes::_invokeinterface) { |
603 Bytecode_invoke invoke(mh, iframe->interpreter_frame_bci()); | 603 Bytecode_invoke invoke(mh, iframe->interpreter_frame_bci()); |
604 symbolHandle signature(thread, invoke.signature()); | 604 Symbol* signature = invoke.signature(); |
605 ArgumentSizeComputer asc(signature); | 605 ArgumentSizeComputer asc(signature); |
606 cur_invoke_parameter_size = asc.size(); | 606 cur_invoke_parameter_size = asc.size(); |
607 if (cur_code != Bytecodes::_invokestatic) { | 607 if (cur_code != Bytecodes::_invokestatic) { |
608 // Add in receiver | 608 // Add in receiver |
609 ++cur_invoke_parameter_size; | 609 ++cur_invoke_parameter_size; |
1154 } | 1154 } |
1155 | 1155 |
1156 if (!constant_pool->tag_at(index).is_symbol()) return; | 1156 if (!constant_pool->tag_at(index).is_symbol()) return; |
1157 | 1157 |
1158 Handle class_loader (THREAD, instanceKlass::cast(constant_pool->pool_holder())->class_loader()); | 1158 Handle class_loader (THREAD, instanceKlass::cast(constant_pool->pool_holder())->class_loader()); |
1159 symbolHandle symbol (THREAD, constant_pool->symbol_at(index)); | 1159 Symbol* symbol = constant_pool->symbol_at(index); |
1160 | 1160 |
1161 // class name? | 1161 // class name? |
1162 if (symbol->byte_at(0) != '(') { | 1162 if (symbol->byte_at(0) != '(') { |
1163 Handle protection_domain (THREAD, Klass::cast(constant_pool->pool_holder())->protection_domain()); | 1163 Handle protection_domain (THREAD, Klass::cast(constant_pool->pool_holder())->protection_domain()); |
1164 SystemDictionary::resolve_or_null(symbol, class_loader, protection_domain, CHECK); | 1164 SystemDictionary::resolve_or_null(symbol, class_loader, protection_domain, CHECK); |
1165 return; | 1165 return; |
1166 } | 1166 } |
1167 | 1167 |
1168 // then it must be a signature! | 1168 // then it must be a signature! |
1169 ResourceMark rm(THREAD); | |
1169 for (SignatureStream ss(symbol); !ss.is_done(); ss.next()) { | 1170 for (SignatureStream ss(symbol); !ss.is_done(); ss.next()) { |
1170 if (ss.is_object()) { | 1171 if (ss.is_object()) { |
1171 symbolOop s = ss.as_symbol(CHECK); | 1172 Symbol* class_name = ss.as_symbol(CHECK); |
1172 symbolHandle class_name (THREAD, s); | |
1173 Handle protection_domain (THREAD, Klass::cast(constant_pool->pool_holder())->protection_domain()); | 1173 Handle protection_domain (THREAD, Klass::cast(constant_pool->pool_holder())->protection_domain()); |
1174 SystemDictionary::resolve_or_null(class_name, class_loader, protection_domain, CHECK); | 1174 SystemDictionary::resolve_or_null(class_name, class_loader, protection_domain, CHECK); |
1175 } | 1175 } |
1176 } | 1176 } |
1177 } | 1177 } |
1244 xtty->begin_head("uncommon_trap thread='" UINTX_FORMAT"' %s", | 1244 xtty->begin_head("uncommon_trap thread='" UINTX_FORMAT"' %s", |
1245 os::current_thread_id(), | 1245 os::current_thread_id(), |
1246 format_trap_request(buf, sizeof(buf), trap_request)); | 1246 format_trap_request(buf, sizeof(buf), trap_request)); |
1247 nm->log_identity(xtty); | 1247 nm->log_identity(xtty); |
1248 } | 1248 } |
1249 symbolHandle class_name; | 1249 Symbol* class_name = NULL; |
1250 bool unresolved = false; | 1250 bool unresolved = false; |
1251 if (unloaded_class_index >= 0) { | 1251 if (unloaded_class_index >= 0) { |
1252 constantPoolHandle constants (THREAD, trap_method->constants()); | 1252 constantPoolHandle constants (THREAD, trap_method->constants()); |
1253 if (constants->tag_at(unloaded_class_index).is_unresolved_klass()) { | 1253 if (constants->tag_at(unloaded_class_index).is_unresolved_klass()) { |
1254 class_name = symbolHandle(THREAD, | 1254 class_name = constants->klass_name_at(unloaded_class_index); |
1255 constants->klass_name_at(unloaded_class_index)); | |
1256 unresolved = true; | 1255 unresolved = true; |
1257 if (xtty != NULL) | 1256 if (xtty != NULL) |
1258 xtty->print(" unresolved='1'"); | 1257 xtty->print(" unresolved='1'"); |
1259 } else if (constants->tag_at(unloaded_class_index).is_symbol()) { | 1258 } else if (constants->tag_at(unloaded_class_index).is_symbol()) { |
1260 class_name = symbolHandle(THREAD, | 1259 class_name = constants->symbol_at(unloaded_class_index); |
1261 constants->symbol_at(unloaded_class_index)); | |
1262 } | 1260 } |
1263 if (xtty != NULL) | 1261 if (xtty != NULL) |
1264 xtty->name(class_name); | 1262 xtty->name(class_name); |
1265 } | 1263 } |
1266 if (xtty != NULL && trap_mdo.not_null()) { | 1264 if (xtty != NULL && trap_mdo.not_null()) { |
1292 fr.pc(), | 1290 fr.pc(), |
1293 (int) os::current_thread_id(), | 1291 (int) os::current_thread_id(), |
1294 trap_reason_name(reason), | 1292 trap_reason_name(reason), |
1295 trap_action_name(action), | 1293 trap_action_name(action), |
1296 unloaded_class_index); | 1294 unloaded_class_index); |
1297 if (class_name.not_null()) { | 1295 if (class_name != NULL) { |
1298 tty->print(unresolved ? " unresolved class: " : " symbol: "); | 1296 tty->print(unresolved ? " unresolved class: " : " symbol: "); |
1299 class_name->print_symbol_on(tty); | 1297 class_name->print_symbol_on(tty); |
1300 } | 1298 } |
1301 tty->cr(); | 1299 tty->cr(); |
1302 } | 1300 } |