Merge "ART: Add experimental constexpr"
diff --git a/runtime/dex_instruction.cc b/runtime/dex_instruction.cc
index 9f34c12..7dc62ed 100644
--- a/runtime/dex_instruction.cc
+++ b/runtime/dex_instruction.cc
@@ -537,6 +537,14 @@
DEX_INSTRUCTION_LIST(VAR_ARGS_RANGE_CHECK)
#undef DEX_INSTRUCTION_LIST
#undef VAR_ARGS_RANGE_CHECK
+
+ #define EXPERIMENTAL_CHECK(o, c, pname, f, i, a, v) \
+ static_assert(kHaveExperimentalInstructions || (((a) & kExperimental) == 0), \
+ "Unexpected experimental instruction.");
+ #include "dex_instruction_list.h"
+ DEX_INSTRUCTION_LIST(EXPERIMENTAL_CHECK)
+ #undef DEX_INSTRUCTION_LIST
+ #undef EXPERIMENTAL_CHECK
};
std::ostream& operator<<(std::ostream& os, const Instruction::Code& code) {
diff --git a/runtime/dex_instruction.h b/runtime/dex_instruction.h
index d269110..6b9ec7d 100644
--- a/runtime/dex_instruction.h
+++ b/runtime/dex_instruction.h
@@ -196,6 +196,8 @@
static constexpr uint32_t kMaxVarArgRegs = 5;
+ static constexpr bool kHaveExperimentalInstructions = false;
+
// Returns the size (in 2 byte code units) of this instruction.
size_t SizeInCodeUnits() const {
int result = kInstructionSizeInCodeUnits[Opcode()];
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index acc918d..a77ba6a 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -1139,7 +1139,7 @@
}
bool MethodVerifier::VerifyInstruction(const Instruction* inst, uint32_t code_offset) {
- if (UNLIKELY(inst->IsExperimental())) {
+ if (Instruction::kHaveExperimentalInstructions && UNLIKELY(inst->IsExperimental())) {
// Experimental instructions don't yet have verifier support implementation.
// While it is possible to use them by themselves, when we try to use stable instructions
// with a virtual register that was created by an experimental instruction,