Constructor barrier support in DEX-to-DEX compiler.
Bug: 9307738
Some constructors require a barrier before returning. This CL introduces the
RETURN-VOID-BARRIER instruction. The DEX-to-DEX compiler replaces all
RETURN-VOID instructions where a barrier is required by this instruction.
The interpreter and the verifier are updated to support this new instruction.
Change-Id: If31979b4027bc12157b933eda9fcbd5270edd202
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 1e8ee9c..21725de 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1136,6 +1136,17 @@
}
return result;
}
+ case Instruction::RETURN_VOID_BARRIER: {
+ PREAMBLE();
+ ANDROID_MEMBAR_STORE();
+ JValue result;
+ if (UNLIKELY(instrumentation->HasMethodExitListeners())) {
+ instrumentation->MethodExitEvent(self, this_object_ref.get(),
+ shadow_frame.GetMethod(), inst->GetDexPc(insns),
+ result);
+ }
+ return result;
+ }
case Instruction::RETURN: {
PREAMBLE();
JValue result;
@@ -2932,7 +2943,6 @@
break;
case Instruction::UNUSED_3E ... Instruction::UNUSED_43:
case Instruction::UNUSED_EB ... Instruction::UNUSED_FF:
- case Instruction::UNUSED_73:
case Instruction::UNUSED_79:
case Instruction::UNUSED_7A:
UnexpectedOpcode(inst, mh);