summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/builder.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-07-04 09:41:32 +0100
committerNicolas Geoffray <ngeoffray@google.com>2014-07-14 10:06:11 +0100
commite50383288a75244255d3ecedcc79ffe9caf774cb (patch)
tree8858489463a57c7b50f7db4d972abec21302b7a7 /compiler/optimizing/builder.h
parentcf90ba7ebe00346651f3b7ce1e5b1f785f7caabd (diff)
downloadandroid_art-e50383288a75244255d3ecedcc79ffe9caf774cb.tar.gz
android_art-e50383288a75244255d3ecedcc79ffe9caf774cb.tar.bz2
android_art-e50383288a75244255d3ecedcc79ffe9caf774cb.zip
Support fields in optimizing compiler.
- Required support for temporaries, to be only used by baseline compiler. - Also fixed a few invalid assumptions around locations and instructions that don't need materialization. These instructions should not have an Out. Change-Id: Idc4a30dd95dd18015137300d36bec55fc024cf62
Diffstat (limited to 'compiler/optimizing/builder.h')
-rw-r--r--compiler/optimizing/builder.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h
index ee32ca80ac..f94b8e810a 100644
--- a/compiler/optimizing/builder.h
+++ b/compiler/optimizing/builder.h
@@ -18,6 +18,7 @@
#define ART_COMPILER_OPTIMIZING_BUILDER_H_
#include "dex_file.h"
+#include "driver/compiler_driver.h"
#include "driver/dex_compilation_unit.h"
#include "primitive.h"
#include "utils/allocation.h"
@@ -32,7 +33,8 @@ class HGraphBuilder : public ValueObject {
public:
HGraphBuilder(ArenaAllocator* arena,
DexCompilationUnit* dex_compilation_unit = nullptr,
- const DexFile* dex_file = nullptr)
+ const DexFile* dex_file = nullptr,
+ CompilerDriver* driver = nullptr)
: arena_(arena),
branch_targets_(arena, 0),
locals_(arena, 0),
@@ -43,7 +45,8 @@ class HGraphBuilder : public ValueObject {
constant0_(nullptr),
constant1_(nullptr),
dex_file_(dex_file),
- dex_compilation_unit_(dex_compilation_unit) { }
+ dex_compilation_unit_(dex_compilation_unit),
+ compiler_driver_(driver) {}
HGraph* BuildGraph(const DexFile::CodeItem& code);
@@ -84,11 +87,13 @@ class HGraphBuilder : public ValueObject {
template<typename T>
void Binop_22s(const Instruction& instruction, bool reverse);
- template<typename T> void If_21t(const Instruction& instruction, int32_t dex_offset);
- template<typename T> void If_22t(const Instruction& instruction, int32_t dex_offset);
+ template<typename T> void If_21t(const Instruction& instruction, uint32_t dex_offset);
+ template<typename T> void If_22t(const Instruction& instruction, uint32_t dex_offset);
void BuildReturn(const Instruction& instruction, Primitive::Type type);
+ bool BuildFieldAccess(const Instruction& instruction, uint32_t dex_offset, bool is_get);
+
// Builds an invocation node and returns whether the instruction is supported.
bool BuildInvoke(const Instruction& instruction,
uint32_t dex_offset,
@@ -117,6 +122,7 @@ class HGraphBuilder : public ValueObject {
const DexFile* const dex_file_;
DexCompilationUnit* const dex_compilation_unit_;
+ CompilerDriver* const compiler_driver_;
DISALLOW_COPY_AND_ASSIGN(HGraphBuilder);
};