Skip to content

Commit

Permalink
Revert "Add a baseline flag to JIT compile."
Browse files Browse the repository at this point in the history
This reverts commit e734fe8.

Reason for revert: May be breaking tests.

Change-Id: I6c0c04a60c1b4f329c472d28a3c2666526bd6383
  • Loading branch information
agampe committed Dec 13, 2018
1 parent e734fe8 commit 344b0d1
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 18 deletions.
8 changes: 4 additions & 4 deletions compiler/jit/jit_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<JitCompiler*>(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)
Expand Down Expand Up @@ -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());
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion compiler/jit/jit_compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions compiler/optimizing/intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"; \
} \
Expand Down
9 changes: 3 additions & 6 deletions runtime/jit/jit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());

Expand Down Expand Up @@ -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 "
Expand Down Expand Up @@ -549,7 +549,6 @@ class JitCompileTask final : public Task {
enum class TaskKind {
kAllocateProfile,
kCompile,
kCompileBaseline,
kCompileOsr,
};

Expand All @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/jit/jit.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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*);
Expand Down
2 changes: 1 addition & 1 deletion test/566-polymorphic-inlining/polymorphic_inline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/570-checker-osr/osr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion test/common/runtime_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 344b0d1

Please sign in to comment.