summaryrefslogtreecommitdiff
path: root/runtime/class_linker.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2024-05-02 10:56:42 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2024-05-03 03:44:33 +0000
commitdb15ea652d13811e236e1f12c88807ebfed05da9 (patch)
tree85d01be01468cd684a01dc0ee2b349867f6f2d6a /runtime/class_linker.h
parentf91d21c0b0e4a03102eaa6cfae0f500f8139bc40 (diff)
Refactor transaction checks in switch interpreter.
Prepare for moving the transactional interpreter from `runtime/` to `dex2oat/` by moving transaction checking code to a new file `active_transaction_checker.h`, and breaking unstarted runtime dependency on transaction code by adding an indirection with a virtual call through `ClassLinker`. Consistently return the same value from contraint checks. Previously we were returning the negated result from the `CheckWrite{,Value}Constraint()` compared to the value we received from `Transaction::Write{,Value}Constraint()`. Test: m test-art-host-gtest Test: testrunner.py --host --interp-ac Change-Id: I88a168b6c770932d014e3a40486480590cef0401
Diffstat (limited to 'runtime/class_linker.h')
-rw-r--r--runtime/class_linker.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/class_linker.h b/runtime/class_linker.h
index f2c08b93c5..eabfb4926a 100644
--- a/runtime/class_linker.h
+++ b/runtime/class_linker.h
@@ -890,6 +890,15 @@ class EXPORT ClassLinker {
virtual bool DenyAccessBasedOnPublicSdk(const char* type_descriptor) const;
// Enable or disable public sdk checks.
virtual void SetEnablePublicSdkChecks(bool enabled);
+
+ // Transaction constraint checks for AOT compilation.
+ virtual bool TransactionWriteConstraint(Thread* self, ObjPtr<mirror::Object> obj) const
+ REQUIRES_SHARED(Locks::mutator_lock_);
+ virtual bool TransactionWriteValueConstraint(Thread* self, ObjPtr<mirror::Object> value) const
+ REQUIRES_SHARED(Locks::mutator_lock_);
+ virtual bool TransactionAllocationConstraint(Thread* self, ObjPtr<mirror::Class> klass) const
+ REQUIRES_SHARED(Locks::mutator_lock_);
+
void RemoveDexFromCaches(const DexFile& dex_file);
ClassTable* GetBootClassTable() REQUIRES_SHARED(Locks::classlinker_classes_lock_) {
return boot_class_table_.get();