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 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 sourceText, NONE); | 1659 sourceText, NONE); |
1660 | 1660 |
1661 return jsinfo; | 1661 return jsinfo; |
1662 } | 1662 } |
1663 | 1663 |
1664 namespace { | 1664 namespace { |
1665 | 1665 |
1666 int ScriptLinePositionWithOffset(Handle<Script> script, int line, int offset) { | 1666 int ScriptLinePositionWithOffset(Handle<Script> script, int line, int offset) { |
1667 if (line < 0 || offset < 0) return -1; | 1667 if (line < 0 || offset < 0) return -1; |
1668 | 1668 |
1669 if (line == 0) return ScriptLinePosition(script, line) + offset; | 1669 if (line == 0 || offset == 0) |
| 1670 return ScriptLinePosition(script, line) + offset; |
1670 | 1671 |
1671 Script::PositionInfo info; | 1672 Script::PositionInfo info; |
1672 if (!Script::GetPositionInfo(script, offset, &info, Script::NO_OFFSET)) { | 1673 if (!Script::GetPositionInfo(script, offset, &info, Script::NO_OFFSET)) { |
1673 return -1; | 1674 return -1; |
1674 } | 1675 } |
1675 | 1676 |
1676 const int total_line = info.line + line; | 1677 const int total_line = info.line + line; |
1677 return ScriptLinePosition(script, total_line); | 1678 return ScriptLinePosition(script, total_line); |
1678 } | 1679 } |
1679 | 1680 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 } | 1924 } |
1924 | 1925 |
1925 | 1926 |
1926 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 1927 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
1927 UNIMPLEMENTED(); | 1928 UNIMPLEMENTED(); |
1928 return NULL; | 1929 return NULL; |
1929 } | 1930 } |
1930 | 1931 |
1931 } // namespace internal | 1932 } // namespace internal |
1932 } // namespace v8 | 1933 } // namespace v8 |
OLD | NEW |