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/frames.h" | 5 #include "src/frames.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
(...skipping 441 matching lines...) Loading... |
452 Object* marker = | 452 Object* marker = |
453 Memory::Object_at(state->fp + StandardFrameConstants::kMarkerOffset); | 453 Memory::Object_at(state->fp + StandardFrameConstants::kMarkerOffset); |
454 if (code_obj != nullptr) { | 454 if (code_obj != nullptr) { |
455 switch (code_obj->kind()) { | 455 switch (code_obj->kind()) { |
456 case Code::FUNCTION: | 456 case Code::FUNCTION: |
457 return JAVA_SCRIPT; | 457 return JAVA_SCRIPT; |
458 case Code::OPTIMIZED_FUNCTION: | 458 case Code::OPTIMIZED_FUNCTION: |
459 return OPTIMIZED; | 459 return OPTIMIZED; |
460 case Code::WASM_FUNCTION: | 460 case Code::WASM_FUNCTION: |
461 return WASM; | 461 return WASM; |
| 462 case Code::WASM_TO_JS_FUNCTION: |
| 463 return WASM_TO_JS; |
| 464 case Code::JS_TO_WASM_FUNCTION: |
| 465 return JS_TO_WASM; |
462 case Code::BUILTIN: | 466 case Code::BUILTIN: |
463 if (!marker->IsSmi()) { | 467 if (!marker->IsSmi()) { |
464 if (StandardFrame::IsArgumentsAdaptorFrame(state->fp)) { | 468 if (StandardFrame::IsArgumentsAdaptorFrame(state->fp)) { |
465 // An adapter frame has a special SMI constant for the context and | 469 // An adapter frame has a special SMI constant for the context and |
466 // is not distinguished through the marker. | 470 // is not distinguished through the marker. |
467 return ARGUMENTS_ADAPTOR; | 471 return ARGUMENTS_ADAPTOR; |
468 } else { | 472 } else { |
469 // The interpreter entry trampoline has a non-SMI marker. | 473 // The interpreter entry trampoline has a non-SMI marker. |
470 DCHECK(code_obj->is_interpreter_entry_trampoline() || | 474 DCHECK(code_obj->is_interpreter_entry_trampoline() || |
471 code_obj->is_interpreter_enter_bytecode_dispatch()); | 475 code_obj->is_interpreter_enter_bytecode_dispatch()); |
(...skipping 228 matching lines...) Loading... |
700 int byte_index = index >> kBitsPerByteLog2; | 704 int byte_index = index >> kBitsPerByteLog2; |
701 int bit_index = index & (kBitsPerByte - 1); | 705 int bit_index = index & (kBitsPerByte - 1); |
702 if ((safepoint_bits[byte_index] & (1U << bit_index)) != 0) { | 706 if ((safepoint_bits[byte_index] & (1U << bit_index)) != 0) { |
703 v->VisitPointer(parameters_limit + index); | 707 v->VisitPointer(parameters_limit + index); |
704 } | 708 } |
705 } | 709 } |
706 | 710 |
707 // Visit the return address in the callee and incoming arguments. | 711 // Visit the return address in the callee and incoming arguments. |
708 IteratePc(v, pc_address(), constant_pool_address(), code); | 712 IteratePc(v, pc_address(), constant_pool_address(), code); |
709 | 713 |
710 // Visit the context in stub frame and JavaScript frame. | 714 if (!is_wasm() && !is_wasm_to_js()) { |
711 // Visit the function in JavaScript frame. | 715 // Visit the context in stub frame and JavaScript frame. |
712 Object** fixed_base = &Memory::Object_at( | 716 // Visit the function in JavaScript frame. |
713 fp() + StandardFrameConstants::kMarkerOffset); | 717 Object** fixed_base = |
714 Object** fixed_limit = &Memory::Object_at(fp()); | 718 &Memory::Object_at(fp() + StandardFrameConstants::kMarkerOffset); |
715 v->VisitPointers(fixed_base, fixed_limit); | 719 Object** fixed_limit = &Memory::Object_at(fp()); |
| 720 v->VisitPointers(fixed_base, fixed_limit); |
| 721 } |
716 } | 722 } |
717 | 723 |
718 | 724 |
719 void StubFrame::Iterate(ObjectVisitor* v) const { | 725 void StubFrame::Iterate(ObjectVisitor* v) const { |
720 IterateCompiledFrame(v); | 726 IterateCompiledFrame(v); |
721 } | 727 } |
722 | 728 |
723 | 729 |
724 Code* StubFrame::unchecked_code() const { | 730 Code* StubFrame::unchecked_code() const { |
725 return static_cast<Code*>(isolate()->FindCodeObject(pc())); | 731 return static_cast<Code*>(isolate()->FindCodeObject(pc())); |
(...skipping 935 matching lines...) Loading... |
1661 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1667 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1662 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1668 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1663 list.Add(frame, zone); | 1669 list.Add(frame, zone); |
1664 } | 1670 } |
1665 return list.ToVector(); | 1671 return list.ToVector(); |
1666 } | 1672 } |
1667 | 1673 |
1668 | 1674 |
1669 } // namespace internal | 1675 } // namespace internal |
1670 } // namespace v8 | 1676 } // namespace v8 |
OLD | NEW |