summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2021-05-21 16:36:23 +0100
committerVladimir Marko <vmarko@google.com>2021-05-26 19:36:28 +0000
commit32388f454e2bcda0d809c9691b011aab177b2286 (patch)
tree00c71efc58445c88c1cebb8c886d182a1f6d3fa1 /compiler
parent42da7e6ea4b1e03c3424ef10fa2b15266f72d894 (diff)
dex2oat: Abort app compilation without boot image.
Also avoid crash in GraphChecker for bad instructions that throw into catch block but do not have an environment. And DCHECK() that java_lang_Double_doubleToRawLongBits and java_lang_Float_floatToRawIntBits are intrinsics. (cherry picked from commit d42902692d1fbb101a3c60ba314df69005da9c83) Test: New test Dex2oatTest.MissingBootImageTest. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 188684102 Merged-In: I13ec2ee8a7968c0a5652aa67ec6291d07a986c80 Change-Id: I531b87c25e937f8c5f7d471cb7878e086e9662b5
Diffstat (limited to 'compiler')
-rw-r--r--compiler/optimizing/critical_native_abi_fixup_arm.cc1
-rw-r--r--compiler/optimizing/graph_checker.cc7
2 files changed, 7 insertions, 1 deletions
diff --git a/compiler/optimizing/critical_native_abi_fixup_arm.cc b/compiler/optimizing/critical_native_abi_fixup_arm.cc
index 11d42a41ee..3c4db4bca7 100644
--- a/compiler/optimizing/critical_native_abi_fixup_arm.cc
+++ b/compiler/optimizing/critical_native_abi_fixup_arm.cc
@@ -49,6 +49,7 @@ static void FixUpArguments(HInvokeStaticOrDirect* invoke) {
: WellKnownClasses::java_lang_Float_floatToRawIntBits;
ArtMethod* resolved_method = jni::DecodeArtMethod(known_method);
DCHECK(resolved_method != nullptr);
+ DCHECK(resolved_method->IsIntrinsic());
MethodReference target_method(nullptr, 0);
{
ScopedObjectAccess soa(Thread::Current());
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index 44de54eccf..d1769cea0d 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -507,7 +507,12 @@ void GraphChecker::VisitInstruction(HInstruction* instruction) {
}
}
- if (instruction->CanThrowIntoCatchBlock()) {
+ if (instruction->CanThrow() && !instruction->HasEnvironment()) {
+ AddError(StringPrintf("Throwing instruction %s:%d in block %d does not have an environment.",
+ instruction->DebugName(),
+ instruction->GetId(),
+ current_block_->GetBlockId()));
+ } else if (instruction->CanThrowIntoCatchBlock()) {
// Find the top-level environment. This corresponds to the environment of
// the catch block since we do not inline methods with try/catch.
HEnvironment* environment = instruction->GetEnvironment();