83 Symbol* klass_name,
84 bool require_local);
85
86 // Constant pool access.
87 static KlassHandle get_klass_by_index(const constantPoolHandle& cpool,
88 int klass_index,
89 bool& is_accessible,
90 KlassHandle loading_klass);
91 static void get_field_by_index(instanceKlassHandle loading_klass, fieldDescriptor& fd,
92 int field_index);
93 static methodHandle get_method_by_index(const constantPoolHandle& cpool,
94 int method_index, Bytecodes::Code bc,
95 instanceKlassHandle loading_klass);
96
97 JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter);
98
99 private:
100 CompileTask* _task;
101 int _system_dictionary_modification_counter;
102
103 // Cache JVMTI state
104 bool _jvmti_can_hotswap_or_post_breakpoint;
105 bool _jvmti_can_access_local_variables;
106 bool _jvmti_can_post_on_exceptions;
107
108 // Implementation methods for loading and constant pool access.
109 static KlassHandle get_klass_by_name_impl(KlassHandle& accessing_klass,
110 const constantPoolHandle& cpool,
111 Symbol* klass_name,
112 bool require_local);
113 static KlassHandle get_klass_by_index_impl(const constantPoolHandle& cpool,
114 int klass_index,
115 bool& is_accessible,
116 KlassHandle loading_klass);
117 static void get_field_by_index_impl(instanceKlassHandle loading_klass, fieldDescriptor& fd,
118 int field_index);
119 static methodHandle get_method_by_index_impl(const constantPoolHandle& cpool,
120 int method_index, Bytecodes::Code bc,
121 instanceKlassHandle loading_klass);
122
124 static bool check_klass_accessibility(KlassHandle accessing_klass, KlassHandle resolved_klass);
125 static methodHandle lookup_method(instanceKlassHandle accessor,
126 instanceKlassHandle holder,
127 Symbol* name,
128 Symbol* sig,
129 Bytecodes::Code bc);
130
131 private:
132
133 // Is this thread currently in the VM state?
134 static bool is_in_vm();
135
136 // Helper routine for determining the validity of a compilation
137 // with respect to concurrent class loading.
138 static JVMCIEnv::CodeInstallResult check_for_system_dictionary_modification(Dependencies* target, Handle compiled_code,
139 JVMCIEnv* env, char** failure_detail);
140
141 public:
142 CompileTask* task() { return _task; }
143
144 // Register the result of a compilation.
145 static JVMCIEnv::CodeInstallResult register_method(
146 const methodHandle& target,
147 nmethod*& nm,
148 int entry_bci,
149 CodeOffsets* offsets,
150 int orig_pc_offset,
151 CodeBuffer* code_buffer,
152 int frame_words,
153 OopMapSet* oop_map_set,
154 ExceptionHandlerTable* handler_table,
155 AbstractCompiler* compiler,
156 DebugInformationRecorder* debug_info,
157 Dependencies* dependencies,
158 JVMCIEnv* env,
159 int compile_id,
160 bool has_unsafe_access,
161 bool has_wide_vector,
162 Handle installed_code,
163 Handle compiled_code,
|
83 Symbol* klass_name,
84 bool require_local);
85
86 // Constant pool access.
87 static KlassHandle get_klass_by_index(const constantPoolHandle& cpool,
88 int klass_index,
89 bool& is_accessible,
90 KlassHandle loading_klass);
91 static void get_field_by_index(instanceKlassHandle loading_klass, fieldDescriptor& fd,
92 int field_index);
93 static methodHandle get_method_by_index(const constantPoolHandle& cpool,
94 int method_index, Bytecodes::Code bc,
95 instanceKlassHandle loading_klass);
96
97 JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter);
98
99 private:
100 CompileTask* _task;
101 int _system_dictionary_modification_counter;
102
103 // Compilation result values
104 const char* _failure_reason;
105 bool _retryable;
106
107 // Cache JVMTI state
108 bool _jvmti_can_hotswap_or_post_breakpoint;
109 bool _jvmti_can_access_local_variables;
110 bool _jvmti_can_post_on_exceptions;
111
112 // Implementation methods for loading and constant pool access.
113 static KlassHandle get_klass_by_name_impl(KlassHandle& accessing_klass,
114 const constantPoolHandle& cpool,
115 Symbol* klass_name,
116 bool require_local);
117 static KlassHandle get_klass_by_index_impl(const constantPoolHandle& cpool,
118 int klass_index,
119 bool& is_accessible,
120 KlassHandle loading_klass);
121 static void get_field_by_index_impl(instanceKlassHandle loading_klass, fieldDescriptor& fd,
122 int field_index);
123 static methodHandle get_method_by_index_impl(const constantPoolHandle& cpool,
124 int method_index, Bytecodes::Code bc,
125 instanceKlassHandle loading_klass);
126
128 static bool check_klass_accessibility(KlassHandle accessing_klass, KlassHandle resolved_klass);
129 static methodHandle lookup_method(instanceKlassHandle accessor,
130 instanceKlassHandle holder,
131 Symbol* name,
132 Symbol* sig,
133 Bytecodes::Code bc);
134
135 private:
136
137 // Is this thread currently in the VM state?
138 static bool is_in_vm();
139
140 // Helper routine for determining the validity of a compilation
141 // with respect to concurrent class loading.
142 static JVMCIEnv::CodeInstallResult check_for_system_dictionary_modification(Dependencies* target, Handle compiled_code,
143 JVMCIEnv* env, char** failure_detail);
144
145 public:
146 CompileTask* task() { return _task; }
147
148 const char* failure_reason() { return _failure_reason; }
149 bool retryable() { return _retryable; }
150
151 void set_failure(const char* reason, bool retryable) {
152 _failure_reason = reason;
153 _retryable = retryable;
154 }
155
156 // Register the result of a compilation.
157 static JVMCIEnv::CodeInstallResult register_method(
158 const methodHandle& target,
159 nmethod*& nm,
160 int entry_bci,
161 CodeOffsets* offsets,
162 int orig_pc_offset,
163 CodeBuffer* code_buffer,
164 int frame_words,
165 OopMapSet* oop_map_set,
166 ExceptionHandlerTable* handler_table,
167 AbstractCompiler* compiler,
168 DebugInformationRecorder* debug_info,
169 Dependencies* dependencies,
170 JVMCIEnv* env,
171 int compile_id,
172 bool has_unsafe_access,
173 bool has_wide_vector,
174 Handle installed_code,
175 Handle compiled_code,
|