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 | 10 |
10 #include "src/assert-scope.h" | 11 #include "src/assert-scope.h" |
11 #include "src/bailout-reason.h" | 12 #include "src/bailout-reason.h" |
12 #include "src/base/bits.h" | 13 #include "src/base/bits.h" |
13 #include "src/base/flags.h" | 14 #include "src/base/flags.h" |
14 #include "src/base/smart-pointers.h" | 15 #include "src/base/smart-pointers.h" |
15 #include "src/builtins/builtins.h" | 16 #include "src/builtins/builtins.h" |
16 #include "src/checks.h" | 17 #include "src/checks.h" |
17 #include "src/elements-kind.h" | 18 #include "src/elements-kind.h" |
18 #include "src/field-index.h" | 19 #include "src/field-index.h" |
(...skipping 9025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9044 bool IsTwoByteEqualTo(Vector<const uc16> str); | 9045 bool IsTwoByteEqualTo(Vector<const uc16> str); |
9045 | 9046 |
9046 // Return a UTF8 representation of the string. The string is null | 9047 // Return a UTF8 representation of the string. The string is null |
9047 // terminated but may optionally contain nulls. Length is returned | 9048 // terminated but may optionally contain nulls. Length is returned |
9048 // in length_output if length_output is not a null pointer The string | 9049 // in length_output if length_output is not a null pointer The string |
9049 // should be nearly flat, otherwise the performance of this method may | 9050 // should be nearly flat, otherwise the performance of this method may |
9050 // be very slow (quadratic in the length). Setting robustness_flag to | 9051 // be very slow (quadratic in the length). Setting robustness_flag to |
9051 // ROBUST_STRING_TRAVERSAL invokes behaviour that is robust This means it | 9052 // ROBUST_STRING_TRAVERSAL invokes behaviour that is robust This means it |
9052 // handles unexpected data without causing assert failures and it does not | 9053 // handles unexpected data without causing assert failures and it does not |
9053 // do any heap allocations. This is useful when printing stack traces. | 9054 // do any heap allocations. This is useful when printing stack traces. |
9054 base::SmartArrayPointer<char> ToCString(AllowNullsFlag allow_nulls, | 9055 std::unique_ptr<char[]> ToCString(AllowNullsFlag allow_nulls, |
9055 RobustnessFlag robustness_flag, | 9056 RobustnessFlag robustness_flag, int offset, |
9056 int offset, int length, | 9057 int length, int* length_output = 0); |
9057 int* length_output = 0); | 9058 std::unique_ptr<char[]> ToCString( |
9058 base::SmartArrayPointer<char> ToCString( | |
9059 AllowNullsFlag allow_nulls = DISALLOW_NULLS, | 9059 AllowNullsFlag allow_nulls = DISALLOW_NULLS, |
9060 RobustnessFlag robustness_flag = FAST_STRING_TRAVERSAL, | 9060 RobustnessFlag robustness_flag = FAST_STRING_TRAVERSAL, |
9061 int* length_output = 0); | 9061 int* length_output = 0); |
9062 | 9062 |
9063 bool ComputeArrayIndex(uint32_t* index); | 9063 bool ComputeArrayIndex(uint32_t* index); |
9064 | 9064 |
9065 // Externalization. | 9065 // Externalization. |
9066 bool MakeExternal(v8::String::ExternalStringResource* resource); | 9066 bool MakeExternal(v8::String::ExternalStringResource* resource); |
9067 bool MakeExternal(v8::String::ExternalOneByteStringResource* resource); | 9067 bool MakeExternal(v8::String::ExternalOneByteStringResource* resource); |
9068 | 9068 |
(...skipping 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11004 } | 11004 } |
11005 return value; | 11005 return value; |
11006 } | 11006 } |
11007 }; | 11007 }; |
11008 | 11008 |
11009 | 11009 |
11010 } // NOLINT, false-positive due to second-order macros. | 11010 } // NOLINT, false-positive due to second-order macros. |
11011 } // NOLINT, false-positive due to second-order macros. | 11011 } // NOLINT, false-positive due to second-order macros. |
11012 | 11012 |
11013 #endif // V8_OBJECTS_H_ | 11013 #endif // V8_OBJECTS_H_ |
OLD | NEW |