From 344b0d18eb9f9f2f2ef704acadc510a6dd56a282 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Thu, 13 Dec 2018 23:30:14 +0000 Subject: [PATCH] Revert "Add a baseline flag to JIT compile." This reverts commit e734fe8d4aa5f70a5798363774a4ed63357ebe20. Reason for revert: May be breaking tests. Change-Id: I6c0c04a60c1b4f329c472d28a3c2666526bd6383 --- compiler/jit/jit_compiler.cc | 8 ++++---- compiler/jit/jit_compiler.h | 2 +- compiler/optimizing/intrinsics.h | 3 +-- runtime/jit/jit.cc | 9 +++------ runtime/jit/jit.h | 4 ++-- test/566-polymorphic-inlining/polymorphic_inline.cc | 2 +- test/570-checker-osr/osr.cc | 2 +- test/common/runtime_state.cc | 2 +- 8 files changed, 14 insertions(+), 18 deletions(-) diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index e57bbfa1e1..9b8bb3e90e 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -126,11 +126,11 @@ extern "C" void jit_unload(void* handle) { } extern "C" bool jit_compile_method( - void* handle, ArtMethod* method, Thread* self, bool baseline, bool osr) + void* handle, ArtMethod* method, Thread* self, bool osr) REQUIRES_SHARED(Locks::mutator_lock_) { auto* jit_compiler = reinterpret_cast(handle); DCHECK(jit_compiler != nullptr); - return jit_compiler->CompileMethod(self, method, baseline, osr); + return jit_compiler->CompileMethod(self, method, osr); } extern "C" void jit_types_loaded(void* handle, mirror::Class** types, size_t count) @@ -181,7 +181,7 @@ JitCompiler::~JitCompiler() { } } -bool JitCompiler::CompileMethod(Thread* self, ArtMethod* method, bool baseline, bool osr) { +bool JitCompiler::CompileMethod(Thread* self, ArtMethod* method, bool osr) { SCOPED_TRACE << "JIT compiling " << method->PrettyMethod(); DCHECK(!method->IsProxyMethod()); @@ -198,7 +198,7 @@ bool JitCompiler::CompileMethod(Thread* self, ArtMethod* method, bool baseline, TimingLogger::ScopedTiming t2("Compiling", &logger); JitCodeCache* const code_cache = runtime->GetJit()->GetCodeCache(); success = compiler_driver_->GetCompiler()->JitCompile( - self, code_cache, method, baseline, osr, jit_logger_.get()); + self, code_cache, method, /* baseline= */ false, osr, jit_logger_.get()); } // Trim maps to reduce memory usage. diff --git a/compiler/jit/jit_compiler.h b/compiler/jit/jit_compiler.h index 29d2761348..d201611d79 100644 --- a/compiler/jit/jit_compiler.h +++ b/compiler/jit/jit_compiler.h @@ -37,7 +37,7 @@ class JitCompiler { virtual ~JitCompiler(); // Compilation entrypoint. Returns whether the compilation succeeded. - bool CompileMethod(Thread* self, ArtMethod* method, bool baseline, bool osr) + bool CompileMethod(Thread* self, ArtMethod* method, bool osr) REQUIRES_SHARED(Locks::mutator_lock_); const CompilerOptions& GetCompilerOptions() const { diff --git a/compiler/optimizing/intrinsics.h b/compiler/optimizing/intrinsics.h index 50b13c842b..5bd1122698 100644 --- a/compiler/optimizing/intrinsics.h +++ b/compiler/optimizing/intrinsics.h @@ -243,8 +243,7 @@ void IntrinsicCodeGenerator ## Arch::Visit ## Name(HInvoke* invoke ATTRIBUTE_UNU // compilation. #define UNREACHABLE_INTRINSIC(Arch, Name) \ void IntrinsicLocationsBuilder ## Arch::Visit ## Name(HInvoke* invoke) { \ - if (Runtime::Current()->IsAotCompiler() && \ - !codegen_->GetCompilerOptions().IsBaseline()) { \ + if (!codegen_->GetCompilerOptions().IsBaseline()) { \ LOG(FATAL) << "Unreachable: intrinsic " << invoke->GetIntrinsic() \ << " should have been converted to HIR"; \ } \ diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc index 43f32b9d63..e43d771270 100644 --- a/runtime/jit/jit.cc +++ b/runtime/jit/jit.cc @@ -58,7 +58,7 @@ void* Jit::jit_library_handle_ = nullptr; void* Jit::jit_compiler_handle_ = nullptr; void* (*Jit::jit_load_)(void) = nullptr; void (*Jit::jit_unload_)(void*) = nullptr; -bool (*Jit::jit_compile_method_)(void*, ArtMethod*, Thread*, bool, bool) = nullptr; +bool (*Jit::jit_compile_method_)(void*, ArtMethod*, Thread*, bool) = nullptr; void (*Jit::jit_types_loaded_)(void*, mirror::Class**, size_t count) = nullptr; bool (*Jit::jit_generate_debug_info_)(void*) = nullptr; void (*Jit::jit_update_options_)(void*) = nullptr; @@ -242,7 +242,7 @@ bool Jit::LoadCompilerLibrary(std::string* error_msg) { return true; } -bool Jit::CompileMethod(ArtMethod* method, Thread* self, bool baseline, bool osr) { +bool Jit::CompileMethod(ArtMethod* method, Thread* self, bool osr) { DCHECK(Runtime::Current()->UseJitCompilation()); DCHECK(!method->IsRuntimeMethod()); @@ -272,7 +272,7 @@ bool Jit::CompileMethod(ArtMethod* method, Thread* self, bool baseline, bool osr VLOG(jit) << "Compiling method " << ArtMethod::PrettyMethod(method_to_compile) << " osr=" << std::boolalpha << osr; - bool success = jit_compile_method_(jit_compiler_handle_, method_to_compile, self, baseline, osr); + bool success = jit_compile_method_(jit_compiler_handle_, method_to_compile, self, osr); code_cache_->DoneCompiling(method_to_compile, self, osr); if (!success) { VLOG(jit) << "Failed to compile method " @@ -549,7 +549,6 @@ class JitCompileTask final : public Task { enum class TaskKind { kAllocateProfile, kCompile, - kCompileBaseline, kCompileOsr, }; @@ -569,12 +568,10 @@ class JitCompileTask final : public Task { ScopedObjectAccess soa(self); switch (kind_) { case TaskKind::kCompile: - case TaskKind::kCompileBaseline: case TaskKind::kCompileOsr: { Runtime::Current()->GetJit()->CompileMethod( method_, self, - /* baseline= */ (kind_ == TaskKind::kCompileBaseline), /* osr= */ (kind_ == TaskKind::kCompileOsr)); break; } diff --git a/runtime/jit/jit.h b/runtime/jit/jit.h index 485537ca89..7ce5f07672 100644 --- a/runtime/jit/jit.h +++ b/runtime/jit/jit.h @@ -161,7 +161,7 @@ class Jit { // Create JIT itself. static Jit* Create(JitCodeCache* code_cache, JitOptions* options); - bool CompileMethod(ArtMethod* method, Thread* self, bool baseline, bool osr) + bool CompileMethod(ArtMethod* method, Thread* self, bool osr) REQUIRES_SHARED(Locks::mutator_lock_); const JitCodeCache* GetCodeCache() const { @@ -304,7 +304,7 @@ class Jit { static void* jit_compiler_handle_; static void* (*jit_load_)(void); static void (*jit_unload_)(void*); - static bool (*jit_compile_method_)(void*, ArtMethod*, Thread*, bool, bool); + static bool (*jit_compile_method_)(void*, ArtMethod*, Thread*, bool); static void (*jit_types_loaded_)(void*, mirror::Class**, size_t count); static void (*jit_update_options_)(void*); static bool (*jit_generate_debug_info_)(void*); diff --git a/test/566-polymorphic-inlining/polymorphic_inline.cc b/test/566-polymorphic-inlining/polymorphic_inline.cc index 00827cf8d5..17ccd9a781 100644 --- a/test/566-polymorphic-inlining/polymorphic_inline.cc +++ b/test/566-polymorphic-inlining/polymorphic_inline.cc @@ -46,7 +46,7 @@ static void do_checks(jclass cls, const char* method_name) { usleep(1000); } // Will either ensure it's compiled or do the compilation itself. - jit->CompileMethod(method, soa.Self(), /*baseline=*/ false, /*osr=*/ false); + jit->CompileMethod(method, soa.Self(), /* osr */ false); } CodeInfo info(header); diff --git a/test/570-checker-osr/osr.cc b/test/570-checker-osr/osr.cc index dc0e94cbc7..b2b363447f 100644 --- a/test/570-checker-osr/osr.cc +++ b/test/570-checker-osr/osr.cc @@ -128,7 +128,7 @@ extern "C" JNIEXPORT void JNICALL Java_Main_ensureHasOsrCode(JNIEnv* env, // Sleep to yield to the compiler thread. usleep(1000); // Will either ensure it's compiled or do the compilation itself. - jit->CompileMethod(m, Thread::Current(), /*baseline=*/ false, /*osr=*/ true); + jit->CompileMethod(m, Thread::Current(), /* osr */ true); } }); } diff --git a/test/common/runtime_state.cc b/test/common/runtime_state.cc index 55631a9651..65127fcab1 100644 --- a/test/common/runtime_state.cc +++ b/test/common/runtime_state.cc @@ -227,7 +227,7 @@ static void ForceJitCompiled(Thread* self, ArtMethod* method) REQUIRES(!Locks::m // Make sure there is a profiling info, required by the compiler. ProfilingInfo::Create(self, method, /* retry_allocation */ true); // Will either ensure it's compiled or do the compilation itself. - jit->CompileMethod(method, self, /*baseline=*/ false, /*osr=*/ false); + jit->CompileMethod(method, self, /* osr */ false); } } }