diff -r 98f3af397705 -r 46f6f063b272 src/share/vm/c1/c1_Compilation.hpp --- a/src/share/vm/c1/c1_Compilation.hpp Wed Mar 20 17:04:45 2013 -0700 +++ b/src/share/vm/c1/c1_Compilation.hpp Thu Mar 21 09:27:54 2013 +0100 @@ -26,8 +26,10 @@ #define SHARE_VM_C1_C1_COMPILATION_HPP #include "ci/ciEnv.hpp" +#include "ci/ciMethodData.hpp" #include "code/exceptionHandlerTable.hpp" #include "memory/resourceArea.hpp" +#include "runtime/deoptimization.hpp" class CompilationResourceObj; class XHandlers; @@ -85,6 +87,7 @@ LinearScan* _allocator; CodeOffsets _offsets; CodeBuffer _code; + bool _has_access_indexed; // compilation helpers void initialize(); @@ -140,6 +143,7 @@ C1_MacroAssembler* masm() const { return _masm; } CodeOffsets* offsets() { return &_offsets; } Arena* arena() { return _arena; } + bool has_access_indexed() { return _has_access_indexed; } // Instruction ids int get_next_id() { return _next_id++; } @@ -154,6 +158,7 @@ void set_has_fpu_code(bool f) { _has_fpu_code = f; } void set_has_unsafe_access(bool f) { _has_unsafe_access = f; } void set_would_profile(bool f) { _would_profile = f; } + void set_has_access_indexed(bool f) { _has_access_indexed = f; } // Add a set of exception handlers covering the given PC offset void add_exception_handlers_for_pco(int pco, XHandlers* exception_handlers); // Statistics gathering @@ -233,6 +238,14 @@ return env()->comp_level() == CompLevel_full_profile && C1UpdateMethodData && C1ProfileCheckcasts; } + + // will compilation make optimistic assumptions that might lead to + // deoptimization and that the runtime will account for? + bool is_optimistic() const { + return !TieredCompilation && + (RangeCheckElimination || UseLoopInvariantCodeMotion) && + method()->method_data()->trap_count(Deoptimization::Reason_none) == 0; + } };