diff options
| -rw-r--r-- | Android.bp | 1 | ||||
| -rw-r--r-- | build/Android.cpplint.mk | 2 | ||||
| -rw-r--r-- | openjdkjvmti/Android.bp (renamed from runtime/openjdkjvmti/Android.bp) | 1 | ||||
| -rw-r--r-- | openjdkjvmti/MODULE_LICENSE_GPL_WITH_CLASSPATH_EXCEPTION (renamed from runtime/openjdkjvmti/MODULE_LICENSE_GPL_WITH_CLASSPATH_EXCEPTION) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/NOTICE (renamed from runtime/openjdkjvmti/NOTICE) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/OpenjdkJvmTi.cc (renamed from runtime/openjdkjvmti/OpenjdkJvmTi.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/README.md (renamed from runtime/openjdkjvmti/README.md) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/art_jvmti.h (renamed from runtime/openjdkjvmti/art_jvmti.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/events-inl.h (renamed from runtime/openjdkjvmti/events-inl.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/events.cc (renamed from runtime/openjdkjvmti/events.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/events.h (renamed from runtime/openjdkjvmti/events.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/fixed_up_dex_file.cc (renamed from runtime/openjdkjvmti/fixed_up_dex_file.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/fixed_up_dex_file.h (renamed from runtime/openjdkjvmti/fixed_up_dex_file.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/include/jvmti.h (renamed from runtime/openjdkjvmti/include/jvmti.h) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/jvmti_allocator.h (renamed from runtime/openjdkjvmti/jvmti_allocator.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/jvmti_weak_table-inl.h (renamed from runtime/openjdkjvmti/jvmti_weak_table-inl.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/jvmti_weak_table.h (renamed from runtime/openjdkjvmti/jvmti_weak_table.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/object_tagging.cc (renamed from runtime/openjdkjvmti/object_tagging.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/object_tagging.h (renamed from runtime/openjdkjvmti/object_tagging.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_allocator.cc (renamed from runtime/openjdkjvmti/ti_allocator.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_allocator.h (renamed from runtime/openjdkjvmti/ti_allocator.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_breakpoint.cc (renamed from runtime/openjdkjvmti/ti_breakpoint.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_breakpoint.h (renamed from runtime/openjdkjvmti/ti_breakpoint.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_class.cc (renamed from runtime/openjdkjvmti/ti_class.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_class.h (renamed from runtime/openjdkjvmti/ti_class.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_class_definition.cc (renamed from runtime/openjdkjvmti/ti_class_definition.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_class_definition.h (renamed from runtime/openjdkjvmti/ti_class_definition.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_class_loader.cc (renamed from runtime/openjdkjvmti/ti_class_loader.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_class_loader.h (renamed from runtime/openjdkjvmti/ti_class_loader.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_dump.cc (renamed from runtime/openjdkjvmti/ti_dump.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_dump.h (renamed from runtime/openjdkjvmti/ti_dump.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_field.cc (renamed from runtime/openjdkjvmti/ti_field.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_field.h (renamed from runtime/openjdkjvmti/ti_field.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_heap.cc (renamed from runtime/openjdkjvmti/ti_heap.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_heap.h (renamed from runtime/openjdkjvmti/ti_heap.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_jni.cc (renamed from runtime/openjdkjvmti/ti_jni.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_jni.h (renamed from runtime/openjdkjvmti/ti_jni.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_method.cc (renamed from runtime/openjdkjvmti/ti_method.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_method.h (renamed from runtime/openjdkjvmti/ti_method.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_monitor.cc (renamed from runtime/openjdkjvmti/ti_monitor.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_monitor.h (renamed from runtime/openjdkjvmti/ti_monitor.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_object.cc (renamed from runtime/openjdkjvmti/ti_object.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_object.h (renamed from runtime/openjdkjvmti/ti_object.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_phase.cc (renamed from runtime/openjdkjvmti/ti_phase.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_phase.h (renamed from runtime/openjdkjvmti/ti_phase.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_properties.cc (renamed from runtime/openjdkjvmti/ti_properties.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_properties.h (renamed from runtime/openjdkjvmti/ti_properties.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_redefine.cc (renamed from runtime/openjdkjvmti/ti_redefine.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_redefine.h (renamed from runtime/openjdkjvmti/ti_redefine.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_search.cc (renamed from runtime/openjdkjvmti/ti_search.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_search.h (renamed from runtime/openjdkjvmti/ti_search.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_stack.cc (renamed from runtime/openjdkjvmti/ti_stack.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_stack.h (renamed from runtime/openjdkjvmti/ti_stack.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_thread.cc (renamed from runtime/openjdkjvmti/ti_thread.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_thread.h (renamed from runtime/openjdkjvmti/ti_thread.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_threadgroup.cc (renamed from runtime/openjdkjvmti/ti_threadgroup.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_threadgroup.h (renamed from runtime/openjdkjvmti/ti_threadgroup.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/ti_timers.cc (renamed from runtime/openjdkjvmti/ti_timers.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/ti_timers.h (renamed from runtime/openjdkjvmti/ti_timers.h) | 6 | ||||
| -rw-r--r-- | openjdkjvmti/transform.cc (renamed from runtime/openjdkjvmti/transform.cc) | 0 | ||||
| -rw-r--r-- | openjdkjvmti/transform.h (renamed from runtime/openjdkjvmti/transform.h) | 6 | ||||
| -rw-r--r-- | runtime/Android.bp | 4 | ||||
| -rw-r--r-- | runtime/common_dex_operations.h | 5 | ||||
| -rw-r--r-- | runtime/interpreter/interpreter_common.cc | 29 | ||||
| -rw-r--r-- | runtime/interpreter/interpreter_common.h | 3 | ||||
| -rw-r--r-- | runtime/interpreter/interpreter_switch_impl.cc | 28 | ||||
| -rw-r--r-- | runtime/jit/jit_code_cache.cc | 2 | ||||
| -rw-r--r-- | runtime/transaction.cc | 21 | ||||
| -rw-r--r-- | runtime/transaction.h | 8 | ||||
| -rw-r--r-- | test/660-clinit/expected.txt | 4 | ||||
| -rw-r--r-- | test/660-clinit/src/Main.java | 35 | ||||
| -rwxr-xr-x | tools/cpplint_presubmit.py | 2 |
72 files changed, 203 insertions, 116 deletions
diff --git a/Android.bp b/Android.bp index cb72082e6d..0ce7916590 100644 --- a/Android.bp +++ b/Android.bp @@ -32,6 +32,7 @@ subdirs = [ "imgdiag", "oatdump", "openjdkjvm", + "openjdkjvmti", "patchoat", "profman", "runtime", diff --git a/build/Android.cpplint.mk b/build/Android.cpplint.mk index 66ac897f76..2688c049d5 100644 --- a/build/Android.cpplint.mk +++ b/build/Android.cpplint.mk @@ -22,7 +22,7 @@ ART_CPPLINT_FLAGS := --root=$(TOP) ART_CPPLINT_QUIET := --quiet ART_CPPLINT_INGORED := \ runtime/elf.h \ - runtime/openjdkjvmti/include/jvmti.h + openjdkjvmti/include/jvmti.h # This: # 1) Gets a list of all .h & .cc files in the art directory. diff --git a/runtime/openjdkjvmti/Android.bp b/openjdkjvmti/Android.bp index aec1bd0f37..b6b1b56a26 100644 --- a/runtime/openjdkjvmti/Android.bp +++ b/openjdkjvmti/Android.bp @@ -48,7 +48,6 @@ cc_defaults { "ti_threadgroup.cc", "ti_timers.cc", "transform.cc"], - include_dirs: ["art/runtime"], header_libs: ["libopenjdkjvmti_headers"], shared_libs: [ "libbase", diff --git a/runtime/openjdkjvmti/MODULE_LICENSE_GPL_WITH_CLASSPATH_EXCEPTION b/openjdkjvmti/MODULE_LICENSE_GPL_WITH_CLASSPATH_EXCEPTION index e69de29bb2..e69de29bb2 100644 --- a/runtime/openjdkjvmti/MODULE_LICENSE_GPL_WITH_CLASSPATH_EXCEPTION +++ b/openjdkjvmti/MODULE_LICENSE_GPL_WITH_CLASSPATH_EXCEPTION diff --git a/runtime/openjdkjvmti/NOTICE b/openjdkjvmti/NOTICE index 6ec62cd4f1..6ec62cd4f1 100644 --- a/runtime/openjdkjvmti/NOTICE +++ b/openjdkjvmti/NOTICE diff --git a/runtime/openjdkjvmti/OpenjdkJvmTi.cc b/openjdkjvmti/OpenjdkJvmTi.cc index af770724ab..af770724ab 100644 --- a/runtime/openjdkjvmti/OpenjdkJvmTi.cc +++ b/openjdkjvmti/OpenjdkJvmTi.cc diff --git a/runtime/openjdkjvmti/README.md b/openjdkjvmti/README.md index b8bab573d1..b8bab573d1 100644 --- a/runtime/openjdkjvmti/README.md +++ b/openjdkjvmti/README.md diff --git a/runtime/openjdkjvmti/art_jvmti.h b/openjdkjvmti/art_jvmti.h index ce30c244dc..12f4cabca4 100644 --- a/runtime/openjdkjvmti/art_jvmti.h +++ b/openjdkjvmti/art_jvmti.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_ART_JVMTI_H_ -#define ART_RUNTIME_OPENJDKJVMTI_ART_JVMTI_H_ +#ifndef ART_OPENJDKJVMTI_ART_JVMTI_H_ +#define ART_OPENJDKJVMTI_ART_JVMTI_H_ #include <memory> #include <type_traits> @@ -262,4 +262,4 @@ const jvmtiCapabilities kPotentialCapabilities = { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_ART_JVMTI_H_ +#endif // ART_OPENJDKJVMTI_ART_JVMTI_H_ diff --git a/runtime/openjdkjvmti/events-inl.h b/openjdkjvmti/events-inl.h index 91e40553f0..32dba3e3e1 100644 --- a/runtime/openjdkjvmti/events-inl.h +++ b/openjdkjvmti/events-inl.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_EVENTS_INL_H_ -#define ART_RUNTIME_OPENJDKJVMTI_EVENTS_INL_H_ +#ifndef ART_OPENJDKJVMTI_EVENTS_INL_H_ +#define ART_OPENJDKJVMTI_EVENTS_INL_H_ #include <array> @@ -437,4 +437,4 @@ inline void EventHandler::HandleChangedCapabilities(ArtJvmTiEnv* env, } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_EVENTS_INL_H_ +#endif // ART_OPENJDKJVMTI_EVENTS_INL_H_ diff --git a/runtime/openjdkjvmti/events.cc b/openjdkjvmti/events.cc index 2944a453e0..2944a453e0 100644 --- a/runtime/openjdkjvmti/events.cc +++ b/openjdkjvmti/events.cc diff --git a/runtime/openjdkjvmti/events.h b/openjdkjvmti/events.h index 617519eaa3..3d05fa18c7 100644 --- a/runtime/openjdkjvmti/events.h +++ b/openjdkjvmti/events.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_EVENTS_H_ -#define ART_RUNTIME_OPENJDKJVMTI_EVENTS_H_ +#ifndef ART_OPENJDKJVMTI_EVENTS_H_ +#define ART_OPENJDKJVMTI_EVENTS_H_ #include <bitset> #include <vector> @@ -227,4 +227,4 @@ class EventHandler { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_EVENTS_H_ +#endif // ART_OPENJDKJVMTI_EVENTS_H_ diff --git a/runtime/openjdkjvmti/fixed_up_dex_file.cc b/openjdkjvmti/fixed_up_dex_file.cc index 5bfa5ca491..5bfa5ca491 100644 --- a/runtime/openjdkjvmti/fixed_up_dex_file.cc +++ b/openjdkjvmti/fixed_up_dex_file.cc diff --git a/runtime/openjdkjvmti/fixed_up_dex_file.h b/openjdkjvmti/fixed_up_dex_file.h index a96ee1219e..4cb39cfe93 100644 --- a/runtime/openjdkjvmti/fixed_up_dex_file.h +++ b/openjdkjvmti/fixed_up_dex_file.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_FIXED_UP_DEX_FILE_H_ -#define ART_RUNTIME_OPENJDKJVMTI_FIXED_UP_DEX_FILE_H_ +#ifndef ART_OPENJDKJVMTI_FIXED_UP_DEX_FILE_H_ +#define ART_OPENJDKJVMTI_FIXED_UP_DEX_FILE_H_ #include <memory> #include <vector> @@ -80,4 +80,4 @@ class FixedUpDexFile { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_FIXED_UP_DEX_FILE_H_ +#endif // ART_OPENJDKJVMTI_FIXED_UP_DEX_FILE_H_ diff --git a/runtime/openjdkjvmti/include/jvmti.h b/openjdkjvmti/include/jvmti.h index de07c163fc..de07c163fc 100644 --- a/runtime/openjdkjvmti/include/jvmti.h +++ b/openjdkjvmti/include/jvmti.h diff --git a/runtime/openjdkjvmti/jvmti_allocator.h b/openjdkjvmti/jvmti_allocator.h index 44b1cb1c20..e29e034f40 100644 --- a/runtime/openjdkjvmti/jvmti_allocator.h +++ b/openjdkjvmti/jvmti_allocator.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_JVMTI_ALLOCATOR_H_ -#define ART_RUNTIME_OPENJDKJVMTI_JVMTI_ALLOCATOR_H_ +#ifndef ART_OPENJDKJVMTI_JVMTI_ALLOCATOR_H_ +#define ART_OPENJDKJVMTI_JVMTI_ALLOCATOR_H_ #include "base/logging.h" #include "base/macros.h" @@ -171,4 +171,4 @@ inline bool operator!=(const JvmtiAllocator<T>& lhs, const JvmtiAllocator<T>& rh } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_JVMTI_ALLOCATOR_H_ +#endif // ART_OPENJDKJVMTI_JVMTI_ALLOCATOR_H_ diff --git a/runtime/openjdkjvmti/jvmti_weak_table-inl.h b/openjdkjvmti/jvmti_weak_table-inl.h index a640acbe98..1c82255fff 100644 --- a/runtime/openjdkjvmti/jvmti_weak_table-inl.h +++ b/openjdkjvmti/jvmti_weak_table-inl.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_JVMTI_WEAK_TABLE_INL_H_ -#define ART_RUNTIME_OPENJDKJVMTI_JVMTI_WEAK_TABLE_INL_H_ +#ifndef ART_OPENJDKJVMTI_JVMTI_WEAK_TABLE_INL_H_ +#define ART_OPENJDKJVMTI_JVMTI_WEAK_TABLE_INL_H_ #include "jvmti_weak_table.h" @@ -403,4 +403,4 @@ art::mirror::Object* JvmtiWeakTable<T>::Find(T tag) { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_JVMTI_WEAK_TABLE_INL_H_ +#endif // ART_OPENJDKJVMTI_JVMTI_WEAK_TABLE_INL_H_ diff --git a/runtime/openjdkjvmti/jvmti_weak_table.h b/openjdkjvmti/jvmti_weak_table.h index a5175a42ba..5a821c964b 100644 --- a/runtime/openjdkjvmti/jvmti_weak_table.h +++ b/openjdkjvmti/jvmti_weak_table.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_JVMTI_WEAK_TABLE_H_ -#define ART_RUNTIME_OPENJDKJVMTI_JVMTI_WEAK_TABLE_H_ +#ifndef ART_OPENJDKJVMTI_JVMTI_WEAK_TABLE_H_ +#define ART_OPENJDKJVMTI_JVMTI_WEAK_TABLE_H_ #include <unordered_map> @@ -224,4 +224,4 @@ class JvmtiWeakTable : public art::gc::SystemWeakHolder { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_JVMTI_WEAK_TABLE_H_ +#endif // ART_OPENJDKJVMTI_JVMTI_WEAK_TABLE_H_ diff --git a/runtime/openjdkjvmti/object_tagging.cc b/openjdkjvmti/object_tagging.cc index dcdd3ede13..dcdd3ede13 100644 --- a/runtime/openjdkjvmti/object_tagging.cc +++ b/openjdkjvmti/object_tagging.cc diff --git a/runtime/openjdkjvmti/object_tagging.h b/openjdkjvmti/object_tagging.h index ca84e442dc..b474845566 100644 --- a/runtime/openjdkjvmti/object_tagging.h +++ b/openjdkjvmti/object_tagging.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_OBJECT_TAGGING_H_ -#define ART_RUNTIME_OPENJDKJVMTI_OBJECT_TAGGING_H_ +#ifndef ART_OPENJDKJVMTI_OBJECT_TAGGING_H_ +#define ART_OPENJDKJVMTI_OBJECT_TAGGING_H_ #include <unordered_map> @@ -83,4 +83,4 @@ class ObjectTagTable FINAL : public JvmtiWeakTable<jlong> { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_OBJECT_TAGGING_H_ +#endif // ART_OPENJDKJVMTI_OBJECT_TAGGING_H_ diff --git a/runtime/openjdkjvmti/ti_allocator.cc b/openjdkjvmti/ti_allocator.cc index 575558dccf..575558dccf 100644 --- a/runtime/openjdkjvmti/ti_allocator.cc +++ b/openjdkjvmti/ti_allocator.cc diff --git a/runtime/openjdkjvmti/ti_allocator.h b/openjdkjvmti/ti_allocator.h index 35575c3884..776cc5ed14 100644 --- a/runtime/openjdkjvmti/ti_allocator.h +++ b/openjdkjvmti/ti_allocator.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_ALLOCATOR_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_ALLOCATOR_H_ +#ifndef ART_OPENJDKJVMTI_TI_ALLOCATOR_H_ +#define ART_OPENJDKJVMTI_TI_ALLOCATOR_H_ #include "jni.h" #include "jvmti.h" @@ -61,5 +61,5 @@ class AllocUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_ALLOCATOR_H_ +#endif // ART_OPENJDKJVMTI_TI_ALLOCATOR_H_ diff --git a/runtime/openjdkjvmti/ti_breakpoint.cc b/openjdkjvmti/ti_breakpoint.cc index f5116a8080..f5116a8080 100644 --- a/runtime/openjdkjvmti/ti_breakpoint.cc +++ b/openjdkjvmti/ti_breakpoint.cc diff --git a/runtime/openjdkjvmti/ti_breakpoint.h b/openjdkjvmti/ti_breakpoint.h index c3dbef7baf..9b08b425fa 100644 --- a/runtime/openjdkjvmti/ti_breakpoint.h +++ b/openjdkjvmti/ti_breakpoint.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_BREAKPOINT_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_BREAKPOINT_H_ +#ifndef ART_OPENJDKJVMTI_TI_BREAKPOINT_H_ +#define ART_OPENJDKJVMTI_TI_BREAKPOINT_H_ #include "jni.h" #include "jvmti.h" @@ -91,4 +91,4 @@ template<> struct hash<openjdkjvmti::Breakpoint> { }; } // namespace std -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_BREAKPOINT_H_ +#endif // ART_OPENJDKJVMTI_TI_BREAKPOINT_H_ diff --git a/runtime/openjdkjvmti/ti_class.cc b/openjdkjvmti/ti_class.cc index 954b5d1d03..954b5d1d03 100644 --- a/runtime/openjdkjvmti/ti_class.cc +++ b/openjdkjvmti/ti_class.cc diff --git a/runtime/openjdkjvmti/ti_class.h b/openjdkjvmti/ti_class.h index 7bb6b3e5de..dd99e3621f 100644 --- a/runtime/openjdkjvmti/ti_class.h +++ b/openjdkjvmti/ti_class.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_CLASS_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_CLASS_H_ +#ifndef ART_OPENJDKJVMTI_TI_CLASS_H_ +#define ART_OPENJDKJVMTI_TI_CLASS_H_ #include "jni.h" #include "jvmti.h" @@ -92,4 +92,4 @@ class ClassUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_CLASS_H_ +#endif // ART_OPENJDKJVMTI_TI_CLASS_H_ diff --git a/runtime/openjdkjvmti/ti_class_definition.cc b/openjdkjvmti/ti_class_definition.cc index c73ef0d31c..c73ef0d31c 100644 --- a/runtime/openjdkjvmti/ti_class_definition.cc +++ b/openjdkjvmti/ti_class_definition.cc diff --git a/runtime/openjdkjvmti/ti_class_definition.h b/openjdkjvmti/ti_class_definition.h index 2c268ddd4c..accc456957 100644 --- a/runtime/openjdkjvmti/ti_class_definition.h +++ b/openjdkjvmti/ti_class_definition.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_CLASS_DEFINITION_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_CLASS_DEFINITION_H_ +#ifndef ART_OPENJDKJVMTI_TI_CLASS_DEFINITION_H_ +#define ART_OPENJDKJVMTI_TI_CLASS_DEFINITION_H_ #include "art_jvmti.h" @@ -128,4 +128,4 @@ class ArtClassDefinition { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_CLASS_DEFINITION_H_ +#endif // ART_OPENJDKJVMTI_TI_CLASS_DEFINITION_H_ diff --git a/runtime/openjdkjvmti/ti_class_loader.cc b/openjdkjvmti/ti_class_loader.cc index e81e4bc803..e81e4bc803 100644 --- a/runtime/openjdkjvmti/ti_class_loader.cc +++ b/openjdkjvmti/ti_class_loader.cc diff --git a/runtime/openjdkjvmti/ti_class_loader.h b/openjdkjvmti/ti_class_loader.h index af66c5fd4d..767e258a77 100644 --- a/runtime/openjdkjvmti/ti_class_loader.h +++ b/openjdkjvmti/ti_class_loader.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_CLASS_LOADER_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_CLASS_LOADER_H_ +#ifndef ART_OPENJDKJVMTI_TI_CLASS_LOADER_H_ +#define ART_OPENJDKJVMTI_TI_CLASS_LOADER_H_ #include <string> @@ -96,4 +96,4 @@ class ClassLoaderHelper { }; } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_CLASS_LOADER_H_ +#endif // ART_OPENJDKJVMTI_TI_CLASS_LOADER_H_ diff --git a/runtime/openjdkjvmti/ti_dump.cc b/openjdkjvmti/ti_dump.cc index 809a5e47bb..809a5e47bb 100644 --- a/runtime/openjdkjvmti/ti_dump.cc +++ b/openjdkjvmti/ti_dump.cc diff --git a/runtime/openjdkjvmti/ti_dump.h b/openjdkjvmti/ti_dump.h index 67cb2394f8..323bf56aef 100644 --- a/runtime/openjdkjvmti/ti_dump.h +++ b/openjdkjvmti/ti_dump.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_DUMP_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_DUMP_H_ +#ifndef ART_OPENJDKJVMTI_TI_DUMP_H_ +#define ART_OPENJDKJVMTI_TI_DUMP_H_ #include "jni.h" #include "jvmti.h" @@ -47,4 +47,4 @@ class DumpUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_DUMP_H_ +#endif // ART_OPENJDKJVMTI_TI_DUMP_H_ diff --git a/runtime/openjdkjvmti/ti_field.cc b/openjdkjvmti/ti_field.cc index c45b926695..c45b926695 100644 --- a/runtime/openjdkjvmti/ti_field.cc +++ b/openjdkjvmti/ti_field.cc diff --git a/runtime/openjdkjvmti/ti_field.h b/openjdkjvmti/ti_field.h index 880949eecb..8a229ed19d 100644 --- a/runtime/openjdkjvmti/ti_field.h +++ b/openjdkjvmti/ti_field.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_FIELD_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_FIELD_H_ +#ifndef ART_OPENJDKJVMTI_TI_FIELD_H_ +#define ART_OPENJDKJVMTI_TI_FIELD_H_ #include "jni.h" #include "jvmti.h" @@ -69,4 +69,4 @@ class FieldUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_FIELD_H_ +#endif // ART_OPENJDKJVMTI_TI_FIELD_H_ diff --git a/runtime/openjdkjvmti/ti_heap.cc b/openjdkjvmti/ti_heap.cc index 3397210151..3397210151 100644 --- a/runtime/openjdkjvmti/ti_heap.cc +++ b/openjdkjvmti/ti_heap.cc diff --git a/runtime/openjdkjvmti/ti_heap.h b/openjdkjvmti/ti_heap.h index 0c973db199..62761b500c 100644 --- a/runtime/openjdkjvmti/ti_heap.h +++ b/openjdkjvmti/ti_heap.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_HEAP_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_HEAP_H_ +#ifndef ART_OPENJDKJVMTI_TI_HEAP_H_ +#define ART_OPENJDKJVMTI_TI_HEAP_H_ #include "jvmti.h" @@ -70,4 +70,4 @@ class HeapExtensions { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_HEAP_H_ +#endif // ART_OPENJDKJVMTI_TI_HEAP_H_ diff --git a/runtime/openjdkjvmti/ti_jni.cc b/openjdkjvmti/ti_jni.cc index dd2dda118a..dd2dda118a 100644 --- a/runtime/openjdkjvmti/ti_jni.cc +++ b/openjdkjvmti/ti_jni.cc diff --git a/runtime/openjdkjvmti/ti_jni.h b/openjdkjvmti/ti_jni.h index 906aab0667..590fd545da 100644 --- a/runtime/openjdkjvmti/ti_jni.h +++ b/openjdkjvmti/ti_jni.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_JNI_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_JNI_H_ +#ifndef ART_OPENJDKJVMTI_TI_JNI_H_ +#define ART_OPENJDKJVMTI_TI_JNI_H_ #include "jni.h" #include "jvmti.h" @@ -55,4 +55,4 @@ class JNIUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_JNI_H_ +#endif // ART_OPENJDKJVMTI_TI_JNI_H_ diff --git a/runtime/openjdkjvmti/ti_method.cc b/openjdkjvmti/ti_method.cc index 8f727147a4..8f727147a4 100644 --- a/runtime/openjdkjvmti/ti_method.cc +++ b/openjdkjvmti/ti_method.cc diff --git a/runtime/openjdkjvmti/ti_method.h b/openjdkjvmti/ti_method.h index aabaedb932..e3578a416f 100644 --- a/runtime/openjdkjvmti/ti_method.h +++ b/openjdkjvmti/ti_method.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_METHOD_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_METHOD_H_ +#ifndef ART_OPENJDKJVMTI_TI_METHOD_H_ +#define ART_OPENJDKJVMTI_TI_METHOD_H_ #include "jni.h" #include "jvmti.h" @@ -111,4 +111,4 @@ class MethodUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_METHOD_H_ +#endif // ART_OPENJDKJVMTI_TI_METHOD_H_ diff --git a/runtime/openjdkjvmti/ti_monitor.cc b/openjdkjvmti/ti_monitor.cc index 61bf533eb7..61bf533eb7 100644 --- a/runtime/openjdkjvmti/ti_monitor.cc +++ b/openjdkjvmti/ti_monitor.cc diff --git a/runtime/openjdkjvmti/ti_monitor.h b/openjdkjvmti/ti_monitor.h index 96ccb0d1c7..add089c377 100644 --- a/runtime/openjdkjvmti/ti_monitor.h +++ b/openjdkjvmti/ti_monitor.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_MONITOR_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_MONITOR_H_ +#ifndef ART_OPENJDKJVMTI_TI_MONITOR_H_ +#define ART_OPENJDKJVMTI_TI_MONITOR_H_ #include "jni.h" #include "jvmti.h" @@ -56,4 +56,4 @@ class MonitorUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_MONITOR_H_ +#endif // ART_OPENJDKJVMTI_TI_MONITOR_H_ diff --git a/runtime/openjdkjvmti/ti_object.cc b/openjdkjvmti/ti_object.cc index 2506acac3a..2506acac3a 100644 --- a/runtime/openjdkjvmti/ti_object.cc +++ b/openjdkjvmti/ti_object.cc diff --git a/runtime/openjdkjvmti/ti_object.h b/openjdkjvmti/ti_object.h index 09eee61bdb..fa3bd0f51a 100644 --- a/runtime/openjdkjvmti/ti_object.h +++ b/openjdkjvmti/ti_object.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_OBJECT_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_OBJECT_H_ +#ifndef ART_OPENJDKJVMTI_TI_OBJECT_H_ +#define ART_OPENJDKJVMTI_TI_OBJECT_H_ #include "jni.h" #include "jvmti.h" @@ -46,4 +46,4 @@ class ObjectUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_OBJECT_H_ +#endif // ART_OPENJDKJVMTI_TI_OBJECT_H_ diff --git a/runtime/openjdkjvmti/ti_phase.cc b/openjdkjvmti/ti_phase.cc index 8893c9b4aa..8893c9b4aa 100644 --- a/runtime/openjdkjvmti/ti_phase.cc +++ b/openjdkjvmti/ti_phase.cc diff --git a/runtime/openjdkjvmti/ti_phase.h b/openjdkjvmti/ti_phase.h index a2c0d114ef..d4ed86b0c5 100644 --- a/runtime/openjdkjvmti/ti_phase.h +++ b/openjdkjvmti/ti_phase.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_PHASE_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_PHASE_H_ +#ifndef ART_OPENJDKJVMTI_TI_PHASE_H_ +#define ART_OPENJDKJVMTI_TI_PHASE_H_ #include "jni.h" #include "jvmti.h" @@ -66,4 +66,4 @@ class PhaseUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_PHASE_H_ +#endif // ART_OPENJDKJVMTI_TI_PHASE_H_ diff --git a/runtime/openjdkjvmti/ti_properties.cc b/openjdkjvmti/ti_properties.cc index c412814d8d..c412814d8d 100644 --- a/runtime/openjdkjvmti/ti_properties.cc +++ b/openjdkjvmti/ti_properties.cc diff --git a/runtime/openjdkjvmti/ti_properties.h b/openjdkjvmti/ti_properties.h index 70734813bd..187b85d35f 100644 --- a/runtime/openjdkjvmti/ti_properties.h +++ b/openjdkjvmti/ti_properties.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_PROPERTIES_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_PROPERTIES_H_ +#ifndef ART_OPENJDKJVMTI_TI_PROPERTIES_H_ +#define ART_OPENJDKJVMTI_TI_PROPERTIES_H_ #include "jni.h" #include "jvmti.h" @@ -48,4 +48,4 @@ class PropertiesUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_PROPERTIES_H_ +#endif // ART_OPENJDKJVMTI_TI_PROPERTIES_H_ diff --git a/runtime/openjdkjvmti/ti_redefine.cc b/openjdkjvmti/ti_redefine.cc index c679d731fe..c679d731fe 100644 --- a/runtime/openjdkjvmti/ti_redefine.cc +++ b/openjdkjvmti/ti_redefine.cc diff --git a/runtime/openjdkjvmti/ti_redefine.h b/openjdkjvmti/ti_redefine.h index 03b4bf2074..984f922e25 100644 --- a/runtime/openjdkjvmti/ti_redefine.h +++ b/openjdkjvmti/ti_redefine.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_REDEFINE_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_REDEFINE_H_ +#ifndef ART_OPENJDKJVMTI_TI_REDEFINE_H_ +#define ART_OPENJDKJVMTI_TI_REDEFINE_H_ #include <string> @@ -265,4 +265,4 @@ class Redefiner { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_REDEFINE_H_ +#endif // ART_OPENJDKJVMTI_TI_REDEFINE_H_ diff --git a/runtime/openjdkjvmti/ti_search.cc b/openjdkjvmti/ti_search.cc index 25bc5d6eb3..25bc5d6eb3 100644 --- a/runtime/openjdkjvmti/ti_search.cc +++ b/openjdkjvmti/ti_search.cc diff --git a/runtime/openjdkjvmti/ti_search.h b/openjdkjvmti/ti_search.h index cd7b4be28c..81a28ccbe5 100644 --- a/runtime/openjdkjvmti/ti_search.h +++ b/openjdkjvmti/ti_search.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_SEARCH_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_SEARCH_H_ +#ifndef ART_OPENJDKJVMTI_TI_SEARCH_H_ +#define ART_OPENJDKJVMTI_TI_SEARCH_H_ #include <vector> @@ -50,4 +50,4 @@ class SearchUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_SEARCH_H_ +#endif // ART_OPENJDKJVMTI_TI_SEARCH_H_ diff --git a/runtime/openjdkjvmti/ti_stack.cc b/openjdkjvmti/ti_stack.cc index ff2de8dac6..ff2de8dac6 100644 --- a/runtime/openjdkjvmti/ti_stack.cc +++ b/openjdkjvmti/ti_stack.cc diff --git a/runtime/openjdkjvmti/ti_stack.h b/openjdkjvmti/ti_stack.h index 6a593cfa9c..2e96b82e38 100644 --- a/runtime/openjdkjvmti/ti_stack.h +++ b/openjdkjvmti/ti_stack.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_STACK_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_STACK_H_ +#ifndef ART_OPENJDKJVMTI_TI_STACK_H_ +#define ART_OPENJDKJVMTI_TI_STACK_H_ #include "jni.h" #include "jvmti.h" @@ -71,4 +71,4 @@ class StackUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_STACK_H_ +#endif // ART_OPENJDKJVMTI_TI_STACK_H_ diff --git a/runtime/openjdkjvmti/ti_thread.cc b/openjdkjvmti/ti_thread.cc index 6fa73f8a8c..6fa73f8a8c 100644 --- a/runtime/openjdkjvmti/ti_thread.cc +++ b/openjdkjvmti/ti_thread.cc diff --git a/runtime/openjdkjvmti/ti_thread.h b/openjdkjvmti/ti_thread.h index bf566380c0..03c49d7788 100644 --- a/runtime/openjdkjvmti/ti_thread.h +++ b/openjdkjvmti/ti_thread.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_THREAD_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_THREAD_H_ +#ifndef ART_OPENJDKJVMTI_TI_THREAD_H_ +#define ART_OPENJDKJVMTI_TI_THREAD_H_ #include "jni.h" #include "jvmti.h" @@ -113,4 +113,4 @@ class ThreadUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_THREAD_H_ +#endif // ART_OPENJDKJVMTI_TI_THREAD_H_ diff --git a/runtime/openjdkjvmti/ti_threadgroup.cc b/openjdkjvmti/ti_threadgroup.cc index c0597ad0cc..c0597ad0cc 100644 --- a/runtime/openjdkjvmti/ti_threadgroup.cc +++ b/openjdkjvmti/ti_threadgroup.cc diff --git a/runtime/openjdkjvmti/ti_threadgroup.h b/openjdkjvmti/ti_threadgroup.h index c3a0ff5e15..49115664d5 100644 --- a/runtime/openjdkjvmti/ti_threadgroup.h +++ b/openjdkjvmti/ti_threadgroup.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_THREADGROUP_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_THREADGROUP_H_ +#ifndef ART_OPENJDKJVMTI_TI_THREADGROUP_H_ +#define ART_OPENJDKJVMTI_TI_THREADGROUP_H_ #include "jni.h" #include "jvmti.h" @@ -57,4 +57,4 @@ class ThreadGroupUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_THREADGROUP_H_ +#endif // ART_OPENJDKJVMTI_TI_THREADGROUP_H_ diff --git a/runtime/openjdkjvmti/ti_timers.cc b/openjdkjvmti/ti_timers.cc index 24fb0419ee..24fb0419ee 100644 --- a/runtime/openjdkjvmti/ti_timers.cc +++ b/openjdkjvmti/ti_timers.cc diff --git a/runtime/openjdkjvmti/ti_timers.h b/openjdkjvmti/ti_timers.h index 6300678ff7..892205aef4 100644 --- a/runtime/openjdkjvmti/ti_timers.h +++ b/openjdkjvmti/ti_timers.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_TIMERS_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TI_TIMERS_H_ +#ifndef ART_OPENJDKJVMTI_TI_TIMERS_H_ +#define ART_OPENJDKJVMTI_TI_TIMERS_H_ #include "jni.h" #include "jvmti.h" @@ -48,4 +48,4 @@ class TimerUtil { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TI_TIMERS_H_ +#endif // ART_OPENJDKJVMTI_TI_TIMERS_H_ diff --git a/runtime/openjdkjvmti/transform.cc b/openjdkjvmti/transform.cc index 1d7f137f2b..1d7f137f2b 100644 --- a/runtime/openjdkjvmti/transform.cc +++ b/openjdkjvmti/transform.cc diff --git a/runtime/openjdkjvmti/transform.h b/openjdkjvmti/transform.h index ed24068bb2..6bbe60a91f 100644 --- a/runtime/openjdkjvmti/transform.h +++ b/openjdkjvmti/transform.h @@ -29,8 +29,8 @@ * questions. */ -#ifndef ART_RUNTIME_OPENJDKJVMTI_TRANSFORM_H_ -#define ART_RUNTIME_OPENJDKJVMTI_TRANSFORM_H_ +#ifndef ART_OPENJDKJVMTI_TRANSFORM_H_ +#define ART_OPENJDKJVMTI_TRANSFORM_H_ #include <string> @@ -65,5 +65,5 @@ class Transformer { } // namespace openjdkjvmti -#endif // ART_RUNTIME_OPENJDKJVMTI_TRANSFORM_H_ +#endif // ART_OPENJDKJVMTI_TRANSFORM_H_ diff --git a/runtime/Android.bp b/runtime/Android.bp index 952f8bf0c3..d534542e3c 100644 --- a/runtime/Android.bp +++ b/runtime/Android.bp @@ -625,7 +625,3 @@ art_cc_test { "libvixld-arm64", ], } - -subdirs = [ - "openjdkjvmti", -] diff --git a/runtime/common_dex_operations.h b/runtime/common_dex_operations.h index 528db96dd5..fcc5393490 100644 --- a/runtime/common_dex_operations.h +++ b/runtime/common_dex_operations.h @@ -200,6 +200,11 @@ ALWAYS_INLINE bool DoFieldPutCommon(Thread* self, break; } } + if (transaction_active) { + if (UNLIKELY(self->IsExceptionPending())) { + return false; + } + } return true; } diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc index 136d0c6b64..f8cb243c01 100644 --- a/runtime/interpreter/interpreter_common.cc +++ b/runtime/interpreter/interpreter_common.cc @@ -33,6 +33,7 @@ #include "reflection.h" #include "stack.h" #include "thread-inl.h" +#include "transaction.h" #include "well_known_classes.h" namespace art { @@ -42,7 +43,8 @@ void ThrowNullPointerExceptionFromInterpreter() { ThrowNullPointerExceptionFromDexPC(); } -template<FindFieldType find_type, Primitive::Type field_type, bool do_access_check> +template<FindFieldType find_type, Primitive::Type field_type, bool do_access_check, + bool transaction_active> bool DoFieldGet(Thread* self, ShadowFrame& shadow_frame, const Instruction* inst, uint16_t inst_data) { const bool is_static = (find_type == StaticObjectRead) || (find_type == StaticPrimitiveRead); @@ -57,6 +59,13 @@ bool DoFieldGet(Thread* self, ShadowFrame& shadow_frame, const Instruction* inst ObjPtr<mirror::Object> obj; if (is_static) { obj = f->GetDeclaringClass(); + if (transaction_active) { + if (Runtime::Current()->GetTransaction()->ReadConstraint(obj.Ptr(), f)) { + Runtime::Current()->AbortTransactionAndThrowAbortError(self, "Can't read static fields of " + + obj->PrettyTypeOf() + " since it does not belong to clinit's class."); + return false; + } + } } else { obj = shadow_frame.GetVRegReference(inst->VRegB_22c(inst_data)); if (UNLIKELY(obj == nullptr)) { @@ -102,15 +111,17 @@ bool DoFieldGet(Thread* self, ShadowFrame& shadow_frame, const Instruction* inst } // Explicitly instantiate all DoFieldGet functions. -#define EXPLICIT_DO_FIELD_GET_TEMPLATE_DECL(_find_type, _field_type, _do_check) \ - template bool DoFieldGet<_find_type, _field_type, _do_check>(Thread* self, \ +#define EXPLICIT_DO_FIELD_GET_TEMPLATE_DECL(_find_type, _field_type, _do_check, _transaction_active) \ + template bool DoFieldGet<_find_type, _field_type, _do_check, _transaction_active>(Thread* self, \ ShadowFrame& shadow_frame, \ const Instruction* inst, \ uint16_t inst_data) #define EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(_find_type, _field_type) \ - EXPLICIT_DO_FIELD_GET_TEMPLATE_DECL(_find_type, _field_type, false); \ - EXPLICIT_DO_FIELD_GET_TEMPLATE_DECL(_find_type, _field_type, true); + EXPLICIT_DO_FIELD_GET_TEMPLATE_DECL(_find_type, _field_type, false, true); \ + EXPLICIT_DO_FIELD_GET_TEMPLATE_DECL(_find_type, _field_type, false, false); \ + EXPLICIT_DO_FIELD_GET_TEMPLATE_DECL(_find_type, _field_type, true, true); \ + EXPLICIT_DO_FIELD_GET_TEMPLATE_DECL(_find_type, _field_type, true, false); // iget-XXX EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimBoolean) @@ -261,6 +272,14 @@ bool DoFieldPut(Thread* self, const ShadowFrame& shadow_frame, const Instruction ObjPtr<mirror::Object> obj; if (is_static) { obj = f->GetDeclaringClass(); + if (transaction_active) { + if (Runtime::Current()->GetTransaction()->WriteConstraint(obj.Ptr(), f)) { + Runtime::Current()->AbortTransactionAndThrowAbortError( + self, "Can't set fields of " + obj->PrettyTypeOf()); + return false; + } + } + } else { obj = shadow_frame.GetVRegReference(inst->VRegB_22c(inst_data)); if (UNLIKELY(obj == nullptr)) { diff --git a/runtime/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h index d293aebc4c..b228e28a22 100644 --- a/runtime/interpreter/interpreter_common.h +++ b/runtime/interpreter/interpreter_common.h @@ -270,7 +270,8 @@ static inline bool DoInvokeVirtualQuick(Thread* self, ShadowFrame& shadow_frame, // Handles iget-XXX and sget-XXX instructions. // Returns true on success, otherwise throws an exception and returns false. -template<FindFieldType find_type, Primitive::Type field_type, bool do_access_check> +template<FindFieldType find_type, Primitive::Type field_type, bool do_access_check, + bool transaction_active = false> bool DoFieldGet(Thread* self, ShadowFrame& shadow_frame, const Instruction* inst, uint16_t inst_data) REQUIRES_SHARED(Locks::mutator_lock_); diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl.cc index bdb83326fd..0c5a45faf0 100644 --- a/runtime/interpreter/interpreter_switch_impl.cc +++ b/runtime/interpreter/interpreter_switch_impl.cc @@ -1313,50 +1313,50 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, } case Instruction::SGET_BOOLEAN: { PREAMBLE(); - bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimBoolean, do_access_check>( - self, shadow_frame, inst, inst_data); + bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimBoolean, do_access_check, + transaction_active>(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SGET_BYTE: { PREAMBLE(); - bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimByte, do_access_check>( - self, shadow_frame, inst, inst_data); + bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimByte, do_access_check, + transaction_active>(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SGET_CHAR: { PREAMBLE(); - bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimChar, do_access_check>( - self, shadow_frame, inst, inst_data); + bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimChar, do_access_check, + transaction_active>(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SGET_SHORT: { PREAMBLE(); - bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimShort, do_access_check>( - self, shadow_frame, inst, inst_data); + bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimShort, do_access_check, + transaction_active>(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SGET: { PREAMBLE(); - bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimInt, do_access_check>( - self, shadow_frame, inst, inst_data); + bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimInt, do_access_check, + transaction_active>(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SGET_WIDE: { PREAMBLE(); - bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimLong, do_access_check>( - self, shadow_frame, inst, inst_data); + bool success = DoFieldGet<StaticPrimitiveRead, Primitive::kPrimLong, do_access_check, + transaction_active>(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } case Instruction::SGET_OBJECT: { PREAMBLE(); - bool success = DoFieldGet<StaticObjectRead, Primitive::kPrimNot, do_access_check>( - self, shadow_frame, inst, inst_data); + bool success = DoFieldGet<StaticObjectRead, Primitive::kPrimNot, do_access_check, + transaction_active>(self, shadow_frame, inst, inst_data); POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_2xx); break; } diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc index a030a51473..59373eb34e 100644 --- a/runtime/jit/jit_code_cache.cc +++ b/runtime/jit/jit_code_cache.cc @@ -1600,7 +1600,7 @@ OatQuickMethodHeader* JitCodeCache::LookupMethodHeader(uintptr_t pc, ArtMethod* // is the one we expect. We change to the non-obsolete versions in the error message since the // obsolete version of the method might not be fully initialized yet. This situation can only // occur when we are in the process of allocating and setting up obsolete methods. Otherwise - // method and it->second should be identical. (See runtime/openjdkjvmti/ti_redefine.cc for more + // method and it->second should be identical. (See openjdkjvmti/ti_redefine.cc for more // information.) DCHECK_EQ(it->second->GetNonObsoleteMethod(), method->GetNonObsoleteMethod()) << ArtMethod::PrettyMethod(method->GetNonObsoleteMethod()) << " " diff --git a/runtime/transaction.cc b/runtime/transaction.cc index 50deb1f913..e923aff439 100644 --- a/runtime/transaction.cc +++ b/runtime/transaction.cc @@ -119,6 +119,27 @@ const std::string& Transaction::GetAbortMessage() { return abort_message_; } +bool Transaction::WriteConstraint(mirror::Object* obj, ArtField* field) { + MutexLock mu(Thread::Current(), log_lock_); + if (strict_ // no constraint for boot image + && field->IsStatic() // no constraint instance updating + && obj != root_) { // modifying other classes' static field, fail + return true; + } + return false; +} + +bool Transaction::ReadConstraint(mirror::Object* obj, ArtField* field) { + DCHECK(field->IsStatic()); + DCHECK(obj->IsClass()); + MutexLock mu(Thread::Current(), log_lock_); + if (!strict_ || // no constraint for boot image + obj == root_) { // self-updating, pass + return false; + } + return true; +} + void Transaction::RecordWriteFieldBoolean(mirror::Object* obj, MemberOffset field_offset, uint8_t value, diff --git a/runtime/transaction.h b/runtime/transaction.h index 64349de2e9..4e9cde521f 100644 --- a/runtime/transaction.h +++ b/runtime/transaction.h @@ -135,6 +135,14 @@ class Transaction FINAL { REQUIRES(!log_lock_) REQUIRES_SHARED(Locks::mutator_lock_); + bool ReadConstraint(mirror::Object* obj, ArtField* field) + REQUIRES(!log_lock_) + REQUIRES_SHARED(Locks::mutator_lock_); + + bool WriteConstraint(mirror::Object* obj, ArtField* field) + REQUIRES(!log_lock_) + REQUIRES_SHARED(Locks::mutator_lock_); + private: class ObjectLog : public ValueObject { public: diff --git a/test/660-clinit/expected.txt b/test/660-clinit/expected.txt index e103a2c6a5..9eb4941276 100644 --- a/test/660-clinit/expected.txt +++ b/test/660-clinit/expected.txt @@ -1,4 +1,8 @@ JNI_OnLoad called +A.a: 5 +A.a: 10 +B.b: 10 +C.c: 10 X: 4950 Y: 5730 str: Hello World! diff --git a/test/660-clinit/src/Main.java b/test/660-clinit/src/Main.java index f5476925a0..cf2ffe7425 100644 --- a/test/660-clinit/src/Main.java +++ b/test/660-clinit/src/Main.java @@ -26,7 +26,19 @@ public class Main { } expectNotPreInit(Day.class); - expectNotPreInit(ClInit.class); + expectNotPreInit(ClInit.class); // should pass + expectNotPreInit(A.class); // should pass + expectNotPreInit(B.class); // should fail + expectNotPreInit(C.class); // should fail + + A x = new A(); + System.out.println("A.a: " + A.a); + + B y = new B(); + C z = new C(); + System.out.println("A.a: " + A.a); + System.out.println("B.b: " + B.b); + System.out.println("C.c: " + C.c); ClInit c = new ClInit(); int aa = c.a; @@ -113,3 +125,24 @@ class ClInit { } } +class A { + public static int a = 2; + static { + a = 5; // self-updating, pass + } +} + +class B { + public static int b; + static { + A.a = 10; // write other's static field, fail + b = A.a; // read other's static field, fail + } +} + +class C { + public static int c; + static { + c = A.a; // read other's static field, fail + } +} diff --git a/tools/cpplint_presubmit.py b/tools/cpplint_presubmit.py index 478151736f..b42a6913dc 100755 --- a/tools/cpplint_presubmit.py +++ b/tools/cpplint_presubmit.py @@ -21,7 +21,7 @@ import pathlib import subprocess import sys -IGNORED_FILES = {"runtime/elf.h", "runtime/openjdkjvmti/include/jvmti.h"} +IGNORED_FILES = {"runtime/elf.h", "openjdkjvmti/include/jvmti.h"} INTERESTING_SUFFIXES = {".h", ".cc"} |