summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Christian Wailes <chriswailes@google.com> 2018-10-05 07:07:42 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-10-05 07:07:42 +0000
commit3adb7f218f1f6f15e2ced105073daa6e14aef2a9 (patch)
tree33331b2200c1f88c269e85453522cf90e07e660d /compiler/driver/compiler_driver.cc
parente0e49b9eb70f8a85891df5b4da73fcc71cb3d62f (diff)
parent0c61be4f9f7b4baaa6ea7c12ba1c8492a7bc14f5 (diff)
Merge "Implemented a new method for walking string references in AppImages."
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index df84b25027..c5416d5a3d 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -2157,10 +2157,9 @@ class InitializeClassVisitor : public CompilationVisitor {
// Otherwise it's in app image but superclasses can't be initialized, no need to proceed.
old_status = klass->GetStatus();
- bool too_many_encoded_fields = false;
- if (!is_boot_image && klass->NumStaticFields() > kMaxEncodedFields) {
- too_many_encoded_fields = true;
- }
+ bool too_many_encoded_fields = !is_boot_image &&
+ klass->NumStaticFields() > kMaxEncodedFields;
+
// If the class was not initialized, we can proceed to see if we can initialize static
// fields. Limit the max number of encoded fields.
if (!klass->IsInitialized() &&
@@ -2210,9 +2209,13 @@ class InitializeClassVisitor : public CompilationVisitor {
if (success) {
runtime->ExitTransactionMode();
DCHECK(!runtime->IsActiveTransaction());
- }
- if (!success) {
+ if (is_boot_image) {
+ // For boot image, we want to put the updated status in the oat class since we
+ // can't reject the image anyways.
+ old_status = klass->GetStatus();
+ }
+ } else {
CHECK(soa.Self()->IsExceptionPending());
mirror::Throwable* exception = soa.Self()->GetException();
VLOG(compiler) << "Initialization of " << descriptor << " aborted because of "
@@ -2226,10 +2229,6 @@ class InitializeClassVisitor : public CompilationVisitor {
soa.Self()->ClearException();
runtime->RollbackAllTransactions();
CHECK_EQ(old_status, klass->GetStatus()) << "Previous class status not restored";
- } else if (is_boot_image) {
- // For boot image, we want to put the updated status in the oat class since we can't
- // reject the image anyways.
- old_status = klass->GetStatus();
}
}