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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 } | 426 } |
427 } break; | 427 } break; |
428 | 428 |
429 case StackFrame::BUILTIN_EXIT: { | 429 case StackFrame::BUILTIN_EXIT: { |
430 BuiltinExitFrame* exit_frame = BuiltinExitFrame::cast(frame); | 430 BuiltinExitFrame* exit_frame = BuiltinExitFrame::cast(frame); |
431 Handle<JSFunction> fun = handle(exit_frame->function(), this); | 431 Handle<JSFunction> fun = handle(exit_frame->function(), this); |
432 Handle<Code> code = handle(exit_frame->LookupCode(), this); | 432 Handle<Code> code = handle(exit_frame->LookupCode(), this); |
433 int offset = | 433 int offset = |
434 static_cast<int>(exit_frame->pc() - code->instruction_start()); | 434 static_cast<int>(exit_frame->pc() - code->instruction_start()); |
435 | 435 |
436 // For now, builtin exit frames do not pass along a receiver. | 436 // In order to help CallSite::IsConstructor detect builtin constructors, |
| 437 // we reuse the receiver field to pass along a special symbol. |
| 438 Handle<Object> recv; |
| 439 if (exit_frame->IsConstructor()) { |
| 440 recv = handle(heap()->call_site_constructor_symbol(), this); |
| 441 } else { |
| 442 recv = handle(exit_frame->receiver(), this); |
| 443 } |
| 444 |
437 elements = MaybeGrow(this, elements, cursor, cursor + 4); | 445 elements = MaybeGrow(this, elements, cursor, cursor + 4); |
438 elements->set(cursor++, *factory()->undefined_value()); | 446 elements->set(cursor++, *recv); |
439 elements->set(cursor++, *fun); | 447 elements->set(cursor++, *fun); |
440 elements->set(cursor++, *code); | 448 elements->set(cursor++, *code); |
441 elements->set(cursor++, Smi::FromInt(offset)); | 449 elements->set(cursor++, Smi::FromInt(offset)); |
442 frames_seen++; | 450 frames_seen++; |
443 } break; | 451 } break; |
444 | 452 |
445 case StackFrame::WASM: { | 453 case StackFrame::WASM: { |
446 WasmFrame* wasm_frame = WasmFrame::cast(frame); | 454 WasmFrame* wasm_frame = WasmFrame::cast(frame); |
447 Code* code = wasm_frame->unchecked_code(); | 455 Code* code = wasm_frame->unchecked_code(); |
448 Handle<AbstractCode> abstract_code = | 456 Handle<AbstractCode> abstract_code = |
(...skipping 2629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3078 // Then check whether this scope intercepts. | 3086 // Then check whether this scope intercepts. |
3079 if ((flag & intercept_mask_)) { | 3087 if ((flag & intercept_mask_)) { |
3080 intercepted_flags_ |= flag; | 3088 intercepted_flags_ |= flag; |
3081 return true; | 3089 return true; |
3082 } | 3090 } |
3083 return false; | 3091 return false; |
3084 } | 3092 } |
3085 | 3093 |
3086 } // namespace internal | 3094 } // namespace internal |
3087 } // namespace v8 | 3095 } // namespace v8 |
OLD | NEW |