Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1259)

Unified Diff: src/objects-inl.h

Issue 1300333003: Introduce SharedFunctionInfo::Iterator and Script::Iterator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 933360c59fa41a462ed9e3997e2346a0f59db395..04a47277438724bade6950f5c1bca2d7e7e0c3a9 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2523,6 +2523,21 @@ void WeakFixedArray::set_last_used_index(int index) {
}
+template <class T>
+T* WeakFixedArray::Iterator::Next() {
+ if (list_ != NULL) {
+ // Assert that list did not change during iteration.
+ DCHECK_EQ(last_used_index_, list_->last_used_index());
+ while (index_ < list_->Length()) {
+ Object* item = list_->Get(index_++);
+ if (item != Empty()) return T::cast(item);
+ }
+ list_ = NULL;
+ }
+ return NULL;
+}
+
+
int ArrayList::Length() {
if (FixedArray::cast(this)->length() == 0) return 0;
return Smi::cast(FixedArray::cast(this)->get(kLengthIndex))->value();
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698