| 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 #ifndef V8_FACTORY_H_ | 5 #ifndef V8_FACTORY_H_ |
| 6 #define V8_FACTORY_H_ | 6 #define V8_FACTORY_H_ |
| 7 | 7 |
| 8 #include "isolate.h" | 8 #include "isolate.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // UTF8 strings are pretenured when used for regexp literal patterns and | 138 // UTF8 strings are pretenured when used for regexp literal patterns and |
| 139 // flags in the parser. | 139 // flags in the parser. |
| 140 MUST_USE_RESULT MaybeHandle<String> NewStringFromUtf8( | 140 MUST_USE_RESULT MaybeHandle<String> NewStringFromUtf8( |
| 141 Vector<const char> str, | 141 Vector<const char> str, |
| 142 PretenureFlag pretenure = NOT_TENURED); | 142 PretenureFlag pretenure = NOT_TENURED); |
| 143 | 143 |
| 144 MUST_USE_RESULT MaybeHandle<String> NewStringFromTwoByte( | 144 MUST_USE_RESULT MaybeHandle<String> NewStringFromTwoByte( |
| 145 Vector<const uc16> str, | 145 Vector<const uc16> str, |
| 146 PretenureFlag pretenure = NOT_TENURED); | 146 PretenureFlag pretenure = NOT_TENURED); |
| 147 | 147 |
| 148 // Allocates an internalized string in old space based on the character |
| 149 // stream. |
| 150 MUST_USE_RESULT Handle<String> NewInternalizedStringFromUtf8( |
| 151 Vector<const char> str, |
| 152 int chars, |
| 153 uint32_t hash_field); |
| 154 |
| 155 MUST_USE_RESULT Handle<String> NewOneByteInternalizedString( |
| 156 Vector<const uint8_t> str, |
| 157 uint32_t hash_field); |
| 158 |
| 159 MUST_USE_RESULT Handle<String> NewTwoByteInternalizedString( |
| 160 Vector<const uc16> str, |
| 161 uint32_t hash_field); |
| 162 |
| 163 template<typename T> |
| 164 MUST_USE_RESULT Handle<String> NewInternalizedStringImpl( |
| 165 T t, int chars, uint32_t hash_field); |
| 166 |
| 167 // Compute the matching internalized string map for a string if possible. |
| 168 // Empty handle is returned if string is in new space or not flattened. |
| 169 MUST_USE_RESULT MaybeHandle<Map> InternalizedStringMapForString( |
| 170 Handle<String> string); |
| 171 |
| 148 // Allocates and partially initializes an ASCII or TwoByte String. The | 172 // Allocates and partially initializes an ASCII or TwoByte String. The |
| 149 // characters of the string are uninitialized. Currently used in regexp code | 173 // characters of the string are uninitialized. Currently used in regexp code |
| 150 // only, where they are pretenured. | 174 // only, where they are pretenured. |
| 151 MUST_USE_RESULT MaybeHandle<SeqOneByteString> NewRawOneByteString( | 175 MUST_USE_RESULT MaybeHandle<SeqOneByteString> NewRawOneByteString( |
| 152 int length, | 176 int length, |
| 153 PretenureFlag pretenure = NOT_TENURED); | 177 PretenureFlag pretenure = NOT_TENURED); |
| 154 MUST_USE_RESULT MaybeHandle<SeqTwoByteString> NewRawTwoByteString( | 178 MUST_USE_RESULT MaybeHandle<SeqTwoByteString> NewRawTwoByteString( |
| 155 int length, | 179 int length, |
| 156 PretenureFlag pretenure = NOT_TENURED); | 180 PretenureFlag pretenure = NOT_TENURED); |
| 157 | 181 |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 // the string representation of the number. Otherwise return undefined. | 691 // the string representation of the number. Otherwise return undefined. |
| 668 Handle<Object> GetNumberStringCache(Handle<Object> number); | 692 Handle<Object> GetNumberStringCache(Handle<Object> number); |
| 669 | 693 |
| 670 // Update the cache with a new number-string pair. | 694 // Update the cache with a new number-string pair. |
| 671 void SetNumberStringCache(Handle<Object> number, Handle<String> string); | 695 void SetNumberStringCache(Handle<Object> number, Handle<String> string); |
| 672 }; | 696 }; |
| 673 | 697 |
| 674 } } // namespace v8::internal | 698 } } // namespace v8::internal |
| 675 | 699 |
| 676 #endif // V8_FACTORY_H_ | 700 #endif // V8_FACTORY_H_ |
| OLD | NEW |