Add strict flag in transaction
Add a flag named strict_ indicating whether we are compiling app images,
which need more strict constraints to control <clinit>s' behavours.
When the transaction is marked as strict mode, behaviour changes
including nested transactions, field access validation, memory
consumption limit and time out for <clinit> at compile time.
Test: make test-art-host -j64
Change-Id: I7cc0eea161803ad0d7763725d4deaeee21858054
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index ed36e11..a932e38 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -2332,7 +2332,7 @@
// checks in Thread::AssertThreadSuspensionIsAllowable.
Runtime* const runtime = Runtime::Current();
// Run the class initializer in transaction mode.
- runtime->EnterTransactionMode(klass.Get());
+ runtime->EnterTransactionMode(is_app_image, klass.Get());
bool success = manager_->GetClassLinker()->EnsureInitialized(soa.Self(), klass, true,
true);
// TODO we detach transaction from runtime to indicate we quit the transactional