summaryrefslogtreecommitdiff
path: root/runtime/interpreter/interpreter_switch_impl0.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2024-05-20 15:51:01 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2024-05-21 13:48:45 +0000
commit2a25327e2bfdd7f5d128267684b13dc0f0e57e55 (patch)
tree9e9d0b80e78260cd961e47245b6676ce6e4f632e /runtime/interpreter/interpreter_switch_impl0.cc
parente0e0f0740a1c1f4f28e1d1f59fe77625aea8d4a4 (diff)
Further refactor transaction checks in interpreter.
Reverse the relationship between `ActiveTransactionChecker` and `AotClassLinker` by moving the checks to the latter. Move `{Active,Inactive}TransactionChecker` and functions `DoField{Get,Put}()` to the `interpreter_switch_impl*`. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --interp-ac Change-Id: I509083b4ee77a69a3ba7e0d277b0e9e5fb7e32c8
Diffstat (limited to 'runtime/interpreter/interpreter_switch_impl0.cc')
-rw-r--r--runtime/interpreter/interpreter_switch_impl0.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/runtime/interpreter/interpreter_switch_impl0.cc b/runtime/interpreter/interpreter_switch_impl0.cc
index 65ae2fe333..517cce8088 100644
--- a/runtime/interpreter/interpreter_switch_impl0.cc
+++ b/runtime/interpreter/interpreter_switch_impl0.cc
@@ -22,6 +22,42 @@
namespace art HIDDEN {
namespace interpreter {
+// Define the helper class that does not do any transaction checks.
+class InactiveTransactionChecker {
+ public:
+ ALWAYS_INLINE static bool WriteConstraint([[maybe_unused]] Thread* self,
+ [[maybe_unused]] ObjPtr<mirror::Object> obj)
+ REQUIRES_SHARED(Locks::mutator_lock_) {
+ return false;
+ }
+
+ ALWAYS_INLINE static bool WriteValueConstraint([[maybe_unused]] Thread* self,
+ [[maybe_unused]] ObjPtr<mirror::Object> value)
+ REQUIRES_SHARED(Locks::mutator_lock_) {
+ return false;
+ }
+
+ ALWAYS_INLINE static bool ReadConstraint([[maybe_unused]] Thread* self,
+ [[maybe_unused]] ObjPtr<mirror::Object> value)
+ REQUIRES_SHARED(Locks::mutator_lock_) {
+ return false;
+ }
+
+ ALWAYS_INLINE static bool AllocationConstraint([[maybe_unused]] Thread* self,
+ [[maybe_unused]] ObjPtr<mirror::Class> klass)
+ REQUIRES_SHARED(Locks::mutator_lock_) {
+ return false;
+ }
+
+ ALWAYS_INLINE static bool IsTransactionAborted() {
+ return false;
+ }
+
+ static void RecordArrayElementsInTransaction([[maybe_unused]] ObjPtr<mirror::Object> array,
+ [[maybe_unused]] int32_t count)
+ REQUIRES_SHARED(Locks::mutator_lock_) {}
+};
+
// Explicit definition of ExecuteSwitchImplCpp.
template HOT_ATTR
void ExecuteSwitchImplCpp<false>(SwitchImplContext* ctx);