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

Side by Side Diff: src/isolate.cc

Issue 2164903004: Eagerly format traces in captureStackTrace (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 5 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/builtins/builtins-error.cc ('k') | src/messages.h » ('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 "src/isolate.h" 5 #include "src/isolate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <fstream> // NOLINT(readability/streams) 9 #include <fstream> // NOLINT(readability/streams)
10 #include <sstream> 10 #include <sstream>
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 556 }
557 557
558 MaybeHandle<JSReceiver> Isolate::CaptureAndSetDetailedStackTrace( 558 MaybeHandle<JSReceiver> Isolate::CaptureAndSetDetailedStackTrace(
559 Handle<JSReceiver> error_object) { 559 Handle<JSReceiver> error_object) {
560 if (capture_stack_trace_for_uncaught_exceptions_) { 560 if (capture_stack_trace_for_uncaught_exceptions_) {
561 // Capture stack trace for a detailed exception message. 561 // Capture stack trace for a detailed exception message.
562 Handle<Name> key = factory()->detailed_stack_trace_symbol(); 562 Handle<Name> key = factory()->detailed_stack_trace_symbol();
563 Handle<JSArray> stack_trace = CaptureCurrentStackTrace( 563 Handle<JSArray> stack_trace = CaptureCurrentStackTrace(
564 stack_trace_for_uncaught_exceptions_frame_limit_, 564 stack_trace_for_uncaught_exceptions_frame_limit_,
565 stack_trace_for_uncaught_exceptions_options_); 565 stack_trace_for_uncaught_exceptions_options_);
566 // TODO(jgruber): Set back to STRICT once we have eagerly formatted traces.
567 RETURN_ON_EXCEPTION( 566 RETURN_ON_EXCEPTION(
568 this, JSReceiver::SetProperty(error_object, key, stack_trace, SLOPPY), 567 this, JSReceiver::SetProperty(error_object, key, stack_trace, STRICT),
569 JSReceiver); 568 JSReceiver);
570 } 569 }
571 return error_object; 570 return error_object;
572 } 571 }
573 572
574 MaybeHandle<JSReceiver> Isolate::CaptureAndSetSimpleStackTrace( 573 MaybeHandle<JSReceiver> Isolate::CaptureAndSetSimpleStackTrace(
575 Handle<JSReceiver> error_object, FrameSkipMode mode, 574 Handle<JSReceiver> error_object, FrameSkipMode mode,
576 Handle<Object> caller) { 575 Handle<Object> caller) {
577 // Capture stack trace for simple stack trace string formatting. 576 // Capture stack trace for simple stack trace string formatting.
578 Handle<Name> key = factory()->stack_trace_symbol(); 577 Handle<Name> key = factory()->stack_trace_symbol();
579 Handle<Object> stack_trace = 578 Handle<Object> stack_trace =
580 CaptureSimpleStackTrace(error_object, mode, caller); 579 CaptureSimpleStackTrace(error_object, mode, caller);
581 // TODO(jgruber): Set back to STRICT once we have eagerly formatted traces.
582 RETURN_ON_EXCEPTION( 580 RETURN_ON_EXCEPTION(
583 this, JSReceiver::SetProperty(error_object, key, stack_trace, SLOPPY), 581 this, JSReceiver::SetProperty(error_object, key, stack_trace, STRICT),
584 JSReceiver); 582 JSReceiver);
585 return error_object; 583 return error_object;
586 } 584 }
587 585
588 586
589 Handle<JSArray> Isolate::GetDetailedStackTrace(Handle<JSObject> error_object) { 587 Handle<JSArray> Isolate::GetDetailedStackTrace(Handle<JSObject> error_object) {
590 Handle<Name> key_detailed = factory()->detailed_stack_trace_symbol(); 588 Handle<Name> key_detailed = factory()->detailed_stack_trace_symbol();
591 Handle<Object> stack_trace = 589 Handle<Object> stack_trace =
592 JSReceiver::GetDataProperty(error_object, key_detailed); 590 JSReceiver::GetDataProperty(error_object, key_detailed);
593 if (stack_trace->IsJSArray()) return Handle<JSArray>::cast(stack_trace); 591 if (stack_trace->IsJSArray()) return Handle<JSArray>::cast(stack_trace);
(...skipping 2524 matching lines...) Expand 10 before | Expand all | Expand 10 after
3118 // Then check whether this scope intercepts. 3116 // Then check whether this scope intercepts.
3119 if ((flag & intercept_mask_)) { 3117 if ((flag & intercept_mask_)) {
3120 intercepted_flags_ |= flag; 3118 intercepted_flags_ |= flag;
3121 return true; 3119 return true;
3122 } 3120 }
3123 return false; 3121 return false;
3124 } 3122 }
3125 3123
3126 } // namespace internal 3124 } // namespace internal
3127 } // namespace v8 3125 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-error.cc ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698