Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index b526a01535e23f03ac123b1fdf13de6ff3a79edf..ff94105834004077bb8406dad939f42d83e8d6c7 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -407,8 +407,14 @@ Handle<Object> Isolate::CaptureSimpleStackTrace(Handle<JSObject> error_object, |
} |
} |
elements->set(0, Smi::FromInt(sloppy_frames)); |
+ elements->Shrink(cursor); |
Handle<JSArray> result = factory()->NewJSArrayWithElements(elements); |
result->set_length(Smi::FromInt(cursor)); |
+ // Queue this structured stack trace for preprocessing on GC. |
+ Handle<Object> old_weak_list(heap()->weak_stack_trace_list(), this); |
+ Handle<WeakFixedArray> new_weak_list = |
+ WeakFixedArray::Add(old_weak_list, elements); |
+ factory()->set_weak_stack_trace_list(new_weak_list); |
return result; |
} |