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

Side by Side Diff: src/isolate.cc

Issue 2307783002: Do not include Error.captureStackTrace in the trace (Closed)
Patch Set: Add test Created 4 years, 3 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') | test/mjsunit/regress/regress-5342.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 "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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 317
318 namespace { 318 namespace {
319 319
320 class StackTraceHelper { 320 class StackTraceHelper {
321 public: 321 public:
322 StackTraceHelper(Isolate* isolate, FrameSkipMode mode, Handle<Object> caller) 322 StackTraceHelper(Isolate* isolate, FrameSkipMode mode, Handle<Object> caller)
323 : isolate_(isolate), 323 : isolate_(isolate),
324 mode_(mode), 324 mode_(mode),
325 caller_(caller), 325 caller_(caller),
326 skip_next_frame_(true) { 326 skip_next_frame_(true) {
327 // The caller parameter can be used to skip a specific set of frames in the
328 // stack trace. It can be:
329 // * null, when called from a standard error constructor. We unconditionally
330 // skip the top frame, which is always a builtin-exit frame for the error
331 // constructor builtin.
332 // * a JSFunction, when called by the user from Error.captureStackTrace().
333 // We skip each frame until encountering the caller function.
334 // * For any other value, all frames are included in the trace.
335 switch (mode_) { 327 switch (mode_) {
336 case SKIP_FIRST: 328 case SKIP_FIRST:
337 DCHECK(caller_.is_null());
338 skip_next_frame_ = true; 329 skip_next_frame_ = true;
339 break; 330 break;
340 case SKIP_UNTIL_SEEN: 331 case SKIP_UNTIL_SEEN:
341 DCHECK(caller_->IsJSFunction()); 332 DCHECK(caller_->IsJSFunction());
342 skip_next_frame_ = true; 333 skip_next_frame_ = true;
343 break; 334 break;
344 case SKIP_NONE: 335 case SKIP_NONE:
345 skip_next_frame_ = false; 336 skip_next_frame_ = false;
346 break; 337 break;
347 } 338 }
(...skipping 2822 matching lines...) Expand 10 before | Expand all | Expand 10 after
3170 // Then check whether this scope intercepts. 3161 // Then check whether this scope intercepts.
3171 if ((flag & intercept_mask_)) { 3162 if ((flag & intercept_mask_)) {
3172 intercepted_flags_ |= flag; 3163 intercepted_flags_ |= flag;
3173 return true; 3164 return true;
3174 } 3165 }
3175 return false; 3166 return false;
3176 } 3167 }
3177 3168
3178 } // namespace internal 3169 } // namespace internal
3179 } // namespace v8 3170 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-error.cc ('k') | test/mjsunit/regress/regress-5342.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698