comparison src/hotspot/share/opto/parse3.cpp @ 54048:744dc9c33676

8217417: Decorator name typo: C2_TIGHLY_COUPLED_ALLOC Summary: Fixed typo in decorator name, variables, and comments. Reviewed-by: tschatzl
author kbarrett
date Mon, 11 Mar 2019 02:05:07 -0400
parents ec4c3c287ca7
children 17f85a8780d5
comparison
equal deleted inserted replaced
5:7324f4df6f6e 6:bd109d1f0423
53 // but this generated code will need to be made safe for execution by 53 // but this generated code will need to be made safe for execution by
54 // other threads, or the transition from interpreted to compiled code would 54 // other threads, or the transition from interpreted to compiled code would
55 // need to be guarded. 55 // need to be guarded.
56 ciInstanceKlass *field_holder = field->holder(); 56 ciInstanceKlass *field_holder = field->holder();
57 57
58 bool access_OK = false;
59 if (method->holder()->is_subclass_of(field_holder)) { 58 if (method->holder()->is_subclass_of(field_holder)) {
60 if (method->is_static()) { 59 if (method->is_static_initializer()) {
61 if (method->name() == ciSymbol::class_initializer_name()) { 60 // OK to access static fields inside initializer
62 // OK to access static fields inside initializer 61 return true;
63 access_OK = true; 62 } else if (method->is_object_initializer()) {
64 } 63 // It's also OK to access static fields inside a constructor,
65 } else { 64 // because any thread calling the constructor must first have
66 if (method->name() == ciSymbol::object_initializer_name()) { 65 // synchronized on the class by executing a '_new' bytecode.
67 // It's also OK to access static fields inside a constructor, 66 return true;
68 // because any thread calling the constructor must first have 67 }
69 // synchronized on the class by executing a '_new' bytecode. 68 }
70 access_OK = true; 69 if (C->is_compiling_clinit_for(field_holder)) {
71 } 70 return true; // access in the context of static initializer
72 } 71 }
73 } 72 return false;
74
75 return access_OK;
76
77 } 73 }
78 74
79 75
80 void Parse::do_field_access(bool is_get, bool is_field) { 76 void Parse::do_field_access(bool is_get, bool is_field) {
81 bool will_link; 77 bool will_link;