--- old/src/hotspot/share/jvmci/jvmciEnv.hpp 2019-01-18 21:34:27.000000000 +0100 +++ new/src/hotspot/share/jvmci/jvmciEnv.hpp 2019-01-18 21:34:27.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -102,10 +102,13 @@ const char* _failure_reason; bool _retryable; - // Cache JVMTI state - bool _jvmti_can_hotswap_or_post_breakpoint; - bool _jvmti_can_access_local_variables; - bool _jvmti_can_post_on_exceptions; + // Cache JVMTI state. Defined as bytes so that reading them from Java + // via Unsafe is well defined (the C++ type for bool is implementation + // defined and may not be the same as a Java boolean). + jbyte _jvmti_can_hotswap_or_post_breakpoint; + jbyte _jvmti_can_access_local_variables; + jbyte _jvmti_can_post_on_exceptions; + jbyte _jvmti_can_pop_frame; // Implementation methods for loading and constant pool access. static Klass* get_klass_by_name_impl(Klass* accessing_klass, @@ -144,6 +147,12 @@ public: CompileTask* task() { return _task; } + bool jvmti_state_changed() const; + bool jvmti_can_hotswap_or_post_breakpoint() const { return _jvmti_can_hotswap_or_post_breakpoint != 0; } + bool jvmti_can_access_local_variables() const { return _jvmti_can_access_local_variables != 0; } + bool jvmti_can_post_on_exceptions() const { return _jvmti_can_post_on_exceptions != 0; } + bool jvmti_can_pop_frame() const { return _jvmti_can_pop_frame != 0; } + const char* failure_reason() { return _failure_reason; } bool retryable() { return _retryable; }