| 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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 if (!line_key_.is_null()) { | 614 if (!line_key_.is_null()) { |
| 615 JSObject::AddProperty( | 615 JSObject::AddProperty( |
| 616 stack_frame, line_key_, | 616 stack_frame, line_key_, |
| 617 isolate_->factory()->NewNumberFromInt(frame->function_index()), NONE); | 617 isolate_->factory()->NewNumberFromInt(frame->function_index()), NONE); |
| 618 } | 618 } |
| 619 // Encode the byte offset as column. | 619 // Encode the byte offset as column. |
| 620 if (!column_key_.is_null()) { | 620 if (!column_key_.is_null()) { |
| 621 Code* code = frame->LookupCode(); | 621 Code* code = frame->LookupCode(); |
| 622 int offset = static_cast<int>(frame->pc() - code->instruction_start()); | 622 int offset = static_cast<int>(frame->pc() - code->instruction_start()); |
| 623 int position = code->SourcePosition(offset); | 623 int position = code->SourcePosition(offset); |
| 624 // Make position 1-based. |
| 625 if (position >= 0) ++position; |
| 624 JSObject::AddProperty(stack_frame, column_key_, | 626 JSObject::AddProperty(stack_frame, column_key_, |
| 625 isolate_->factory()->NewNumberFromInt(position), | 627 isolate_->factory()->NewNumberFromInt(position), |
| 626 NONE); | 628 NONE); |
| 627 } | 629 } |
| 628 | 630 |
| 629 return stack_frame; | 631 return stack_frame; |
| 630 } | 632 } |
| 631 | 633 |
| 632 private: | 634 private: |
| 633 inline Factory* factory() { return isolate_->factory(); } | 635 inline Factory* factory() { return isolate_->factory(); } |
| (...skipping 2428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3062 // Then check whether this scope intercepts. | 3064 // Then check whether this scope intercepts. |
| 3063 if ((flag & intercept_mask_)) { | 3065 if ((flag & intercept_mask_)) { |
| 3064 intercepted_flags_ |= flag; | 3066 intercepted_flags_ |= flag; |
| 3065 return true; | 3067 return true; |
| 3066 } | 3068 } |
| 3067 return false; | 3069 return false; |
| 3068 } | 3070 } |
| 3069 | 3071 |
| 3070 } // namespace internal | 3072 } // namespace internal |
| 3071 } // namespace v8 | 3073 } // namespace v8 |
| OLD | NEW |