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 "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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 Handle<Object> recv = frames[i].receiver(); | 398 Handle<Object> recv = frames[i].receiver(); |
399 // Filter out internal frames that we do not want to show. | 399 // Filter out internal frames that we do not want to show. |
400 if (!IsVisibleInStackTrace(*fun, *caller, &seen_caller)) continue; | 400 if (!IsVisibleInStackTrace(*fun, *caller, &seen_caller)) continue; |
401 // Filter out frames from other security contexts. | 401 // Filter out frames from other security contexts. |
402 if (!this->context()->HasSameSecurityTokenAs(fun->context())) { | 402 if (!this->context()->HasSameSecurityTokenAs(fun->context())) { |
403 continue; | 403 continue; |
404 } | 404 } |
405 elements = MaybeGrow(this, elements, cursor, cursor + 4); | 405 elements = MaybeGrow(this, elements, cursor, cursor + 4); |
406 | 406 |
407 Handle<AbstractCode> abstract_code = frames[i].abstract_code(); | 407 Handle<AbstractCode> abstract_code = frames[i].abstract_code(); |
| 408 if (frame->type() == StackFrame::BUILTIN) { |
| 409 // Help CallSite::IsConstructor correctly detect hand-written |
| 410 // construct stubs. |
| 411 Code* code = Code::cast(*abstract_code); |
| 412 if (code->is_construct_stub()) { |
| 413 recv = handle(heap()->call_site_constructor_symbol(), this); |
| 414 } |
| 415 } |
408 | 416 |
409 Handle<Smi> offset(Smi::FromInt(frames[i].code_offset()), this); | 417 Handle<Smi> offset(Smi::FromInt(frames[i].code_offset()), this); |
410 // The stack trace API should not expose receivers and function | 418 // The stack trace API should not expose receivers and function |
411 // objects on frames deeper than the top-most one with a strict mode | 419 // objects on frames deeper than the top-most one with a strict mode |
412 // function. The number of sloppy frames is stored as first element in | 420 // function. The number of sloppy frames is stored as first element in |
413 // the result array. | 421 // the result array. |
414 if (!encountered_strict_function) { | 422 if (!encountered_strict_function) { |
415 if (is_strict(fun->shared()->language_mode())) { | 423 if (is_strict(fun->shared()->language_mode())) { |
416 encountered_strict_function = true; | 424 encountered_strict_function = true; |
417 } else { | 425 } else { |
(...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3087 // Then check whether this scope intercepts. | 3095 // Then check whether this scope intercepts. |
3088 if ((flag & intercept_mask_)) { | 3096 if ((flag & intercept_mask_)) { |
3089 intercepted_flags_ |= flag; | 3097 intercepted_flags_ |= flag; |
3090 return true; | 3098 return true; |
3091 } | 3099 } |
3092 return false; | 3100 return false; |
3093 } | 3101 } |
3094 | 3102 |
3095 } // namespace internal | 3103 } // namespace internal |
3096 } // namespace v8 | 3104 } // namespace v8 |
OLD | NEW |