summaryrefslogtreecommitdiffstats
path: root/runtime/interpreter/interpreter.cc
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-02-28 16:20:21 -0800
committerIan Rogers <irogers@google.com>2014-02-28 19:03:57 -0800
commitb48b9eb6d181a1f52e2e605cf26a21505f1d46ed (patch)
tree117d99c16f201b2f14adfe0922e56b9ff433c133 /runtime/interpreter/interpreter.cc
parent3c506f9877b4a106d93169b6bb5610b24a84d61c (diff)
downloadart-b48b9eb6d181a1f52e2e605cf26a21505f1d46ed.zip
art-b48b9eb6d181a1f52e2e605cf26a21505f1d46ed.tar.gz
art-b48b9eb6d181a1f52e2e605cf26a21505f1d46ed.tar.bz2
Fix clang to compile and run host tests.
Don't use the computed goto interpreter with clang 3.4 as it causes compilation to hang. Avoid inclusion of LLVM_(HOST|DEVICE)_BUILD_MK except for with portable as it sets clang incompatible cflags. Most fixes are self-evident, for the quick dex file method inliner the enums were being used with ostreams, so fix the enums and operator out python script to allow this. Note this change effects portable but this is untestable as portable was broken by ELF file and mc linker changes. Change-Id: Ia54348f6b1bd3f76d3b71c6e8c5f97626386b903
Diffstat (limited to 'runtime/interpreter/interpreter.cc')
-rw-r--r--runtime/interpreter/interpreter.cc34
1 files changed, 31 insertions, 3 deletions
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc
index 40d4ea3..abe7fe1 100644
--- a/runtime/interpreter/interpreter.cc
+++ b/runtime/interpreter/interpreter.cc
@@ -286,11 +286,39 @@ static void InterpreterJni(Thread* self, ArtMethod* method, const StringPiece& s
}
enum InterpreterImplKind {
- kSwitchImpl, // switch-based interpreter implementation.
- kComputedGotoImplKind // computed-goto-based interpreter implementation.
+ kSwitchImpl, // Switch-based interpreter implementation.
+ kComputedGotoImplKind // Computed-goto-based interpreter implementation.
};
-static const InterpreterImplKind kInterpreterImplKind = kComputedGotoImplKind;
+#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<bool do_access_check, bool transaction_active>
+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<true, false>(Thread* self, MethodHelper& mh,
+ const DexFile::CodeItem* code_item,
+ ShadowFrame& shadow_frame, JValue result_register);
+template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
+JValue ExecuteGotoImpl<false, false>(Thread* self, MethodHelper& mh,
+ const DexFile::CodeItem* code_item,
+ ShadowFrame& shadow_frame, JValue result_register);
+template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
+JValue ExecuteGotoImpl<true, true>(Thread* self, MethodHelper& mh,
+ const DexFile::CodeItem* code_item,
+ ShadowFrame& shadow_frame, JValue result_register);
+template SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
+JValue ExecuteGotoImpl<false, true>(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)