diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-04-03 18:49:58 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-04-04 09:59:06 +0100 |
commit | 2e7038ac5848468740d6a419434d3dde8c585a53 (patch) | |
tree | 465940d5cc57b28c4f5b5ad588f6d86ee72097ed /compiler/optimizing/nodes.h | |
parent | a7b2826fa469c626ff2c3ff26fd848c28bccc092 (diff) | |
download | art-2e7038ac5848468740d6a419434d3dde8c585a53.zip art-2e7038ac5848468740d6a419434d3dde8c585a53.tar.gz art-2e7038ac5848468740d6a419434d3dde8c585a53.tar.bz2 |
Add support for new-instance and invoke-direct.
Change-Id: I2daed646904f7711972a7da15d88be7573426932
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 2b21905..830d0c7 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -201,6 +201,7 @@ class HBasicBlock : public ArenaObject { M(InvokeStatic) \ M(LoadLocal) \ M(Local) \ + M(NewInstance) \ M(PushArgument) \ M(Return) \ M(ReturnVoid) \ @@ -593,7 +594,7 @@ class HIntConstant : public HTemplateInstruction<0> { class HInvoke : public HInstruction { public: - HInvoke(ArenaAllocator* arena, uint32_t number_of_arguments, int32_t dex_pc) + HInvoke(ArenaAllocator* arena, uint32_t number_of_arguments, uint32_t dex_pc) : inputs_(arena, number_of_arguments), dex_pc_(dex_pc) { inputs_.SetSize(number_of_arguments); @@ -606,11 +607,11 @@ class HInvoke : public HInstruction { inputs_.Put(index, argument); } - int32_t GetDexPc() const { return dex_pc_; } + uint32_t GetDexPc() const { return dex_pc_; } protected: GrowableArray<HInstruction*> inputs_; - const int32_t dex_pc_; + const uint32_t dex_pc_; private: DISALLOW_COPY_AND_ASSIGN(HInvoke); @@ -620,8 +621,8 @@ class HInvokeStatic : public HInvoke { public: HInvokeStatic(ArenaAllocator* arena, uint32_t number_of_arguments, - int32_t dex_pc, - int32_t index_in_dex_cache) + uint32_t dex_pc, + uint32_t index_in_dex_cache) : HInvoke(arena, number_of_arguments, dex_pc), index_in_dex_cache_(index_in_dex_cache) {} uint32_t GetIndexInDexCache() const { return index_in_dex_cache_; } @@ -634,6 +635,22 @@ class HInvokeStatic : public HInvoke { DISALLOW_COPY_AND_ASSIGN(HInvokeStatic); }; +class HNewInstance : public HTemplateInstruction<0> { + public: + HNewInstance(uint32_t dex_pc, uint16_t type_index) : dex_pc_(dex_pc), type_index_(type_index) {} + + uint32_t GetDexPc() const { return dex_pc_; } + uint16_t GetTypeIndex() const { return type_index_; } + + DECLARE_INSTRUCTION(NewInstance) + + private: + const uint32_t dex_pc_; + const uint16_t type_index_; + + DISALLOW_COPY_AND_ASSIGN(HNewInstance); +}; + // HPushArgument nodes are inserted after the evaluation of an argument // of a call. Their mere purpose is to ease the code generator's work. class HPushArgument : public HTemplateInstruction<1> { |