| 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 451 |
| 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 switch (code_obj->wasm_function_type()) { |
| 462 case Code::WASM_INNER_FUNCTION: |
| 463 return WASM; |
| 464 case Code::WASM_TO_JS: |
| 465 return WASM_TO_JS; |
| 466 case Code::JS_TO_WASM: |
| 467 return JS_TO_WASM; |
| 468 default: |
| 469 UNREACHABLE(); |
| 470 } |
| 462 case Code::BUILTIN: | 471 case Code::BUILTIN: |
| 463 if (!marker->IsSmi()) { | 472 if (!marker->IsSmi()) { |
| 464 if (StandardFrame::IsArgumentsAdaptorFrame(state->fp)) { | 473 if (StandardFrame::IsArgumentsAdaptorFrame(state->fp)) { |
| 465 // An adapter frame has a special SMI constant for the context and | 474 // An adapter frame has a special SMI constant for the context and |
| 466 // is not distinguished through the marker. | 475 // is not distinguished through the marker. |
| 467 return ARGUMENTS_ADAPTOR; | 476 return ARGUMENTS_ADAPTOR; |
| 468 } else { | 477 } else { |
| 469 // The interpreter entry trampoline has a non-SMI marker. | 478 // The interpreter entry trampoline has a non-SMI marker. |
| 470 DCHECK(code_obj->is_interpreter_entry_trampoline() || | 479 DCHECK(code_obj->is_interpreter_entry_trampoline() || |
| 471 code_obj->is_interpreter_enter_bytecode_dispatch()); | 480 code_obj->is_interpreter_enter_bytecode_dispatch()); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 int byte_index = index >> kBitsPerByteLog2; | 709 int byte_index = index >> kBitsPerByteLog2; |
| 701 int bit_index = index & (kBitsPerByte - 1); | 710 int bit_index = index & (kBitsPerByte - 1); |
| 702 if ((safepoint_bits[byte_index] & (1U << bit_index)) != 0) { | 711 if ((safepoint_bits[byte_index] & (1U << bit_index)) != 0) { |
| 703 v->VisitPointer(parameters_limit + index); | 712 v->VisitPointer(parameters_limit + index); |
| 704 } | 713 } |
| 705 } | 714 } |
| 706 | 715 |
| 707 // Visit the return address in the callee and incoming arguments. | 716 // Visit the return address in the callee and incoming arguments. |
| 708 IteratePc(v, pc_address(), constant_pool_address(), code); | 717 IteratePc(v, pc_address(), constant_pool_address(), code); |
| 709 | 718 |
| 710 // Visit the context in stub frame and JavaScript frame. | 719 if (!is_wasm() && !is_wasm_to_js()) { |
| 711 // Visit the function in JavaScript frame. | 720 // Visit the context in stub frame and JavaScript frame. |
| 712 Object** fixed_base = &Memory::Object_at( | 721 // Visit the function in JavaScript frame. |
| 713 fp() + StandardFrameConstants::kMarkerOffset); | 722 Object** fixed_base = |
| 714 Object** fixed_limit = &Memory::Object_at(fp()); | 723 &Memory::Object_at(fp() + StandardFrameConstants::kMarkerOffset); |
| 715 v->VisitPointers(fixed_base, fixed_limit); | 724 Object** fixed_limit = &Memory::Object_at(fp()); |
| 725 v->VisitPointers(fixed_base, fixed_limit); |
| 726 } |
| 716 } | 727 } |
| 717 | 728 |
| 718 | 729 |
| 719 void StubFrame::Iterate(ObjectVisitor* v) const { | 730 void StubFrame::Iterate(ObjectVisitor* v) const { |
| 720 IterateCompiledFrame(v); | 731 IterateCompiledFrame(v); |
| 721 } | 732 } |
| 722 | 733 |
| 723 | 734 |
| 724 Code* StubFrame::unchecked_code() const { | 735 Code* StubFrame::unchecked_code() const { |
| 725 return static_cast<Code*>(isolate()->FindCodeObject(pc())); | 736 return static_cast<Code*>(isolate()->FindCodeObject(pc())); |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1672 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
| 1662 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1673 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
| 1663 list.Add(frame, zone); | 1674 list.Add(frame, zone); |
| 1664 } | 1675 } |
| 1665 return list.ToVector(); | 1676 return list.ToVector(); |
| 1666 } | 1677 } |
| 1667 | 1678 |
| 1668 | 1679 |
| 1669 } // namespace internal | 1680 } // namespace internal |
| 1670 } // namespace v8 | 1681 } // namespace v8 |
| OLD | NEW |