OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 6676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6687 // Specifies whether to add offsets to position infos. | 6687 // Specifies whether to add offsets to position infos. |
6688 enum OffsetFlag { NO_OFFSET = 0, WITH_OFFSET = 1 }; | 6688 enum OffsetFlag { NO_OFFSET = 0, WITH_OFFSET = 1 }; |
6689 | 6689 |
6690 // Retrieves information about the given position, optionally with an offset. | 6690 // Retrieves information about the given position, optionally with an offset. |
6691 // Returns false on failure, and otherwise writes into the given info object | 6691 // Returns false on failure, and otherwise writes into the given info object |
6692 // on success. | 6692 // on success. |
6693 // The static method should is preferable for handlified callsites because it | 6693 // The static method should is preferable for handlified callsites because it |
6694 // initializes the line ends array, avoiding expensive recomputations. | 6694 // initializes the line ends array, avoiding expensive recomputations. |
6695 // The non-static version is not allocating and safe for unhandlified | 6695 // The non-static version is not allocating and safe for unhandlified |
6696 // callsites. | 6696 // callsites. |
6697 V8_EXPORT_PRIVATE static bool GetPositionInfo(Handle<Script> script, | 6697 static bool GetPositionInfo(Handle<Script> script, int position, |
6698 int position, | 6698 PositionInfo* info, OffsetFlag offset_flag); |
6699 PositionInfo* info, | |
6700 OffsetFlag offset_flag); | |
6701 bool GetPositionInfo(int position, PositionInfo* info, | 6699 bool GetPositionInfo(int position, PositionInfo* info, |
6702 OffsetFlag offset_flag) const; | 6700 OffsetFlag offset_flag) const; |
6703 | 6701 |
6704 // Wrappers for GetPositionInfo | 6702 // Wrappers for GetPositionInfo |
6705 static int GetColumnNumber(Handle<Script> script, int code_offset); | 6703 static int GetColumnNumber(Handle<Script> script, int code_offset); |
6706 int GetColumnNumber(int code_pos) const; | 6704 int GetColumnNumber(int code_pos) const; |
6707 static int GetLineNumber(Handle<Script> script, int code_offset); | 6705 static int GetLineNumber(Handle<Script> script, int code_offset); |
6708 int GetLineNumber(int code_pos) const; | 6706 int GetLineNumber(int code_pos) const; |
6709 | 6707 |
6710 // Get the JS object wrapping the given script; create it if none exists. | 6708 // Get the JS object wrapping the given script; create it if none exists. |
(...skipping 4837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11548 } | 11546 } |
11549 }; | 11547 }; |
11550 | 11548 |
11551 | 11549 |
11552 } // NOLINT, false-positive due to second-order macros. | 11550 } // NOLINT, false-positive due to second-order macros. |
11553 } // NOLINT, false-positive due to second-order macros. | 11551 } // NOLINT, false-positive due to second-order macros. |
11554 | 11552 |
11555 #include "src/objects/object-macros-undef.h" | 11553 #include "src/objects/object-macros-undef.h" |
11556 | 11554 |
11557 #endif // V8_OBJECTS_H_ | 11555 #endif // V8_OBJECTS_H_ |
OLD | NEW |