hotspot/src/share/vm/oops/constantPoolOop.hpp
void string_at_put(int which, oop str) {
{- -------------------------------------------
(1)
---------------------------------------- -}
// Overwrite the old index with a GC friendly value so
// that if G1 looks during the transition during oop_store it won't
// assert the symbol is not an oop.
*obj_at_addr_raw(which) = NULL;
{- -------------------------------------------
(1) (assert)
---------------------------------------- -}
assert(str != NULL, "resolved string shouldn't be null");
{- -------------------------------------------
(1) which 引数で指定された箇所に
str 引数で指定された文字列オブジェクトをセット.
---------------------------------------- -}
obj_at_put(which, str);
{- -------------------------------------------
(1) 該当箇所の tag を resolve 済み(JVM_CONSTANT_String)に変更.
(なお, インタープリタ中のコードでは,
tag が JVM_CONSTANT_Class になっている状態では constant pool から klassOop が取得できる,
と想定しているので,
リオーダを防ぐために release_tag_at_put() を用いてメモリバリアを張っている模様)
---------------------------------------- -}
release_tag_at_put(which, JVM_CONSTANT_String);
{- -------------------------------------------
(1)
---------------------------------------- -}
if (UseConcMarkSweepGC) {
// In case the earlier card-mark was consumed by a concurrent
// marking thread before the tag was updated, redirty the card.
obj_at_put_without_check(which, str);
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.