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

Side by Side Diff: src/isolate.cc

Issue 1103843002: Preprocess structured stack trace on GC to get rid of code reference. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | src/messages.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include <fstream> // NOLINT(readability/streams) 7 #include <fstream> // NOLINT(readability/streams)
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/v8.h" 10 #include "src/v8.h"
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 } 400 }
401 } 401 }
402 elements->set(cursor++, *recv); 402 elements->set(cursor++, *recv);
403 elements->set(cursor++, *fun); 403 elements->set(cursor++, *fun);
404 elements->set(cursor++, *code); 404 elements->set(cursor++, *code);
405 elements->set(cursor++, *offset); 405 elements->set(cursor++, *offset);
406 frames_seen++; 406 frames_seen++;
407 } 407 }
408 } 408 }
409 elements->set(0, Smi::FromInt(sloppy_frames)); 409 elements->set(0, Smi::FromInt(sloppy_frames));
410 elements->Shrink(cursor);
410 Handle<JSArray> result = factory()->NewJSArrayWithElements(elements); 411 Handle<JSArray> result = factory()->NewJSArrayWithElements(elements);
411 result->set_length(Smi::FromInt(cursor)); 412 result->set_length(Smi::FromInt(cursor));
413 // Queue this structured stack trace for preprocessing on GC.
414 Handle<WeakFixedArray> new_weak_list =
415 WeakFixedArray::Add(factory()->weak_stack_trace_list(), elements);
416 factory()->set_weak_stack_trace_list(new_weak_list);
412 return result; 417 return result;
413 } 418 }
414 419
415 420
416 MaybeHandle<JSObject> Isolate::CaptureAndSetDetailedStackTrace( 421 MaybeHandle<JSObject> Isolate::CaptureAndSetDetailedStackTrace(
417 Handle<JSObject> error_object) { 422 Handle<JSObject> error_object) {
418 if (capture_stack_trace_for_uncaught_exceptions_) { 423 if (capture_stack_trace_for_uncaught_exceptions_) {
419 // Capture stack trace for a detailed exception message. 424 // Capture stack trace for a detailed exception message.
420 Handle<Name> key = factory()->detailed_stack_trace_symbol(); 425 Handle<Name> key = factory()->detailed_stack_trace_symbol();
421 Handle<JSArray> stack_trace = CaptureCurrentStackTrace( 426 Handle<JSArray> stack_trace = CaptureCurrentStackTrace(
(...skipping 2332 matching lines...) Expand 10 before | Expand all | Expand 10 after
2754 if (prev_ && prev_->Intercept(flag)) return true; 2759 if (prev_ && prev_->Intercept(flag)) return true;
2755 // Then check whether this scope intercepts. 2760 // Then check whether this scope intercepts.
2756 if ((flag & intercept_mask_)) { 2761 if ((flag & intercept_mask_)) {
2757 intercepted_flags_ |= flag; 2762 intercepted_flags_ |= flag;
2758 return true; 2763 return true;
2759 } 2764 }
2760 return false; 2765 return false;
2761 } 2766 }
2762 2767
2763 } } // namespace v8::internal 2768 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698