hotspot/src/share/vm/interpreter/rewriter.cpp
// After constant pool is created, revisit methods containing jsrs.
methodHandle Rewriter::rewrite_jsrs(methodHandle method, TRAPS) {
{- -------------------------------------------
(1) (ResourceMark)
---------------------------------------- -}
ResourceMark rm(THREAD);
{- -------------------------------------------
(1) (変数宣言など)
---------------------------------------- -}
ResolveOopMapConflicts romc(method);
methodHandle original_method = method;
{- -------------------------------------------
(1) ResolveOopMapConflicts::do_potential_rewrite() を呼んで,
(必要があれば) jsr 関係の書き換えを行う.
もし書き換えが行われた場合, 以前のメソッドについては,
使われないように先頭に不正命令(Bytecodes::_shouldnotreachhere)を埋めておく.
また,
---------------------------------------- -}
method = romc.do_potential_rewrite(CHECK_(methodHandle()));
if (method() != original_method()) {
// Insert invalid bytecode into original methodOop and set
// interpreter entrypoint, so that a executing this method
// will manifest itself in an easy recognizable form.
address bcp = original_method->bcp_from(0);
*bcp = (u1)Bytecodes::_shouldnotreachhere;
int kind = Interpreter::method_kind(original_method);
original_method->set_interpreter_kind(kind);
}
{- -------------------------------------------
(1)
---------------------------------------- -}
// Update monitor matching info.
if (romc.monitor_safe()) {
method->set_guaranteed_monitor_matching();
}
{- -------------------------------------------
(1) 結果をリターン
---------------------------------------- -}
return method;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.