OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/debug/debug-evaluate.h" | 9 #include "src/debug/debug-evaluate.h" |
10 #include "src/debug/debug-frames.h" | 10 #include "src/debug/debug-frames.h" |
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 sourceText, NONE); | 1646 sourceText, NONE); |
1647 | 1647 |
1648 return jsinfo; | 1648 return jsinfo; |
1649 } | 1649 } |
1650 | 1650 |
1651 namespace { | 1651 namespace { |
1652 | 1652 |
1653 int ScriptLinePositionWithOffset(Handle<Script> script, int line, int offset) { | 1653 int ScriptLinePositionWithOffset(Handle<Script> script, int line, int offset) { |
1654 if (line < 0 || offset < 0) return -1; | 1654 if (line < 0 || offset < 0) return -1; |
1655 | 1655 |
1656 if (line == 0) return ScriptLinePosition(script, line) + offset; | 1656 if (line == 0 || offset == 0) |
| 1657 return ScriptLinePosition(script, line) + offset; |
1657 | 1658 |
1658 Script::PositionInfo info; | 1659 Script::PositionInfo info; |
1659 if (!Script::GetPositionInfo(script, offset, &info, Script::NO_OFFSET)) { | 1660 if (!Script::GetPositionInfo(script, offset, &info, Script::NO_OFFSET)) { |
1660 return -1; | 1661 return -1; |
1661 } | 1662 } |
1662 | 1663 |
1663 const int total_line = info.line + line; | 1664 const int total_line = info.line + line; |
1664 return ScriptLinePosition(script, total_line); | 1665 return ScriptLinePosition(script, total_line); |
1665 } | 1666 } |
1666 | 1667 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1910 } | 1911 } |
1911 | 1912 |
1912 | 1913 |
1913 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 1914 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
1914 UNIMPLEMENTED(); | 1915 UNIMPLEMENTED(); |
1915 return NULL; | 1916 return NULL; |
1916 } | 1917 } |
1917 | 1918 |
1918 } // namespace internal | 1919 } // namespace internal |
1919 } // namespace v8 | 1920 } // namespace v8 |
OLD | NEW |