src/share/vm/ci/ciEnv.hpp

Thu, 12 Oct 2017 21:27:07 +0800

author
aoqi
date
Thu, 12 Oct 2017 21:27:07 +0800
changeset 7535
7ae4e26cb1e0
parent 6992
2c6ef90f030a
parent 6876
710a3c8b516e
child 10015
eb7ce841ccec
permissions
-rw-r--r--

merge

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 *
aoqi@0 23 */
aoqi@0 24
aoqi@0 25 #ifndef SHARE_VM_CI_CIENV_HPP
aoqi@0 26 #define SHARE_VM_CI_CIENV_HPP
aoqi@0 27
aoqi@0 28 #include "ci/ciClassList.hpp"
aoqi@0 29 #include "ci/ciObjectFactory.hpp"
aoqi@0 30 #include "classfile/systemDictionary.hpp"
aoqi@0 31 #include "code/debugInfoRec.hpp"
aoqi@0 32 #include "code/dependencies.hpp"
aoqi@0 33 #include "code/exceptionHandlerTable.hpp"
aoqi@0 34 #include "compiler/oopMap.hpp"
aoqi@0 35 #include "runtime/thread.hpp"
aoqi@0 36
aoqi@0 37 class CompileTask;
aoqi@0 38
aoqi@0 39 // ciEnv
aoqi@0 40 //
aoqi@0 41 // This class is the top level broker for requests from the compiler
aoqi@0 42 // to the VM.
aoqi@0 43 class ciEnv : StackObj {
aoqi@0 44 CI_PACKAGE_ACCESS_TO
aoqi@0 45
aoqi@0 46 friend class CompileBroker;
aoqi@0 47 friend class Dependencies; // for get_object, during logging
aoqi@0 48
aoqi@0 49 private:
aoqi@0 50 Arena* _arena; // Alias for _ciEnv_arena except in init_shared_objects()
aoqi@0 51 Arena _ciEnv_arena;
aoqi@0 52 int _system_dictionary_modification_counter;
aoqi@0 53 ciObjectFactory* _factory;
aoqi@0 54 OopRecorder* _oop_recorder;
aoqi@0 55 DebugInformationRecorder* _debug_info;
aoqi@0 56 Dependencies* _dependencies;
aoqi@0 57 const char* _failure_reason;
aoqi@0 58 int _compilable;
aoqi@0 59 bool _break_at_compile;
aoqi@0 60 int _num_inlined_bytecodes;
aoqi@0 61 CompileTask* _task; // faster access to CompilerThread::task
aoqi@0 62 CompileLog* _log; // faster access to CompilerThread::log
aoqi@0 63 void* _compiler_data; // compiler-specific stuff, if any
aoqi@0 64
aoqi@0 65 char* _name_buffer;
aoqi@0 66 int _name_buffer_len;
aoqi@0 67
aoqi@0 68 // Cache Jvmti state
aoqi@0 69 bool _jvmti_can_hotswap_or_post_breakpoint;
aoqi@0 70 bool _jvmti_can_access_local_variables;
aoqi@0 71 bool _jvmti_can_post_on_exceptions;
aoqi@0 72
aoqi@0 73 // Cache DTrace flags
aoqi@0 74 bool _dtrace_extended_probes;
aoqi@0 75 bool _dtrace_monitor_probes;
aoqi@0 76 bool _dtrace_method_probes;
aoqi@0 77 bool _dtrace_alloc_probes;
aoqi@0 78
aoqi@0 79 // Distinguished instances of certain ciObjects..
aoqi@0 80 static ciObject* _null_object_instance;
aoqi@0 81
aoqi@0 82 #define WK_KLASS_DECL(name, ignore_s, ignore_o) static ciInstanceKlass* _##name;
aoqi@0 83 WK_KLASSES_DO(WK_KLASS_DECL)
aoqi@0 84 #undef WK_KLASS_DECL
aoqi@0 85
aoqi@0 86 static ciSymbol* _unloaded_cisymbol;
aoqi@0 87 static ciInstanceKlass* _unloaded_ciinstance_klass;
aoqi@0 88 static ciObjArrayKlass* _unloaded_ciobjarrayklass;
aoqi@0 89
aoqi@0 90 static jobject _ArrayIndexOutOfBoundsException_handle;
aoqi@0 91 static jobject _ArrayStoreException_handle;
aoqi@0 92 static jobject _ClassCastException_handle;
aoqi@0 93
aoqi@0 94 ciInstance* _NullPointerException_instance;
aoqi@0 95 ciInstance* _ArithmeticException_instance;
aoqi@0 96 ciInstance* _ArrayIndexOutOfBoundsException_instance;
aoqi@0 97 ciInstance* _ArrayStoreException_instance;
aoqi@0 98 ciInstance* _ClassCastException_instance;
aoqi@0 99
aoqi@0 100 ciInstance* _the_null_string; // The Java string "null"
aoqi@0 101 ciInstance* _the_min_jint_string; // The Java string "-2147483648"
aoqi@0 102
aoqi@0 103 // Look up a klass by name from a particular class loader (the accessor's).
aoqi@0 104 // If require_local, result must be defined in that class loader, or NULL.
aoqi@0 105 // If !require_local, a result from remote class loader may be reported,
aoqi@0 106 // if sufficient class loader constraints exist such that initiating
aoqi@0 107 // a class loading request from the given loader is bound to return
aoqi@0 108 // the class defined in the remote loader (or throw an error).
aoqi@0 109 //
aoqi@0 110 // Return an unloaded klass if !require_local and no class at all is found.
aoqi@0 111 //
aoqi@0 112 // The CI treats a klass as loaded if it is consistently defined in
aoqi@0 113 // another loader, even if it hasn't yet been loaded in all loaders
aoqi@0 114 // that could potentially see it via delegation.
aoqi@0 115 ciKlass* get_klass_by_name(ciKlass* accessing_klass,
aoqi@0 116 ciSymbol* klass_name,
aoqi@0 117 bool require_local);
aoqi@0 118
aoqi@0 119 // Constant pool access.
aoqi@0 120 ciKlass* get_klass_by_index(constantPoolHandle cpool,
aoqi@0 121 int klass_index,
aoqi@0 122 bool& is_accessible,
aoqi@0 123 ciInstanceKlass* loading_klass);
aoqi@0 124 ciConstant get_constant_by_index(constantPoolHandle cpool,
aoqi@0 125 int pool_index, int cache_index,
aoqi@0 126 ciInstanceKlass* accessor);
aoqi@0 127 ciField* get_field_by_index(ciInstanceKlass* loading_klass,
aoqi@0 128 int field_index);
aoqi@0 129 ciMethod* get_method_by_index(constantPoolHandle cpool,
aoqi@0 130 int method_index, Bytecodes::Code bc,
aoqi@0 131 ciInstanceKlass* loading_klass);
aoqi@0 132
aoqi@0 133 // Implementation methods for loading and constant pool access.
aoqi@0 134 ciKlass* get_klass_by_name_impl(ciKlass* accessing_klass,
aoqi@0 135 constantPoolHandle cpool,
aoqi@0 136 ciSymbol* klass_name,
aoqi@0 137 bool require_local);
aoqi@0 138 ciKlass* get_klass_by_index_impl(constantPoolHandle cpool,
aoqi@0 139 int klass_index,
aoqi@0 140 bool& is_accessible,
aoqi@0 141 ciInstanceKlass* loading_klass);
aoqi@0 142 ciConstant get_constant_by_index_impl(constantPoolHandle cpool,
aoqi@0 143 int pool_index, int cache_index,
aoqi@0 144 ciInstanceKlass* loading_klass);
aoqi@0 145 ciField* get_field_by_index_impl(ciInstanceKlass* loading_klass,
aoqi@0 146 int field_index);
aoqi@0 147 ciMethod* get_method_by_index_impl(constantPoolHandle cpool,
aoqi@0 148 int method_index, Bytecodes::Code bc,
aoqi@0 149 ciInstanceKlass* loading_klass);
aoqi@0 150
aoqi@0 151 // Helper methods
aoqi@0 152 bool check_klass_accessibility(ciKlass* accessing_klass,
aoqi@0 153 Klass* resolved_klass);
aoqi@0 154 Method* lookup_method(InstanceKlass* accessor,
aoqi@0 155 InstanceKlass* holder,
aoqi@0 156 Symbol* name,
aoqi@0 157 Symbol* sig,
aoqi@0 158 Bytecodes::Code bc);
aoqi@0 159
aoqi@0 160 // Get a ciObject from the object factory. Ensures uniqueness
aoqi@0 161 // of ciObjects.
aoqi@0 162 ciObject* get_object(oop o) {
aoqi@0 163 if (o == NULL) {
aoqi@0 164 return _null_object_instance;
aoqi@0 165 } else {
aoqi@0 166 return _factory->get(o);
aoqi@0 167 }
aoqi@0 168 }
aoqi@0 169
aoqi@0 170 ciSymbol* get_symbol(Symbol* o) {
aoqi@0 171 if (o == NULL) {
aoqi@0 172 ShouldNotReachHere();
aoqi@0 173 return NULL;
aoqi@0 174 } else {
aoqi@0 175 return _factory->get_symbol(o);
aoqi@0 176 }
aoqi@0 177 }
aoqi@0 178
aoqi@0 179 ciMetadata* get_metadata(Metadata* o) {
aoqi@0 180 if (o == NULL) {
aoqi@0 181 return NULL;
aoqi@0 182 } else {
aoqi@0 183 return _factory->get_metadata(o);
aoqi@0 184 }
aoqi@0 185 }
aoqi@0 186
stefank@6992 187 void ensure_metadata_alive(ciMetadata* m) {
stefank@6992 188 _factory->ensure_metadata_alive(m);
stefank@6992 189 }
stefank@6992 190
aoqi@0 191 ciInstance* get_instance(oop o) {
aoqi@0 192 if (o == NULL) return NULL;
aoqi@0 193 return get_object(o)->as_instance();
aoqi@0 194 }
aoqi@0 195 ciObjArrayKlass* get_obj_array_klass(Klass* o) {
aoqi@0 196 if (o == NULL) return NULL;
aoqi@0 197 return get_metadata(o)->as_obj_array_klass();
aoqi@0 198 }
aoqi@0 199 ciTypeArrayKlass* get_type_array_klass(Klass* o) {
aoqi@0 200 if (o == NULL) return NULL;
aoqi@0 201 return get_metadata(o)->as_type_array_klass();
aoqi@0 202 }
aoqi@0 203 ciKlass* get_klass(Klass* o) {
aoqi@0 204 if (o == NULL) return NULL;
aoqi@0 205 return get_metadata(o)->as_klass();
aoqi@0 206 }
aoqi@0 207 ciInstanceKlass* get_instance_klass(Klass* o) {
aoqi@0 208 if (o == NULL) return NULL;
aoqi@0 209 return get_metadata(o)->as_instance_klass();
aoqi@0 210 }
aoqi@0 211 ciMethod* get_method(Method* o) {
aoqi@0 212 if (o == NULL) return NULL;
aoqi@0 213 return get_metadata(o)->as_method();
aoqi@0 214 }
aoqi@0 215 ciMethodData* get_method_data(MethodData* o) {
aoqi@0 216 if (o == NULL) return NULL;
aoqi@0 217 return get_metadata(o)->as_method_data();
aoqi@0 218 }
aoqi@0 219
aoqi@0 220 ciMethod* get_method_from_handle(Method* method);
aoqi@0 221
aoqi@0 222 ciInstance* get_or_create_exception(jobject& handle, Symbol* name);
aoqi@0 223
aoqi@0 224 // Get a ciMethod representing either an unfound method or
aoqi@0 225 // a method with an unloaded holder. Ensures uniqueness of
aoqi@0 226 // the result.
aoqi@0 227 ciMethod* get_unloaded_method(ciInstanceKlass* holder,
aoqi@0 228 ciSymbol* name,
aoqi@0 229 ciSymbol* signature,
aoqi@0 230 ciInstanceKlass* accessor) {
aoqi@0 231 return _factory->get_unloaded_method(holder, name, signature, accessor);
aoqi@0 232 }
aoqi@0 233
aoqi@0 234 // Get a ciKlass representing an unloaded klass.
aoqi@0 235 // Ensures uniqueness of the result.
aoqi@0 236 ciKlass* get_unloaded_klass(ciKlass* accessing_klass,
aoqi@0 237 ciSymbol* name) {
aoqi@0 238 return _factory->get_unloaded_klass(accessing_klass, name, true);
aoqi@0 239 }
aoqi@0 240
aoqi@0 241 // Get a ciKlass representing an unloaded klass mirror.
aoqi@0 242 // Result is not necessarily unique, but will be unloaded.
aoqi@0 243 ciInstance* get_unloaded_klass_mirror(ciKlass* type) {
aoqi@0 244 return _factory->get_unloaded_klass_mirror(type);
aoqi@0 245 }
aoqi@0 246
aoqi@0 247 // Get a ciInstance representing an unresolved method handle constant.
aoqi@0 248 ciInstance* get_unloaded_method_handle_constant(ciKlass* holder,
aoqi@0 249 ciSymbol* name,
aoqi@0 250 ciSymbol* signature,
aoqi@0 251 int ref_kind) {
aoqi@0 252 return _factory->get_unloaded_method_handle_constant(holder, name, signature, ref_kind);
aoqi@0 253 }
aoqi@0 254
aoqi@0 255 // Get a ciInstance representing an unresolved method type constant.
aoqi@0 256 ciInstance* get_unloaded_method_type_constant(ciSymbol* signature) {
aoqi@0 257 return _factory->get_unloaded_method_type_constant(signature);
aoqi@0 258 }
aoqi@0 259
aoqi@0 260 // See if we already have an unloaded klass for the given name
aoqi@0 261 // or return NULL if not.
aoqi@0 262 ciKlass *check_get_unloaded_klass(ciKlass* accessing_klass, ciSymbol* name) {
aoqi@0 263 return _factory->get_unloaded_klass(accessing_klass, name, false);
aoqi@0 264 }
aoqi@0 265
aoqi@0 266 // Get a ciReturnAddress corresponding to the given bci.
aoqi@0 267 // Ensures uniqueness of the result.
aoqi@0 268 ciReturnAddress* get_return_address(int bci) {
aoqi@0 269 return _factory->get_return_address(bci);
aoqi@0 270 }
aoqi@0 271
aoqi@0 272 // Get a ciMethodData representing the methodData for a method
aoqi@0 273 // with none.
aoqi@0 274 ciMethodData* get_empty_methodData() {
aoqi@0 275 return _factory->get_empty_methodData();
aoqi@0 276 }
aoqi@0 277
aoqi@0 278 // General utility : get a buffer of some required length.
aoqi@0 279 // Used in symbol creation.
aoqi@0 280 char* name_buffer(int req_len);
aoqi@0 281
aoqi@0 282 // Is this thread currently in the VM state?
aoqi@0 283 static bool is_in_vm();
aoqi@0 284
aoqi@0 285 // Helper routine for determining the validity of a compilation with
aoqi@0 286 // respect to method dependencies (e.g. concurrent class loading).
aoqi@0 287 void validate_compile_task_dependencies(ciMethod* target);
aoqi@0 288
aoqi@0 289 public:
aoqi@0 290 enum {
aoqi@0 291 MethodCompilable,
aoqi@0 292 MethodCompilable_not_at_tier,
aoqi@0 293 MethodCompilable_never
aoqi@0 294 };
aoqi@0 295
aoqi@0 296 ciEnv(CompileTask* task, int system_dictionary_modification_counter);
aoqi@0 297 // Used only during initialization of the ci
aoqi@0 298 ciEnv(Arena* arena);
aoqi@0 299 ~ciEnv();
aoqi@0 300
aoqi@0 301 OopRecorder* oop_recorder() { return _oop_recorder; }
aoqi@0 302 void set_oop_recorder(OopRecorder* r) { _oop_recorder = r; }
aoqi@0 303
aoqi@0 304 DebugInformationRecorder* debug_info() { return _debug_info; }
aoqi@0 305 void set_debug_info(DebugInformationRecorder* i) { _debug_info = i; }
aoqi@0 306
aoqi@0 307 Dependencies* dependencies() { return _dependencies; }
aoqi@0 308 void set_dependencies(Dependencies* d) { _dependencies = d; }
aoqi@0 309
aoqi@0 310 // This is true if the compilation is not going to produce code.
aoqi@0 311 // (It is reasonable to retry failed compilations.)
aoqi@0 312 bool failing() { return _failure_reason != NULL; }
aoqi@0 313
aoqi@0 314 // Reason this compilation is failing, such as "too many basic blocks".
aoqi@0 315 const char* failure_reason() { return _failure_reason; }
aoqi@0 316
aoqi@0 317 // Return state of appropriate compilability
aoqi@0 318 int compilable() { return _compilable; }
aoqi@0 319
aoqi@0 320 const char* retry_message() const {
aoqi@0 321 switch (_compilable) {
aoqi@0 322 case ciEnv::MethodCompilable_not_at_tier:
aoqi@0 323 return "retry at different tier";
aoqi@0 324 case ciEnv::MethodCompilable_never:
aoqi@0 325 return "not retryable";
aoqi@0 326 case ciEnv::MethodCompilable:
aoqi@0 327 return NULL;
aoqi@0 328 default:
aoqi@0 329 ShouldNotReachHere();
aoqi@0 330 return NULL;
aoqi@0 331 }
aoqi@0 332 }
aoqi@0 333
aoqi@0 334 bool break_at_compile() { return _break_at_compile; }
aoqi@0 335 void set_break_at_compile(bool z) { _break_at_compile = z; }
aoqi@0 336
aoqi@0 337 // Cache Jvmti state
aoqi@0 338 void cache_jvmti_state();
aoqi@0 339 bool jvmti_can_hotswap_or_post_breakpoint() const { return _jvmti_can_hotswap_or_post_breakpoint; }
aoqi@0 340 bool jvmti_can_access_local_variables() const { return _jvmti_can_access_local_variables; }
aoqi@0 341 bool jvmti_can_post_on_exceptions() const { return _jvmti_can_post_on_exceptions; }
aoqi@0 342
aoqi@0 343 // Cache DTrace flags
aoqi@0 344 void cache_dtrace_flags();
aoqi@0 345 bool dtrace_extended_probes() const { return _dtrace_extended_probes; }
aoqi@0 346 bool dtrace_monitor_probes() const { return _dtrace_monitor_probes; }
aoqi@0 347 bool dtrace_method_probes() const { return _dtrace_method_probes; }
aoqi@0 348 bool dtrace_alloc_probes() const { return _dtrace_alloc_probes; }
aoqi@0 349
aoqi@0 350 // The compiler task which has created this env.
aoqi@0 351 // May be useful to find out compile_id, comp_level, etc.
aoqi@0 352 CompileTask* task() { return _task; }
aoqi@0 353 // Handy forwards to the task:
aoqi@0 354 int comp_level(); // task()->comp_level()
aoqi@0 355 uint compile_id(); // task()->compile_id()
aoqi@0 356
aoqi@0 357 // Register the result of a compilation.
aoqi@0 358 void register_method(ciMethod* target,
aoqi@0 359 int entry_bci,
aoqi@0 360 CodeOffsets* offsets,
aoqi@0 361 int orig_pc_offset,
aoqi@0 362 CodeBuffer* code_buffer,
aoqi@0 363 int frame_words,
aoqi@0 364 OopMapSet* oop_map_set,
aoqi@0 365 ExceptionHandlerTable* handler_table,
aoqi@0 366 ImplicitExceptionTable* inc_table,
aoqi@0 367 AbstractCompiler* compiler,
aoqi@0 368 int comp_level,
aoqi@0 369 bool has_unsafe_access,
aoqi@0 370 bool has_wide_vectors,
aoqi@0 371 RTMState rtm_state = NoRTM);
aoqi@0 372
aoqi@0 373
aoqi@0 374 // Access to certain well known ciObjects.
aoqi@0 375 #define WK_KLASS_FUNC(name, ignore_s, ignore_o) \
aoqi@0 376 ciInstanceKlass* name() { \
aoqi@0 377 return _##name;\
aoqi@0 378 }
aoqi@0 379 WK_KLASSES_DO(WK_KLASS_FUNC)
aoqi@0 380 #undef WK_KLASS_FUNC
aoqi@0 381
aoqi@0 382 ciInstance* NullPointerException_instance() {
aoqi@0 383 assert(_NullPointerException_instance != NULL, "initialization problem");
aoqi@0 384 return _NullPointerException_instance;
aoqi@0 385 }
aoqi@0 386 ciInstance* ArithmeticException_instance() {
aoqi@0 387 assert(_ArithmeticException_instance != NULL, "initialization problem");
aoqi@0 388 return _ArithmeticException_instance;
aoqi@0 389 }
aoqi@0 390
aoqi@0 391 // Lazy constructors:
aoqi@0 392 ciInstance* ArrayIndexOutOfBoundsException_instance();
aoqi@0 393 ciInstance* ArrayStoreException_instance();
aoqi@0 394 ciInstance* ClassCastException_instance();
aoqi@0 395
aoqi@0 396 ciInstance* the_null_string();
aoqi@0 397 ciInstance* the_min_jint_string();
aoqi@0 398
aoqi@0 399 static ciSymbol* unloaded_cisymbol() {
aoqi@0 400 return _unloaded_cisymbol;
aoqi@0 401 }
aoqi@0 402 static ciObjArrayKlass* unloaded_ciobjarrayklass() {
aoqi@0 403 return _unloaded_ciobjarrayklass;
aoqi@0 404 }
aoqi@0 405 static ciInstanceKlass* unloaded_ciinstance_klass() {
aoqi@0 406 return _unloaded_ciinstance_klass;
aoqi@0 407 }
aoqi@0 408 ciInstance* unloaded_ciinstance();
aoqi@0 409
aoqi@0 410 ciKlass* find_system_klass(ciSymbol* klass_name);
aoqi@0 411 // Note: To find a class from its name string, use ciSymbol::make,
aoqi@0 412 // but consider adding to vmSymbols.hpp instead.
aoqi@0 413
aoqi@0 414 // converts the ciKlass* representing the holder of a method into a
aoqi@0 415 // ciInstanceKlass*. This is needed since the holder of a method in
aoqi@0 416 // the bytecodes could be an array type. Basically this converts
aoqi@0 417 // array types into java/lang/Object and other types stay as they are.
aoqi@0 418 static ciInstanceKlass* get_instance_klass_for_declared_method_holder(ciKlass* klass);
aoqi@0 419
aoqi@0 420 // Return the machine-level offset of o, which must be an element of a.
aoqi@0 421 // This may be used to form constant-loading expressions in lieu of simpler encodings.
aoqi@0 422 int array_element_offset_in_bytes(ciArray* a, ciObject* o);
aoqi@0 423
aoqi@0 424 // Access to the compile-lifetime allocation arena.
aoqi@0 425 Arena* arena() { return _arena; }
aoqi@0 426
aoqi@0 427 // What is the current compilation environment?
aoqi@0 428 static ciEnv* current() { return CompilerThread::current()->env(); }
aoqi@0 429
aoqi@0 430 // Overload with current thread argument
aoqi@0 431 static ciEnv* current(CompilerThread *thread) { return thread->env(); }
aoqi@0 432
aoqi@0 433 // Per-compiler data. (Used by C2 to publish the Compile* pointer.)
aoqi@0 434 void* compiler_data() { return _compiler_data; }
aoqi@0 435 void set_compiler_data(void* x) { _compiler_data = x; }
aoqi@0 436
aoqi@0 437 // Notice that a method has been inlined in the current compile;
aoqi@0 438 // used only for statistics.
aoqi@0 439 void notice_inlined_method(ciMethod* method);
aoqi@0 440
aoqi@0 441 // Total number of bytecodes in inlined methods in this compile
aoqi@0 442 int num_inlined_bytecodes() const;
aoqi@0 443
aoqi@0 444 // Output stream for logging compilation info.
aoqi@0 445 CompileLog* log() { return _log; }
aoqi@0 446 void set_log(CompileLog* log) { _log = log; }
aoqi@0 447
aoqi@0 448 // Check for changes to the system dictionary during compilation
aoqi@0 449 bool system_dictionary_modification_counter_changed();
aoqi@0 450
aoqi@0 451 void record_failure(const char* reason);
aoqi@0 452 void record_method_not_compilable(const char* reason, bool all_tiers = true);
aoqi@0 453 void record_out_of_memory_failure();
aoqi@0 454
aoqi@0 455 // RedefineClasses support
aoqi@0 456 void metadata_do(void f(Metadata*)) { _factory->metadata_do(f); }
aoqi@0 457
aoqi@0 458 // Dump the compilation replay data for the ciEnv to the stream.
aoqi@0 459 void dump_replay_data(int compile_id);
aoqi@0 460 void dump_inline_data(int compile_id);
aoqi@0 461 void dump_replay_data(outputStream* out);
aoqi@0 462 void dump_replay_data_unsafe(outputStream* out);
aoqi@0 463 void dump_compile_data(outputStream* out);
aoqi@0 464 };
aoqi@0 465
aoqi@0 466 #endif // SHARE_VM_CI_CIENV_HPP

mercurial