From 66d9bdb94f21106aaaa31a8fd686098672075e04 Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Thu, 28 Aug 2014 18:25:09 +0200 Subject: [PATCH] Enable computed goto interpreter on the host We disabled the computed goto interpreter when compiling with clang because of compilation issues. Since we compile with clang on the host, we used the switch-based interpreter. Now clang is able to compile the computed goto interpreter, we can use it by default on the host. Change-Id: Ifa2a2d3c171b1116ecd3b3f213382c3c85e93f66 --- runtime/Android.mk | 5 +---- runtime/interpreter/interpreter.cc | 28 ---------------------------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/runtime/Android.mk b/runtime/Android.mk index 61bc9ff23..46b2e1049 100644 --- a/runtime/Android.mk +++ b/runtime/Android.mk @@ -79,6 +79,7 @@ LIBART_COMMON_SRC_FILES := \ intern_table.cc \ interpreter/interpreter.cc \ interpreter/interpreter_common.cc \ + interpreter/interpreter_goto_table_impl.cc \ interpreter/interpreter_switch_impl.cc \ java_vm_ext.cc \ jdwp/jdwp_event.cc \ @@ -200,10 +201,6 @@ LIBART_COMMON_SRC_FILES += \ entrypoints/quick/quick_throw_entrypoints.cc \ entrypoints/quick/quick_trampoline_entrypoints.cc -# Source files that only compile with GCC. -LIBART_GCC_ONLY_SRC_FILES := \ - interpreter/interpreter_goto_table_impl.cc - LIBART_TARGET_LDFLAGS := LIBART_HOST_LDFLAGS := diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc index 7e685e87e..cd8cce06a 100644 --- a/runtime/interpreter/interpreter.cc +++ b/runtime/interpreter/interpreter.cc @@ -316,35 +316,7 @@ enum InterpreterImplKind { kComputedGotoImplKind // Computed-goto-based interpreter implementation. }; -#if !defined(__clang__) static constexpr InterpreterImplKind kInterpreterImplKind = kComputedGotoImplKind; -#else -// Clang 3.4 fails to build the goto interpreter implementation. -static constexpr InterpreterImplKind kInterpreterImplKind = kSwitchImpl; -template -JValue ExecuteGotoImpl(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item, - ShadowFrame& shadow_frame, JValue result_register) { - LOG(FATAL) << "UNREACHABLE"; - exit(0); -} -// Explicit definitions of ExecuteGotoImpl. -template<> SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) -JValue ExecuteGotoImpl(Thread* self, MethodHelper& mh, - const DexFile::CodeItem* code_item, - ShadowFrame& shadow_frame, JValue result_register); -template<> SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) -JValue ExecuteGotoImpl(Thread* self, MethodHelper& mh, - const DexFile::CodeItem* code_item, - ShadowFrame& shadow_frame, JValue result_register); -template<> SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) -JValue ExecuteGotoImpl(Thread* self, MethodHelper& mh, - const DexFile::CodeItem* code_item, - ShadowFrame& shadow_frame, JValue result_register); -template<> SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) -JValue ExecuteGotoImpl(Thread* self, MethodHelper& mh, - const DexFile::CodeItem* code_item, - ShadowFrame& shadow_frame, JValue result_register); -#endif static JValue Execute(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item, ShadowFrame& shadow_frame, JValue result_register) -- 2.11.0