summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2016-11-28 07:38:35 -0800
committer Andreas Gampe <agampe@google.com> 2016-11-29 11:11:46 -0800
commit8a0128a5ca0784f6d2b4ca27907e8967a74bc4c5 (patch)
tree0dec75200282ae5e49785395e97bd4e6459f1c09 /compiler/optimizing/nodes.h
parent60438b46090d22bb9b978196f5aa53fab3b89759 (diff)
ART: Add dex::StringIndex
Add abstraction for uint32_t string index. Test: m test-art-host Change-Id: I917c2881702fe3df112c713f06980f2278ced7ed
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index eebc49c991..165dce3f0d 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -5698,7 +5698,7 @@ class HLoadString FINAL : public HInstruction {
};
HLoadString(HCurrentMethod* current_method,
- uint32_t string_index,
+ dex::StringIndex string_index,
const DexFile& dex_file,
uint32_t dex_pc)
: HInstruction(SideEffectsForArchRuntimeCalls(), dex_pc),
@@ -5717,7 +5717,7 @@ class HLoadString FINAL : public HInstruction {
void SetLoadKindWithStringReference(LoadKind load_kind,
const DexFile& dex_file,
- uint32_t string_index) {
+ dex::StringIndex string_index) {
DCHECK(HasStringReference(load_kind));
load_data_.dex_file_ = &dex_file;
string_index_ = string_index;
@@ -5730,7 +5730,7 @@ class HLoadString FINAL : public HInstruction {
const DexFile& GetDexFile() const;
- uint32_t GetStringIndex() const {
+ dex::StringIndex GetStringIndex() const {
DCHECK(HasStringReference(GetLoadKind()) || /* For slow paths. */ !IsInDexCache());
return string_index_;
}
@@ -5744,7 +5744,7 @@ class HLoadString FINAL : public HInstruction {
bool InstructionDataEquals(const HInstruction* other) const OVERRIDE;
- size_t ComputeHashCode() const OVERRIDE { return string_index_; }
+ size_t ComputeHashCode() const OVERRIDE { return string_index_.index_; }
// Will call the runtime if we need to load the string through
// the dex cache and the string is not guaranteed to be there yet.
@@ -5823,7 +5823,7 @@ class HLoadString FINAL : public HInstruction {
// String index serves also as the hash code and it's also needed for slow-paths,
// so it must not be overwritten with other load data.
- uint32_t string_index_;
+ dex::StringIndex string_index_;
union {
const DexFile* dex_file_; // For string reference.