summaryrefslogtreecommitdiff
path: root/compiler/optimizing/intrinsics.cc
diff options
context:
space:
mode:
author Orion Hodson <oth@google.com> 2017-09-29 15:07:27 +0100
committer Orion Hodson <oth@google.com> 2017-10-01 12:08:08 +0100
commitcfcc9cfb44bab79f7381bcc4bfd9bf2d4435f734 (patch)
tree6637daf0cde4f14afd02793ad268f22f9257bd4c /compiler/optimizing/intrinsics.cc
parentf67f115423c9ef5aa62a33c12670cd8f89457c9c (diff)
ART: Increase the number of potential instrinsics
The new limit is 256 intrinsics. Adds additional sanity checks. Avoids setting the kAccPreviouslyWarm bit for intrinics (defaults to true). Bug: 65872996 Test: art/test.py --host -j32 Change-Id: I33ea67c9b6b8500b3ceb8a085358f075f6fcbb82
Diffstat (limited to 'compiler/optimizing/intrinsics.cc')
-rw-r--r--compiler/optimizing/intrinsics.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/optimizing/intrinsics.cc b/compiler/optimizing/intrinsics.cc
index 11725f43c3..daec634f28 100644
--- a/compiler/optimizing/intrinsics.cc
+++ b/compiler/optimizing/intrinsics.cc
@@ -30,6 +30,16 @@
namespace art {
+// Check that intrinsic enum values fit within space set aside in ArtMethod modifier flags.
+#define CHECK_INTRINSICS_ENUM_VALUES(Name, IsStatic, NeedsEnvironmentOrCache, SideEffects, Exceptions, ...) \
+ static_assert( \
+ static_cast<uint32_t>(Intrinsics::k ## Name) <= (kAccIntrinsicBits >> CTZ(kAccIntrinsicBits)), \
+ "Instrinsics enumeration space overflow: ");
+#include "intrinsics_list.h"
+ INTRINSICS_LIST(CHECK_INTRINSICS_ENUM_VALUES)
+#undef INTRINSICS_LIST
+#undef CHECK_INTRINSICS_ENUM_VALUES
+
// Function that returns whether an intrinsic is static/direct or virtual.
static inline InvokeType GetIntrinsicInvokeType(Intrinsics i) {
switch (i) {
@@ -109,6 +119,7 @@ static bool CheckInvokeType(Intrinsics intrinsic, HInvoke* invoke) {
// InvokeStaticOrDirect.
InvokeType intrinsic_type = GetIntrinsicInvokeType(intrinsic);
InvokeType invoke_type = invoke->GetInvokeType();
+
switch (intrinsic_type) {
case kStatic:
return (invoke_type == kStatic);