summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-03-19 10:34:11 +0000
committerNicolas Geoffray <ngeoffray@google.com>2014-03-31 09:44:40 +0100
commit8ccc3f5d06fd217cdaabd37e743adab2031d3720 (patch)
treeec8c904baafb4d9b9bfd582245e2d780bcdfaade /compiler/optimizing/nodes.h
parentad174d1b54bf2fa477bec71a0ca93595f54b8fe9 (diff)
downloadart-8ccc3f5d06fd217cdaabd37e743adab2031d3720.zip
art-8ccc3f5d06fd217cdaabd37e743adab2031d3720.tar.gz
art-8ccc3f5d06fd217cdaabd37e743adab2031d3720.tar.bz2
Add support for invoke-static in optimizing compiler.
Support is limited to calls without parameters and returning void. For simplicity, we currently follow the Quick ABI. Change-Id: I54805161141b7eac5959f1cae0dc138dd0b2e8a5
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index e74ed82..50d5c59 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -185,6 +185,7 @@ class HBasicBlock : public ArenaObject {
M(Goto) \
M(If) \
M(IntConstant) \
+ M(InvokeStatic) \
M(LoadLocal) \
M(Local) \
M(Return) \
@@ -554,6 +555,42 @@ class HIntConstant : public HTemplateInstruction<0> {
DISALLOW_COPY_AND_ASSIGN(HIntConstant);
};
+class HInvoke : public HInstruction {
+ public:
+ HInvoke(ArenaAllocator* arena, uint32_t number_of_arguments, int32_t dex_pc)
+ : inputs_(arena, number_of_arguments),
+ dex_pc_(dex_pc) {
+ inputs_.SetSize(number_of_arguments);
+ }
+
+ virtual intptr_t InputCount() const { return inputs_.Size(); }
+ virtual HInstruction* InputAt(intptr_t i) const { return inputs_.Get(i); }
+
+ int32_t GetDexPc() const { return dex_pc_; }
+
+ protected:
+ GrowableArray<HInstruction*> inputs_;
+ const int32_t dex_pc_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(HInvoke);
+};
+
+class HInvokeStatic : public HInvoke {
+ public:
+ HInvokeStatic(ArenaAllocator* arena, uint32_t number_of_arguments, int32_t dex_pc, int32_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_; }
+
+ DECLARE_INSTRUCTION(InvokeStatic)
+
+ private:
+ uint32_t index_in_dex_cache_;
+
+ DISALLOW_COPY_AND_ASSIGN(HInvokeStatic);
+};
+
class HGraphVisitor : public ValueObject {
public:
explicit HGraphVisitor(HGraph* graph) : graph_(graph) { }