summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Calin Juravle <calin@google.com> 2015-10-12 15:01:58 +0100
committer Calin Juravle <calin@google.com> 2015-10-12 18:01:14 +0100
commit2c1ffc3a06e9ed0411e29e7dc2558b5d657ede7a (patch)
treeb4164b3862e372a8fb83a1910bb669dedc8664ca /compiler/optimizing/nodes.h
parent89792b9c5ed09dda2937944b69b1b2016807b6aa (diff)
optimizing: propagate type information of arguments
This helps inlining and type check elimination. e.g: void foo(ArrayList a) { int size = a.size(); // this can be inlined now. } Change-Id: I3ffeaa79d9df444aa19511c83c544cb5f9d9ab20
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index c126b59bcc..22327c6a47 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -3905,24 +3905,31 @@ class HXor : public HBinaryOperation {
// the calling convention.
class HParameterValue : public HExpression<0> {
public:
- HParameterValue(uint8_t index,
+ HParameterValue(const DexFile& dex_file,
+ uint16_t type_index,
+ uint8_t index,
Primitive::Type parameter_type,
bool is_this = false)
: HExpression(parameter_type, SideEffects::None(), kNoDexPc),
+ dex_file_(dex_file),
+ type_index_(type_index),
index_(index),
is_this_(is_this),
can_be_null_(!is_this) {}
+ const DexFile& GetDexFile() const { return dex_file_; }
+ uint16_t GetTypeIndex() const { return type_index_; }
uint8_t GetIndex() const { return index_; }
+ bool IsThis() const { return is_this_; }
bool CanBeNull() const OVERRIDE { return can_be_null_; }
void SetCanBeNull(bool can_be_null) { can_be_null_ = can_be_null; }
- bool IsThis() const { return is_this_; }
-
DECLARE_INSTRUCTION(ParameterValue);
private:
+ const DexFile& dex_file_;
+ const uint16_t type_index_;
// The index of this parameter in the parameters list. Must be less
// than HGraph::number_of_in_vregs_.
const uint8_t index_;