OLD | NEW |
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 Loading... |
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); | |
411 Handle<JSArray> result = factory()->NewJSArrayWithElements(elements); | 410 Handle<JSArray> result = factory()->NewJSArrayWithElements(elements); |
412 result->set_length(Smi::FromInt(cursor)); | 411 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); | |
417 return result; | 412 return result; |
418 } | 413 } |
419 | 414 |
420 | 415 |
421 MaybeHandle<JSObject> Isolate::CaptureAndSetDetailedStackTrace( | 416 MaybeHandle<JSObject> Isolate::CaptureAndSetDetailedStackTrace( |
422 Handle<JSObject> error_object) { | 417 Handle<JSObject> error_object) { |
423 if (capture_stack_trace_for_uncaught_exceptions_) { | 418 if (capture_stack_trace_for_uncaught_exceptions_) { |
424 // Capture stack trace for a detailed exception message. | 419 // Capture stack trace for a detailed exception message. |
425 Handle<Name> key = factory()->detailed_stack_trace_symbol(); | 420 Handle<Name> key = factory()->detailed_stack_trace_symbol(); |
426 Handle<JSArray> stack_trace = CaptureCurrentStackTrace( | 421 Handle<JSArray> stack_trace = CaptureCurrentStackTrace( |
(...skipping 2332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2759 if (prev_ && prev_->Intercept(flag)) return true; | 2754 if (prev_ && prev_->Intercept(flag)) return true; |
2760 // Then check whether this scope intercepts. | 2755 // Then check whether this scope intercepts. |
2761 if ((flag & intercept_mask_)) { | 2756 if ((flag & intercept_mask_)) { |
2762 intercepted_flags_ |= flag; | 2757 intercepted_flags_ |= flag; |
2763 return true; | 2758 return true; |
2764 } | 2759 } |
2765 return false; | 2760 return false; |
2766 } | 2761 } |
2767 | 2762 |
2768 } } // namespace v8::internal | 2763 } } // namespace v8::internal |
OLD | NEW |