| 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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 Handle<JSObject> NewStackFrameObject(WasmFrame* frame) { | 699 Handle<JSObject> NewStackFrameObject(WasmFrame* frame) { |
| 700 Handle<JSObject> stack_frame = | 700 Handle<JSObject> stack_frame = |
| 701 factory()->NewJSObject(isolate_->object_function()); | 701 factory()->NewJSObject(isolate_->object_function()); |
| 702 | 702 |
| 703 if (!function_key_.is_null()) { | 703 if (!function_key_.is_null()) { |
| 704 Handle<String> name = wasm::GetWasmFunctionName( | 704 Handle<String> name = wasm::GetWasmFunctionName( |
| 705 isolate_, handle(frame->wasm_instance(), isolate_), | 705 isolate_, handle(frame->wasm_instance(), isolate_), |
| 706 frame->function_index()); | 706 frame->function_index()); |
| 707 JSObject::AddProperty(stack_frame, function_key_, name, NONE); | 707 JSObject::AddProperty(stack_frame, function_key_, name, NONE); |
| 708 } | 708 } |
| 709 // Encode the function index as line number. | 709 // Encode the function index as line number (1-based). |
| 710 if (!line_key_.is_null()) { | 710 if (!line_key_.is_null()) { |
| 711 JSObject::AddProperty( | 711 JSObject::AddProperty( |
| 712 stack_frame, line_key_, | 712 stack_frame, line_key_, |
| 713 isolate_->factory()->NewNumberFromInt(frame->function_index()), NONE); | 713 isolate_->factory()->NewNumberFromInt(frame->function_index() + 1), |
| 714 NONE); |
| 714 } | 715 } |
| 715 // Encode the byte offset as column. | 716 // Encode the byte offset as column (1-based). |
| 716 if (!column_key_.is_null()) { | 717 if (!column_key_.is_null()) { |
| 717 Code* code = frame->LookupCode(); | 718 Code* code = frame->LookupCode(); |
| 718 int offset = static_cast<int>(frame->pc() - code->instruction_start()); | 719 int offset = static_cast<int>(frame->pc() - code->instruction_start()); |
| 719 int position = AbstractCode::cast(code)->SourcePosition(offset); | 720 int position = AbstractCode::cast(code)->SourcePosition(offset); |
| 720 // Make position 1-based. | 721 // Make position 1-based. |
| 721 if (position >= 0) ++position; | 722 if (position >= 0) ++position; |
| 722 JSObject::AddProperty(stack_frame, column_key_, | 723 JSObject::AddProperty(stack_frame, column_key_, |
| 723 isolate_->factory()->NewNumberFromInt(position), | 724 isolate_->factory()->NewNumberFromInt(position), |
| 724 NONE); | 725 NONE); |
| 725 } | 726 } |
| (...skipping 2762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3488 // Then check whether this scope intercepts. | 3489 // Then check whether this scope intercepts. |
| 3489 if ((flag & intercept_mask_)) { | 3490 if ((flag & intercept_mask_)) { |
| 3490 intercepted_flags_ |= flag; | 3491 intercepted_flags_ |= flag; |
| 3491 return true; | 3492 return true; |
| 3492 } | 3493 } |
| 3493 return false; | 3494 return false; |
| 3494 } | 3495 } |
| 3495 | 3496 |
| 3496 } // namespace internal | 3497 } // namespace internal |
| 3497 } // namespace v8 | 3498 } // namespace v8 |
| OLD | NEW |