summaryrefslogtreecommitdiff
path: root/compiler/utils/array_ref.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-09-24 16:52:33 +0100
committer Vladimir Marko <vmarko@google.com> 2015-09-25 12:28:37 +0100
commit211c2119dc8932bdb264fae858adba6c0541ce3c (patch)
tree95dd0a75f9bd6745cf7bee4686dd612e353b5301 /compiler/utils/array_ref.h
parent0aeb7599bcd7073a5c849f413fb7a9611f5944eb (diff)
Optimizing: Rewrite DCE's MarkReachableBlocks().
Replace a recursive implementation with a loop using a work list to avoid stack overflow that we would presumably hit for 702-LargeBranchOffset in host debug build with -O0, once the DCE block elimination is enabled for methods containing try-catch. Bug: 24133462 Change-Id: I41288ba368722bcb5d68259c7c147552c8928099
Diffstat (limited to 'compiler/utils/array_ref.h')
-rw-r--r--compiler/utils/array_ref.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/utils/array_ref.h b/compiler/utils/array_ref.h
index 303e0d5ad4..48f0328dce 100644
--- a/compiler/utils/array_ref.h
+++ b/compiler/utils/array_ref.h
@@ -161,6 +161,15 @@ class ArrayRef {
value_type* data() { return array_; }
const value_type* data() const { return array_; }
+ ArrayRef SubArray(size_type pos) const {
+ return SubArray(pos, size_ - pos);
+ }
+ ArrayRef SubArray(size_type pos, size_type length) const {
+ DCHECK_LE(pos, size());
+ DCHECK_LE(length, size() - pos);
+ return ArrayRef(array_ + pos, length);
+ }
+
private:
T* array_;
size_t size_;