src/share/vm/ci/ciField.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
8073191-work Cdiff src/share/vm/ci/ciField.cpp
src/share/vm/ci/ciField.cpp
Print this page
*** 64,74 ****
// This adds at most one step to the binary search, an amount which
// decreases for complex compilation tasks.
// ------------------------------------------------------------------
// ciField::ciField
! ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) {
ASSERT_IN_VM;
CompilerThread *thread = CompilerThread::current();
assert(ciObjectFactory::is_initialized(), "not a shared field");
--- 64,75 ----
// This adds at most one step to the binary search, an amount which
// decreases for complex compilation tasks.
// ------------------------------------------------------------------
// ciField::ciField
! ciField::ciField(ciInstanceKlass* klass, int index) :
! _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) {
ASSERT_IN_VM;
CompilerThread *thread = CompilerThread::current();
assert(ciObjectFactory::is_initialized(), "not a shared field");
*** 171,181 ****
assert(canonical_holder == field_desc.field_holder(), "just checking");
initialize_from(&field_desc);
}
! ciField::ciField(fieldDescriptor *fd): _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) {
ASSERT_IN_VM;
// Get the field's name, signature, and type.
ciEnv* env = CURRENT_ENV;
_name = env->get_symbol(fd->name());
--- 172,183 ----
assert(canonical_holder == field_desc.field_holder(), "just checking");
initialize_from(&field_desc);
}
! ciField::ciField(fieldDescriptor *fd) :
! _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) {
ASSERT_IN_VM;
// Get the field's name, signature, and type.
ciEnv* env = CURRENT_ENV;
_name = env->get_symbol(fd->name());
*** 235,245 ****
_holder = CURRENT_ENV->get_instance_klass(fd->field_holder());
// Check to see if the field is constant.
Klass* k = _holder->get_Klass();
bool is_stable_field = FoldStableValues && is_stable();
! if (is_final() || is_stable_field) {
if (is_static()) {
// This field just may be constant. The only case where it will
// not be constant is when the field is a *special* static & final field
// whose value may change. The three examples are java.lang.System.in,
// java.lang.System.out, and java.lang.System.err.
--- 237,247 ----
_holder = CURRENT_ENV->get_instance_klass(fd->field_holder());
// Check to see if the field is constant.
Klass* k = _holder->get_Klass();
bool is_stable_field = FoldStableValues && is_stable();
! if ((is_final() && !has_initialized_final_update()) || is_stable_field) {
if (is_static()) {
// This field just may be constant. The only case where it will
// not be constant is when the field is a *special* static & final field
// whose value may change. The three examples are java.lang.System.in,
// java.lang.System.out, and java.lang.System.err.
*** 263,272 ****
--- 265,275 ----
} else {
// For CallSite objects treat the target field as a compile time constant.
assert(SystemDictionary::CallSite_klass() != NULL, "should be already initialized");
if (k == SystemDictionary::CallSite_klass() &&
_offset == java_lang_invoke_CallSite::target_offset_in_bytes()) {
+ assert(!has_initialized_final_update(), "CallSite is not supposed to have writes to final fields outside initializers");
_is_constant = true;
} else {
// Non-final & non-stable fields are not constants.
_is_constant = false;
}
*** 338,348 ****
// ------------------------------------------------------------------
// ciField::will_link
//
// Can a specific access to this field be made without causing
// link errors?
! bool ciField::will_link(ciInstanceKlass* accessing_klass,
Bytecodes::Code bc) {
VM_ENTRY_MARK;
assert(bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic ||
bc == Bytecodes::_getfield || bc == Bytecodes::_putfield,
"unexpected bytecode");
--- 341,351 ----
// ------------------------------------------------------------------
// ciField::will_link
//
// Can a specific access to this field be made without causing
// link errors?
! bool ciField::will_link(ciMethod* accessing_method,
Bytecodes::Code bc) {
VM_ENTRY_MARK;
assert(bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic ||
bc == Bytecodes::_getfield || bc == Bytecodes::_putfield,
"unexpected bytecode");
*** 361,391 ****
}
// Get and put can have different accessibility rules
bool is_put = (bc == Bytecodes::_putfield || bc == Bytecodes::_putstatic);
if (is_put) {
! if (_known_to_link_with_put == accessing_klass) {
return true;
}
} else {
! if (_known_to_link_with_get == accessing_klass) {
return true;
}
}
LinkInfo link_info(_holder->get_instanceKlass(),
_name->get_symbol(), _signature->get_symbol(),
! accessing_klass->get_Klass());
fieldDescriptor result;
LinkResolver::resolve_field(result, link_info, bc, false, KILL_COMPILE_ON_FATAL_(false));
// update the hit-cache, unless there is a problem with memory scoping:
! if (accessing_klass->is_shared() || !is_shared()) {
if (is_put) {
! _known_to_link_with_put = accessing_klass;
} else {
! _known_to_link_with_get = accessing_klass;
}
}
return true;
}
--- 364,394 ----
}
// Get and put can have different accessibility rules
bool is_put = (bc == Bytecodes::_putfield || bc == Bytecodes::_putstatic);
if (is_put) {
! if (_known_to_link_with_put == accessing_method) {
return true;
}
} else {
! if (_known_to_link_with_get == accessing_method->holder()) {
return true;
}
}
LinkInfo link_info(_holder->get_instanceKlass(),
_name->get_symbol(), _signature->get_symbol(),
! accessing_method->get_Method());
fieldDescriptor result;
LinkResolver::resolve_field(result, link_info, bc, false, KILL_COMPILE_ON_FATAL_(false));
// update the hit-cache, unless there is a problem with memory scoping:
! if (accessing_method->holder()->is_shared() || !is_shared()) {
if (is_put) {
! _known_to_link_with_put = accessing_method;
} else {
! _known_to_link_with_get = accessing_method->holder();
}
}
return true;
}
src/share/vm/ci/ciField.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File