summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/builder.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-04-11 17:43:50 +0100
committerNicolas Geoffray <ngeoffray@google.com>2014-04-16 14:21:12 +0100
commit01bc96d007b67fdb7fe349232a83e4b354ce3d08 (patch)
tree1ed36c2d7c0fb204e6f276bd9853153d9350ad1d /compiler/optimizing/builder.h
parent2be6fc74bce10ac68d3d1b39a5019f520ad170ea (diff)
downloadart-01bc96d007b67fdb7fe349232a83e4b354ce3d08.zip
art-01bc96d007b67fdb7fe349232a83e4b354ce3d08.tar.gz
art-01bc96d007b67fdb7fe349232a83e4b354ce3d08.tar.bz2
Long support in optimizing compiler.
- Add stack locations to the Location class. - Change logic of parameter passing/setup by setting the location of such instructions the ones for the calling convention. Change-Id: I4730ad58732813dcb9c238f44f55dfc0baa18799
Diffstat (limited to 'compiler/optimizing/builder.h')
-rw-r--r--compiler/optimizing/builder.h42
1 files changed, 32 insertions, 10 deletions
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h
index 60d9982..108514a 100644
--- a/compiler/optimizing/builder.h
+++ b/compiler/optimizing/builder.h
@@ -19,6 +19,7 @@
#include "dex_file.h"
#include "driver/dex_compilation_unit.h"
+#include "primitive.h"
#include "utils/allocation.h"
#include "utils/growable_array.h"
@@ -29,13 +30,14 @@ class Instruction;
class HBasicBlock;
class HGraph;
class HIntConstant;
+class HLongConstant;
class HInstruction;
class HLocal;
class HGraphBuilder : public ValueObject {
public:
HGraphBuilder(ArenaAllocator* arena,
- const DexCompilationUnit* dex_compilation_unit = nullptr,
+ DexCompilationUnit* dex_compilation_unit = nullptr,
const DexFile* dex_file = nullptr)
: arena_(arena),
branch_targets_(arena, 0),
@@ -63,24 +65,44 @@ class HGraphBuilder : public ValueObject {
void MaybeUpdateCurrentBlock(size_t index);
HBasicBlock* FindBlockStartingAt(int32_t index) const;
- HIntConstant* GetConstant0();
- HIntConstant* GetConstant1();
- HIntConstant* GetConstant(int constant);
+ HIntConstant* GetIntConstant0();
+ HIntConstant* GetIntConstant1();
+ HIntConstant* GetIntConstant(int32_t constant);
+ HLongConstant* GetLongConstant(int64_t constant);
void InitializeLocals(uint16_t count);
HLocal* GetLocalAt(int register_index) const;
void UpdateLocal(int register_index, HInstruction* instruction) const;
- HInstruction* LoadLocal(int register_index) const;
+ HInstruction* LoadLocal(int register_index, Primitive::Type type) const;
// Temporarily returns whether the compiler supports the parameters
// of the method.
bool InitializeParameters(uint16_t number_of_parameters);
- template<typename T> void Binop_32x(const Instruction& instruction);
- template<typename T> void Binop_12x(const Instruction& instruction);
- template<typename T> void Binop_22b(const Instruction& instruction, bool reverse);
- template<typename T> void Binop_22s(const Instruction& instruction, bool reverse);
+ template<typename T>
+ void Binop_32x(const Instruction& instruction, Primitive::Type type);
+
+ template<typename T>
+ void Binop_12x(const Instruction& instruction, Primitive::Type type);
+
+ template<typename T>
+ void Binop_22b(const Instruction& instruction, bool reverse);
+
+ template<typename T>
+ void Binop_22s(const Instruction& instruction, bool reverse);
+
template<typename T> void If_22t(const Instruction& instruction, int32_t dex_offset, bool is_not);
+ void BuildReturn(const Instruction& instruction, Primitive::Type type);
+
+ // Builds an invocation node and returns whether the instruction is supported.
+ bool BuildInvoke(const Instruction& instruction,
+ uint32_t dex_offset,
+ uint32_t method_idx,
+ uint32_t number_of_vreg_arguments,
+ bool is_range,
+ uint32_t* args,
+ uint32_t register_index);
+
ArenaAllocator* const arena_;
// A list of the size of the dex code holding block information for
@@ -99,7 +121,7 @@ class HGraphBuilder : public ValueObject {
HIntConstant* constant1_;
const DexFile* const dex_file_;
- const DexCompilationUnit* const dex_compilation_unit_;
+ DexCompilationUnit* const dex_compilation_unit_;
DISALLOW_COPY_AND_ASSIGN(HGraphBuilder);
};