summaryrefslogtreecommitdiffstats
path: root/compiler/utils
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-02-26 14:01:05 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-02-26 14:01:06 +0000
commit504e6997501aa19c7e7973e70f187314af95602c (patch)
tree7314b38ad594ac1360861a62c574ee8e5d892233 /compiler/utils
parentef2cc5a9c6e508a3e8b24d04ca35f7422f27e112 (diff)
parentbe9a92aa804c0d210f80966b74ef8ed3987f335a (diff)
downloadandroid_art-504e6997501aa19c7e7973e70f187314af95602c.tar.gz
android_art-504e6997501aa19c7e7973e70f187314af95602c.tar.bz2
android_art-504e6997501aa19c7e7973e70f187314af95602c.zip
Merge "Add conditional branches, and build dominator tree."
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/growable_array.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/utils/growable_array.h b/compiler/utils/growable_array.h
index b59187032e..82b6a607e7 100644
--- a/compiler/utils/growable_array.h
+++ b/compiler/utils/growable_array.h
@@ -161,6 +161,18 @@ class GrowableArray {
size_t Size() const { return num_used_; }
+ bool IsEmpty() const { return num_used_ == 0; }
+
+ T Pop() {
+ DCHECK_GE(num_used_, (size_t)0);
+ return elem_list_[--num_used_];
+ }
+
+ T Peek() const {
+ DCHECK_GE(num_used_, (size_t)0);
+ return elem_list_[num_used_ - 1];
+ }
+
void SetSize(size_t new_size) {
Resize(new_size);
num_used_ = new_size;