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

Unified Diff: src/heap/heap.cc

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/debug/debug.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 9cc4154d1f00cb60d65fcc13148d6e400c56256b..ef7030e7aaddb23b7e44519fb191fa3db35628d7 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -715,12 +715,9 @@ void Heap::GarbageCollectionEpilogue() {
void Heap::PreprocessStackTraces() {
- if (!weak_stack_trace_list()->IsWeakFixedArray()) return;
- WeakFixedArray* array = WeakFixedArray::cast(weak_stack_trace_list());
- int length = array->Length();
- for (int i = 0; i < length; i++) {
- if (array->IsEmptySlot(i)) continue;
- FixedArray* elements = FixedArray::cast(array->Get(i));
+ WeakFixedArray::Iterator iterator(weak_stack_trace_list());
+ FixedArray* elements;
+ while ((elements = iterator.Next<FixedArray>())) {
for (int j = 1; j < elements->length(); j += 4) {
Object* maybe_code = elements->get(j + 2);
// If GC happens while adding a stack trace to the weak fixed array,
« no previous file with comments | « src/debug/debug.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698