src/share/vm/compiler/compileTask.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/compiler/compileTask.hpp	Tue Apr 19 19:10:30 2016
--- new/src/share/vm/compiler/compileTask.hpp	Tue Apr 19 19:10:30 2016

*** 38,47 **** --- 38,80 ---- class CompileTask : public CHeapObj<mtCompiler> { friend class VMStructs; friend class JVMCIVMStructs; + public: + // Different reasons for a compilation + // The order is important - Reason_Whitebox and higher can not become + // stale, see CompileTask::can_become_stale() + // Also mapped to reason_names[] + enum CompileReason { + Reason_None, + Reason_InvocationCount, // Simple/StackWalk-policy + Reason_BackedgeCount, // Simple/StackWalk-policy + Reason_Tiered, // Tiered-policy + Reason_CTW, // Compile the world + Reason_Replay, // ciReplay + Reason_Whitebox, // Whitebox API + Reason_MustBeCompiled, // Java callHelper, LinkResolver + Reason_Bootstrap, // JVMCI bootstrap + Reason_Count + }; + + static const char* reason_name(CompileTask::CompileReason compile_reason) { + static const char* reason_names[] = { + "no_reason", + "count", + "backedge_count", + "tiered", + "CTW", + "replay", + "whitebox", + "must_be_compiled", + "bootstrap" + }; + return reason_names[compile_reason]; + } + private: static CompileTask* _task_free_list; #ifdef ASSERT static int _num_allocated_tasks; #endif
*** 67,87 **** --- 100,120 ---- // Fields used for logging why the compilation was initiated: jlong _time_queued; // in units of os::elapsed_counter() Method* _hot_method; // which method actually triggered this task jobject _hot_method_holder; int _hot_count; // information about its invocation counter ! const char* _comment; // more info about the task ! CompileReason _compile_reason; // more info about the task const char* _failure_reason; public: CompileTask() { _lock = new Monitor(Mutex::nonleaf+2, "CompileTaskLock"); } void initialize(int compile_id, const methodHandle& method, int osr_bci, int comp_level, - const methodHandle& hot_method, int hot_count, const char* comment, ! CompileTask::CompileReason compile_reason, bool is_blocking); static CompileTask* allocate(); static void free(CompileTask* task); int compile_id() const { return _compile_id; }
*** 89,98 **** --- 122,140 ---- Method* hot_method() const { return _hot_method; } int osr_bci() const { return _osr_bci; } bool is_complete() const { return _is_complete; } bool is_blocking() const { return _is_blocking; } bool is_success() const { return _is_success; } + bool can_become_stale() const { + switch(_compile_reason) { + case Reason_BackedgeCount: + case Reason_InvocationCount: + case Reason_Tiered: + return !_is_blocking; + } + return false; + } #if INCLUDE_JVMCI bool has_waiter() const { return _has_waiter; } void clear_waiter() { _has_waiter = false; } CompilerThread* jvmci_compiler_thread() const { return _jvmci_compiler_thread; } void set_jvmci_compiler_thread(CompilerThread* t) {

src/share/vm/compiler/compileTask.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File