diff options
author | Vladimir Marko <vmarko@google.com> | 2020-05-13 09:21:00 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2020-05-15 14:09:54 +0000 |
commit | f91fc1220f1b77c55317ff50f4dde8e6b043858f (patch) | |
tree | 3b8416a4fa9b9278d1114d4002485e0cb1c704bf /compiler/optimizing/instruction_builder.cc | |
parent | 33c091eaaa0febedc93cff820def75b122fde867 (diff) |
Optimizing: Run gtests without creating the Runtime.
The only Optimizing test that actually needs a Runtime is
the ReferenceTypePropagationTest, so we make it subclass
CommonCompilerTest explicitly and change OptimizingUnitTest
to subclass CommonArtTest for the other tests.
On host, each test that initializes the Runtime takes ~220ms
more than without initializing the Runtime. For example, the
ConstantFoldingTest that has 10 individual tests previously
took over 2.2s to run but without the Runtime initialization
it takes around 3-5ms. On target, running 32-bit gtests on
taimen with run-gtests.sh (single-threaded) goes from
~28m47s to ~26m13s, a reduction of ~9%.
Test: m test-art-host-gtest
Test: run-gtests.sh
Change-Id: I43e50ed58e52cc0ad04cdb4d39801bfbae840a3d
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r-- | compiler/optimizing/instruction_builder.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index 768bc2465c..69f67780f1 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -380,13 +380,14 @@ bool HInstructionBuilder::Build() { AppendInstruction(new (allocator_) HNativeDebugInfo(dex_pc)); } - DCHECK(!Thread::Current()->IsExceptionPending()) + // Note: There may be no Thread for gtests. + DCHECK(Thread::Current() == nullptr || !Thread::Current()->IsExceptionPending()) << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << " " << pair.Inst().Name() << "@" << dex_pc; if (!ProcessDexInstruction(pair.Inst(), dex_pc, quicken_index)) { return false; } - DCHECK(!Thread::Current()->IsExceptionPending()) + DCHECK(Thread::Current() == nullptr || !Thread::Current()->IsExceptionPending()) << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << " " << pair.Inst().Name() << "@" << dex_pc; |