Implement suspend checks in new compiler.
For simplicity, they are currently placed on all (dex-level)
back edges, and at method entry.
Change-Id: I6e833e244d559dd788c69727e22fe40aff5b3435
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 9018fee..ed6dd93 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -443,6 +443,7 @@
M(BoundsCheck) \
M(NullCheck) \
M(Temporary) \
+ M(SuspendCheck) \
#define FOR_EACH_INSTRUCTION(M) \
FOR_EACH_CONCRETE_INSTRUCTION(M) \
@@ -1593,6 +1594,25 @@
DISALLOW_COPY_AND_ASSIGN(HTemporary);
};
+class HSuspendCheck : public HTemplateInstruction<0> {
+ public:
+ explicit HSuspendCheck(uint32_t dex_pc)
+ : HTemplateInstruction(SideEffects::ChangesSomething()), dex_pc_(dex_pc) {}
+
+ virtual bool NeedsEnvironment() const {
+ return true;
+ }
+
+ uint32_t GetDexPc() const { return dex_pc_; }
+
+ DECLARE_INSTRUCTION(SuspendCheck);
+
+ private:
+ const uint32_t dex_pc_;
+
+ DISALLOW_COPY_AND_ASSIGN(HSuspendCheck);
+};
+
class MoveOperands : public ArenaObject {
public:
MoveOperands(Location source, Location destination)