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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 frame->set_is_eval(script->compilation_type() == | 672 frame->set_is_eval(script->compilation_type() == |
673 Script::COMPILATION_TYPE_EVAL); | 673 Script::COMPILATION_TYPE_EVAL); |
674 } | 674 } |
675 if (options_ & StackTrace::kFunctionName) { | 675 if (options_ & StackTrace::kFunctionName) { |
676 Handle<String> name = summ.FunctionName(); | 676 Handle<String> name = summ.FunctionName(); |
677 frame->set_function_name(*name); | 677 frame->set_function_name(*name); |
678 } | 678 } |
679 if (options_ & StackTrace::kIsConstructor) { | 679 if (options_ & StackTrace::kIsConstructor) { |
680 frame->set_is_constructor(summ.is_constructor()); | 680 frame->set_is_constructor(summ.is_constructor()); |
681 } | 681 } |
| 682 frame->set_is_wasm(false); |
682 return frame; | 683 return frame; |
683 } | 684 } |
684 | 685 |
685 Handle<StackFrameInfo> NewStackFrameObject( | 686 Handle<StackFrameInfo> NewStackFrameObject( |
686 const FrameSummary::WasmFrameSummary& summ) { | 687 const FrameSummary::WasmFrameSummary& summ) { |
687 Handle<StackFrameInfo> info = factory()->NewStackFrameInfo(); | 688 Handle<StackFrameInfo> info = factory()->NewStackFrameInfo(); |
688 | 689 |
689 if (options_ & StackTrace::kFunctionName) { | 690 if (options_ & StackTrace::kFunctionName) { |
690 Handle<WasmCompiledModule> compiled_module( | 691 Handle<WasmCompiledModule> compiled_module( |
691 summ.wasm_instance()->compiled_module(), isolate_); | 692 summ.wasm_instance()->compiled_module(), isolate_); |
692 Handle<String> name = WasmCompiledModule::GetFunctionName( | 693 Handle<String> name = WasmCompiledModule::GetFunctionName( |
693 isolate_, compiled_module, summ.function_index()); | 694 isolate_, compiled_module, summ.function_index()); |
694 info->set_function_name(*name); | 695 info->set_function_name(*name); |
695 } | 696 } |
696 // Encode the function index as line number (1-based). | 697 // Encode the function index as line number (1-based). |
697 if (options_ & StackTrace::kLineNumber) { | 698 if (options_ & StackTrace::kLineNumber) { |
698 info->set_line_number(summ.function_index() + 1); | 699 info->set_line_number(summ.function_index() + 1); |
699 } | 700 } |
700 // Encode the byte offset as column (1-based). | 701 // Encode the byte offset as column (1-based). |
701 if (options_ & StackTrace::kColumnOffset) { | 702 if (options_ & StackTrace::kColumnOffset) { |
702 int position = summ.byte_offset(); | 703 int position = summ.byte_offset(); |
703 // Make position 1-based. | 704 // Make position 1-based. |
704 if (position >= 0) ++position; | 705 if (position >= 0) ++position; |
705 info->set_column_number(position); | 706 info->set_column_number(position); |
706 } | 707 } |
707 if (options_ & StackTrace::kScriptId) { | 708 if (options_ & StackTrace::kScriptId) { |
708 info->set_script_id(summ.script()->id()); | 709 info->set_script_id(summ.script()->id()); |
709 } | 710 } |
| 711 info->set_is_wasm(true); |
710 return info; | 712 return info; |
711 } | 713 } |
712 | 714 |
713 private: | 715 private: |
714 inline Factory* factory() { return isolate_->factory(); } | 716 inline Factory* factory() { return isolate_->factory(); } |
715 | 717 |
716 Isolate* isolate_; | 718 Isolate* isolate_; |
717 StackTrace::StackTraceOptions options_; | 719 StackTrace::StackTraceOptions options_; |
718 }; | 720 }; |
719 | 721 |
(...skipping 3000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3720 // Then check whether this scope intercepts. | 3722 // Then check whether this scope intercepts. |
3721 if ((flag & intercept_mask_)) { | 3723 if ((flag & intercept_mask_)) { |
3722 intercepted_flags_ |= flag; | 3724 intercepted_flags_ |= flag; |
3723 return true; | 3725 return true; |
3724 } | 3726 } |
3725 return false; | 3727 return false; |
3726 } | 3728 } |
3727 | 3729 |
3728 } // namespace internal | 3730 } // namespace internal |
3729 } // namespace v8 | 3731 } // namespace v8 |
OLD | NEW |