diff options
author | 2023-09-07 11:37:44 +0000 | |
---|---|---|
committer | 2023-09-08 13:45:02 +0000 | |
commit | 1dc27c9f2b132aeccb55f45cc17fbc4dc4a35fa0 (patch) | |
tree | e7f3e602eb05794ded4733d72dd5239a3d38b364 /compiler | |
parent | 8aa54bd205ae14d523f243bfe6892c65d8e65527 (diff) |
riscv64: [codegen] Add VisitNullCheck
Also enable codegen for NullCheck and fix related entrypoint
issues. For now, this is using explicit null checks.
Change the default value of the implicit null checks flag in
the `CompilerOptions`. In `dex2oat` we expect the default
value to be false and override it to true when needed by the
selected architecture. This aligns with the behaviour in
`Runtime` which is the source of this information for JIT.
We do not change the default value for implicit stack
overflow checks flag yet because it requires additional
adjustments to avoid breaking certain gtests.
Test: m test-art-host-gtest
Test: aosp_cf_riscv64_phone-userdebug boots.
Test: run-gtests.sh
# Ignore pre-existing timeout in `TestImageLayout`.
Test: testrunner.py --target --64 --optimizing
# Ignore 49 pre-existing failures.
Bug: 283082089
Change-Id: If663d3279da5e6c53669860cefa7185c53e7e146
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/driver/compiler_options.cc | 2 | ||||
-rw-r--r-- | compiler/driver/compiler_options.h | 2 | ||||
-rw-r--r-- | compiler/optimizing/code_generator_riscv64.cc | 7 | ||||
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 1 |
4 files changed, 7 insertions, 5 deletions
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc index 3ed5f88875..d0770e952b 100644 --- a/compiler/driver/compiler_options.cc +++ b/compiler/driver/compiler_options.cc @@ -57,7 +57,7 @@ CompilerOptions::CompilerOptions() generate_debug_info_(kDefaultGenerateDebugInfo), generate_mini_debug_info_(kDefaultGenerateMiniDebugInfo), generate_build_id_(false), - implicit_null_checks_(true), + implicit_null_checks_(false), implicit_so_checks_(true), implicit_suspend_checks_(false), compile_pic_(false), diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h index 74d081d29e..a5b3ae17d0 100644 --- a/compiler/driver/compiler_options.h +++ b/compiler/driver/compiler_options.h @@ -42,6 +42,7 @@ class VerifierDepsTest; namespace linker { class Arm64RelativePatcherTest; +class Thumb2RelativePatcherTest; } // namespace linker class ArtMethod; @@ -502,6 +503,7 @@ class CompilerOptions final { friend class jit::JitCompiler; friend class verifier::VerifierDepsTest; friend class linker::Arm64RelativePatcherTest; + friend class linker::Thumb2RelativePatcherTest; template <class Base> friend bool ReadCompilerOptions(Base& map, CompilerOptions* options, std::string* error_msg); diff --git a/compiler/optimizing/code_generator_riscv64.cc b/compiler/optimizing/code_generator_riscv64.cc index b4f0caf607..ce0fdf20b5 100644 --- a/compiler/optimizing/code_generator_riscv64.cc +++ b/compiler/optimizing/code_generator_riscv64.cc @@ -2775,13 +2775,12 @@ void InstructionCodeGeneratorRISCV64::VisitNullConstant(HNullConstant* instructi } void LocationsBuilderRISCV64::VisitNullCheck(HNullCheck* instruction) { - UNUSED(instruction); - LOG(FATAL) << "Unimplemented"; + LocationSummary* locations = codegen_->CreateThrowingSlowPathLocations(instruction); + locations->SetInAt(0, Location::RequiresRegister()); } void InstructionCodeGeneratorRISCV64::VisitNullCheck(HNullCheck* instruction) { - UNUSED(instruction); - LOG(FATAL) << "Unimplemented"; + codegen_->GenerateNullCheck(instruction); } void LocationsBuilderRISCV64::VisitOr(HOr* instruction) { diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 0829bc2912..cca11e0c7e 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -782,6 +782,7 @@ static bool CanAssembleGraphForRiscv64(HGraph* graph) { case HInstruction::kInvokeVirtual: case HInstruction::kInvokeInterface: case HInstruction::kCurrentMethod: + case HInstruction::kNullCheck: break; case HInstruction::kInvokeStaticOrDirect: if (it.Current()->AsInvokeStaticOrDirect()->GetCodePtrLocation() == |