summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2018-10-24 13:24:22 +0100
committer David Srbecky <dsrbecky@google.com> 2018-10-24 17:11:57 +0100
commit2ee09ffc7a6aca354a958357801711688a7a4154 (patch)
treedbd56e49b025d2a0695610cbfddb7b5bc6432c30
parentfd2aa2bf72563870c9261f248f992a20ac4837a8 (diff)
Split interpreter_switch_impl.cc
Due to regression in clang this file takes long to compile (>10min). As a quick fix, split the file - one per explicit instantiation. Test: Measure incremental build time - it halves the build time. Change-Id: I9d35d43c185deb19ef9cf32ed35328c433a837f2
-rw-r--r--runtime/Android.bp5
-rw-r--r--runtime/interpreter/interpreter_switch_impl-inl.h (renamed from runtime/interpreter/interpreter_switch_impl.cc)15
-rw-r--r--runtime/interpreter/interpreter_switch_impl0.cc30
-rw-r--r--runtime/interpreter/interpreter_switch_impl1.cc30
-rw-r--r--runtime/interpreter/interpreter_switch_impl2.cc30
-rw-r--r--runtime/interpreter/interpreter_switch_impl3.cc30
6 files changed, 129 insertions, 11 deletions
diff --git a/runtime/Android.bp b/runtime/Android.bp
index bedeaf7803..5d99187669 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -96,7 +96,10 @@ libart_cc_defaults {
"interpreter/interpreter_cache.cc",
"interpreter/interpreter_common.cc",
"interpreter/interpreter_intrinsics.cc",
- "interpreter/interpreter_switch_impl.cc",
+ "interpreter/interpreter_switch_impl0.cc",
+ "interpreter/interpreter_switch_impl1.cc",
+ "interpreter/interpreter_switch_impl2.cc",
+ "interpreter/interpreter_switch_impl3.cc",
"interpreter/lock_count_data.cc",
"interpreter/shadow_frame.cc",
"interpreter/unstarted_runtime.cc",
diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl-inl.h
index 4757b57707..4774d6994e 100644
--- a/runtime/interpreter/interpreter_switch_impl.cc
+++ b/runtime/interpreter/interpreter_switch_impl-inl.h
@@ -14,6 +14,9 @@
* limitations under the License.
*/
+#ifndef ART_RUNTIME_INTERPRETER_INTERPRETER_SWITCH_IMPL_INL_H_
+#define ART_RUNTIME_INTERPRETER_INTERPRETER_SWITCH_IMPL_INL_H_
+
#include "interpreter_switch_impl.h"
#include "base/enums.h"
@@ -2571,15 +2574,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void ExecuteSwitchImplCpp(SwitchImplContext* ctx)
return;
} // NOLINT(readability/fn_size)
-// Explicit definitions of ExecuteSwitchImplCpp.
-template HOT_ATTR
-void ExecuteSwitchImplCpp<true, false>(SwitchImplContext* ctx);
-template HOT_ATTR
-void ExecuteSwitchImplCpp<false, false>(SwitchImplContext* ctx);
-template
-void ExecuteSwitchImplCpp<true, true>(SwitchImplContext* ctx);
-template
-void ExecuteSwitchImplCpp<false, true>(SwitchImplContext* ctx);
-
} // namespace interpreter
} // namespace art
+
+#endif // ART_RUNTIME_INTERPRETER_INTERPRETER_SWITCH_IMPL_INL_H_
diff --git a/runtime/interpreter/interpreter_switch_impl0.cc b/runtime/interpreter/interpreter_switch_impl0.cc
new file mode 100644
index 0000000000..00159ecd3f
--- /dev/null
+++ b/runtime/interpreter/interpreter_switch_impl0.cc
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// The interpreter function takes considerable time to compile and link.
+// We compile the explicit definitions separately to speed up the build.
+
+#include "interpreter_switch_impl-inl.h"
+
+namespace art {
+namespace interpreter {
+
+// Explicit definition of ExecuteSwitchImplCpp.
+template HOT_ATTR
+void ExecuteSwitchImplCpp<false, false>(SwitchImplContext* ctx);
+
+} // namespace interpreter
+} // namespace art
diff --git a/runtime/interpreter/interpreter_switch_impl1.cc b/runtime/interpreter/interpreter_switch_impl1.cc
new file mode 100644
index 0000000000..3a86765c68
--- /dev/null
+++ b/runtime/interpreter/interpreter_switch_impl1.cc
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// The interpreter function takes considerable time to compile and link.
+// We compile the explicit definitions separately to speed up the build.
+
+#include "interpreter_switch_impl-inl.h"
+
+namespace art {
+namespace interpreter {
+
+// Explicit definition of ExecuteSwitchImplCpp.
+template
+void ExecuteSwitchImplCpp<false, true>(SwitchImplContext* ctx);
+
+} // namespace interpreter
+} // namespace art
diff --git a/runtime/interpreter/interpreter_switch_impl2.cc b/runtime/interpreter/interpreter_switch_impl2.cc
new file mode 100644
index 0000000000..c2739c13ae
--- /dev/null
+++ b/runtime/interpreter/interpreter_switch_impl2.cc
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// The interpreter function takes considerable time to compile and link.
+// We compile the explicit definitions separately to speed up the build.
+
+#include "interpreter_switch_impl-inl.h"
+
+namespace art {
+namespace interpreter {
+
+// Explicit definition of ExecuteSwitchImplCpp.
+template HOT_ATTR
+void ExecuteSwitchImplCpp<true, false>(SwitchImplContext* ctx);
+
+} // namespace interpreter
+} // namespace art
diff --git a/runtime/interpreter/interpreter_switch_impl3.cc b/runtime/interpreter/interpreter_switch_impl3.cc
new file mode 100644
index 0000000000..808e4bc9c5
--- /dev/null
+++ b/runtime/interpreter/interpreter_switch_impl3.cc
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// The interpreter function takes considerable time to compile and link.
+// We compile the explicit definitions separately to speed up the build.
+
+#include "interpreter_switch_impl-inl.h"
+
+namespace art {
+namespace interpreter {
+
+// Explicit definition of ExecuteSwitchImplCpp.
+template
+void ExecuteSwitchImplCpp<true, true>(SwitchImplContext* ctx);
+
+} // namespace interpreter
+} // namespace art