From 211c2119dc8932bdb264fae858adba6c0541ce3c Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 24 Sep 2015 16:52:33 +0100 Subject: 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 --- compiler/utils/array_ref.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'compiler/utils/array_ref.h') 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_; -- cgit v1.2.3-59-g8ed1b