diff options
author | 2014-11-12 11:43:01 +0000 | |
---|---|---|
committer | 2014-11-12 11:43:02 +0000 | |
commit | 0994a63315fbb912f0b99f59a042174a59674af4 (patch) | |
tree | a665b8b4935f99eab4bb81ad703fe0ec4efc1d10 /compiler/optimizing/nodes.h | |
parent | 15136cb06f0a0fd5f60a832c33870de53c74696a (diff) | |
parent | b7baf5c58d0e864f8c3f889357c51288aed42e61 (diff) |
Merge "Implement monitorenter/monitorexit."
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 0c75e41fc4..1545b0a026 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -508,6 +508,7 @@ class HBasicBlock : public ArenaObject<kArenaAllocMisc> { M(LoadString, Instruction) \ M(Local, Instruction) \ M(LongConstant, Constant) \ + M(MonitorOperation, Instruction) \ M(Mul, BinaryOperation) \ M(Neg, UnaryOperation) \ M(NewArray, Instruction) \ @@ -2431,6 +2432,36 @@ class HCheckCast : public HTemplateInstruction<2> { DISALLOW_COPY_AND_ASSIGN(HCheckCast); }; +class HMonitorOperation : public HTemplateInstruction<1> { + public: + enum OperationKind { + kEnter, + kExit, + }; + + HMonitorOperation(HInstruction* object, OperationKind kind, uint32_t dex_pc) + : HTemplateInstruction(SideEffects::None()), kind_(kind), dex_pc_(dex_pc) { + SetRawInputAt(0, object); + } + + // Instruction may throw a Java exception, so we need an environment. + bool NeedsEnvironment() const OVERRIDE { return true; } + bool CanThrow() const OVERRIDE { return true; } + + uint32_t GetDexPc() const { return dex_pc_; } + + bool IsEnter() const { return kind_ == kEnter; } + + DECLARE_INSTRUCTION(MonitorOperation); + + protected: + const OperationKind kind_; + const uint32_t dex_pc_; + + private: + DISALLOW_COPY_AND_ASSIGN(HMonitorOperation); +}; + class MoveOperands : public ArenaObject<kArenaAllocMisc> { public: |