summaryrefslogtreecommitdiff
path: root/compiler/optimizing/builder.h
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2017-12-15 11:19:33 -0800
committer Mathieu Chartier <mathieuc@google.com> 2017-12-22 09:41:17 -0800
commit808c7a57bb913b13c22884f57cdacd59bf1fdb3f (patch)
treed7f0d7cabaac5a7646c25bae584a82a9aa279cc0 /compiler/optimizing/builder.h
parent64bae9fb677aa0e2406d13ea9f8ebaa92e16f978 (diff)
Make CodeItem fields private
Make code item fields private and use accessors. Added a hand full of friend classes to reduce the size of the change. Changed default to be nullable and removed CreateNullable. CreateNullable was a bad API since it defaulted to the unsafe, may add a CreateNonNullable if it's important for performance. Motivation: Have a different layout for code items in cdex. Bug: 63756964 Test: test-art-host-gtest Test: test/testrunner/testrunner.py --host Test: art/tools/run-jdwp-tests.sh '--mode=host' '--variant=X32' --debug Change-Id: I42bc7435e20358682075cb6de52713b595f95bf9
Diffstat (limited to 'compiler/optimizing/builder.h')
-rw-r--r--compiler/optimizing/builder.h20
1 files changed, 5 insertions, 15 deletions
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h
index 0bb3a051f7..c40e0b4e6a 100644
--- a/compiler/optimizing/builder.h
+++ b/compiler/optimizing/builder.h
@@ -18,6 +18,7 @@
#define ART_COMPILER_OPTIMIZING_BUILDER_H_
#include "base/arena_object.h"
+#include "code_item_accessors.h"
#include "dex_file-inl.h"
#include "dex_file.h"
#include "driver/compiler_driver.h"
@@ -33,7 +34,7 @@ class OptimizingCompilerStats;
class HGraphBuilder : public ValueObject {
public:
HGraphBuilder(HGraph* graph,
- const DexFile::CodeItem* code_item,
+ const CodeItemDebugInfoAccessor& accessor,
const DexCompilationUnit* dex_compilation_unit,
const DexCompilationUnit* outer_compilation_unit,
CompilerDriver* driver,
@@ -45,20 +46,9 @@ class HGraphBuilder : public ValueObject {
// Only for unit testing.
HGraphBuilder(HGraph* graph,
const DexCompilationUnit* dex_compilation_unit,
- const DexFile::CodeItem& code_item,
+ const CodeItemDebugInfoAccessor& accessor,
VariableSizedHandleScope* handles,
- DataType::Type return_type = DataType::Type::kInt32)
- : graph_(graph),
- dex_file_(&graph->GetDexFile()),
- code_item_(&code_item),
- dex_compilation_unit_(dex_compilation_unit),
- outer_compilation_unit_(nullptr),
- compiler_driver_(nullptr),
- code_generator_(nullptr),
- compilation_stats_(nullptr),
- interpreter_metadata_(nullptr),
- handles_(handles),
- return_type_(return_type) {}
+ DataType::Type return_type = DataType::Type::kInt32);
GraphAnalysisResult BuildGraph();
void BuildIntrinsicGraph(ArtMethod* method);
@@ -70,7 +60,7 @@ class HGraphBuilder : public ValueObject {
HGraph* const graph_;
const DexFile* const dex_file_;
- const DexFile::CodeItem* const code_item_; // null for intrinsic graph.
+ const CodeItemDebugInfoAccessor code_item_accessor_; // null for intrinsic graph.
// The compilation unit of the current method being compiled. Note that
// it can be an inlined method.