| 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 "src/isolate.h" | 8 #include "src/isolate.h" |
| 9 #include "src/messages.h" | 9 #include "src/messages.h" |
| 10 #include "src/type-feedback-vector.h" | 10 #include "src/type-feedback-vector.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 MUST_USE_RESULT V8_EXPORT_PRIVATE MaybeHandle<String> NewStringFromUtf8( | 173 MUST_USE_RESULT V8_EXPORT_PRIVATE MaybeHandle<String> NewStringFromUtf8( |
| 174 Vector<const char> str, PretenureFlag pretenure = NOT_TENURED); | 174 Vector<const char> str, PretenureFlag pretenure = NOT_TENURED); |
| 175 | 175 |
| 176 MUST_USE_RESULT MaybeHandle<String> NewStringFromTwoByte( | 176 MUST_USE_RESULT MaybeHandle<String> NewStringFromTwoByte( |
| 177 Vector<const uc16> str, | 177 Vector<const uc16> str, |
| 178 PretenureFlag pretenure = NOT_TENURED); | 178 PretenureFlag pretenure = NOT_TENURED); |
| 179 | 179 |
| 180 MUST_USE_RESULT MaybeHandle<String> NewStringFromTwoByte( | 180 MUST_USE_RESULT MaybeHandle<String> NewStringFromTwoByte( |
| 181 const ZoneVector<uc16>* str, PretenureFlag pretenure = NOT_TENURED); | 181 const ZoneVector<uc16>* str, PretenureFlag pretenure = NOT_TENURED); |
| 182 | 182 |
| 183 Handle<JSStringIterator> NewJSStringIterator(Handle<String> string); |
| 184 |
| 183 // Allocates an internalized string in old space based on the character | 185 // Allocates an internalized string in old space based on the character |
| 184 // stream. | 186 // stream. |
| 185 Handle<String> NewInternalizedStringFromUtf8(Vector<const char> str, | 187 Handle<String> NewInternalizedStringFromUtf8(Vector<const char> str, |
| 186 int chars, uint32_t hash_field); | 188 int chars, uint32_t hash_field); |
| 187 | 189 |
| 188 Handle<String> NewOneByteInternalizedString(Vector<const uint8_t> str, | 190 Handle<String> NewOneByteInternalizedString(Vector<const uint8_t> str, |
| 189 uint32_t hash_field); | 191 uint32_t hash_field); |
| 190 | 192 |
| 191 Handle<String> NewOneByteInternalizedSubString( | 193 Handle<String> NewOneByteInternalizedSubString( |
| 192 Handle<SeqOneByteString> string, int offset, int length, | 194 Handle<SeqOneByteString> string, int offset, int length, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 214 PretenureFlag pretenure = NOT_TENURED); | 216 PretenureFlag pretenure = NOT_TENURED); |
| 215 | 217 |
| 216 // Creates a single character string where the character has given code. | 218 // Creates a single character string where the character has given code. |
| 217 // A cache is used for Latin1 codes. | 219 // A cache is used for Latin1 codes. |
| 218 Handle<String> LookupSingleCharacterStringFromCode(uint32_t code); | 220 Handle<String> LookupSingleCharacterStringFromCode(uint32_t code); |
| 219 | 221 |
| 220 // Create a new cons string object which consists of a pair of strings. | 222 // Create a new cons string object which consists of a pair of strings. |
| 221 MUST_USE_RESULT MaybeHandle<String> NewConsString(Handle<String> left, | 223 MUST_USE_RESULT MaybeHandle<String> NewConsString(Handle<String> left, |
| 222 Handle<String> right); | 224 Handle<String> right); |
| 223 | 225 |
| 226 // Create or lookup a single characters tring made up of a utf16 surrogate |
| 227 // pair. |
| 228 Handle<String> NewSurrogatePairString(uint16_t lead, uint16_t trail); |
| 229 |
| 224 // Create a new string object which holds a proper substring of a string. | 230 // Create a new string object which holds a proper substring of a string. |
| 225 Handle<String> NewProperSubString(Handle<String> str, | 231 Handle<String> NewProperSubString(Handle<String> str, |
| 226 int begin, | 232 int begin, |
| 227 int end); | 233 int end); |
| 228 | 234 |
| 229 // Create a new string object which holds a substring of a string. | 235 // Create a new string object which holds a substring of a string. |
| 230 Handle<String> NewSubString(Handle<String> str, int begin, int end) { | 236 Handle<String> NewSubString(Handle<String> str, int begin, int end) { |
| 231 if (begin == 0 && end == str->length()) return str; | 237 if (begin == 0 && end == str->length()) return str; |
| 232 return NewProperSubString(str, begin, end); | 238 return NewProperSubString(str, begin, end); |
| 233 } | 239 } |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 | 507 |
| 502 // Creates a new on-heap JSTypedArray. | 508 // Creates a new on-heap JSTypedArray. |
| 503 Handle<JSTypedArray> NewJSTypedArray(ElementsKind elements_kind, | 509 Handle<JSTypedArray> NewJSTypedArray(ElementsKind elements_kind, |
| 504 size_t number_of_elements, | 510 size_t number_of_elements, |
| 505 PretenureFlag pretenure = NOT_TENURED); | 511 PretenureFlag pretenure = NOT_TENURED); |
| 506 | 512 |
| 507 Handle<JSDataView> NewJSDataView(); | 513 Handle<JSDataView> NewJSDataView(); |
| 508 Handle<JSDataView> NewJSDataView(Handle<JSArrayBuffer> buffer, | 514 Handle<JSDataView> NewJSDataView(Handle<JSArrayBuffer> buffer, |
| 509 size_t byte_offset, size_t byte_length); | 515 size_t byte_offset, size_t byte_length); |
| 510 | 516 |
| 517 Handle<JSIteratorResult> NewJSIteratorResult(Handle<Object> value, bool done); |
| 518 |
| 511 Handle<JSMap> NewJSMap(); | 519 Handle<JSMap> NewJSMap(); |
| 512 Handle<JSSet> NewJSSet(); | 520 Handle<JSSet> NewJSSet(); |
| 513 | 521 |
| 514 // TODO(aandrey): Maybe these should take table, index and kind arguments. | 522 // TODO(aandrey): Maybe these should take table, index and kind arguments. |
| 515 Handle<JSMapIterator> NewJSMapIterator(); | 523 Handle<JSMapIterator> NewJSMapIterator(); |
| 516 Handle<JSSetIterator> NewJSSetIterator(); | 524 Handle<JSSetIterator> NewJSSetIterator(); |
| 517 | 525 |
| 518 // Allocates a bound function. | 526 // Allocates a bound function. |
| 519 MaybeHandle<JSBoundFunction> NewJSBoundFunction( | 527 MaybeHandle<JSBoundFunction> NewJSBoundFunction( |
| 520 Handle<JSReceiver> target_function, Handle<Object> bound_this, | 528 Handle<JSReceiver> target_function, Handle<Object> bound_this, |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 FunctionMode function_mode); | 772 FunctionMode function_mode); |
| 765 | 773 |
| 766 void SetStrictFunctionInstanceDescriptor(Handle<Map> map, | 774 void SetStrictFunctionInstanceDescriptor(Handle<Map> map, |
| 767 FunctionMode function_mode); | 775 FunctionMode function_mode); |
| 768 }; | 776 }; |
| 769 | 777 |
| 770 } // namespace internal | 778 } // namespace internal |
| 771 } // namespace v8 | 779 } // namespace v8 |
| 772 | 780 |
| 773 #endif // V8_FACTORY_H_ | 781 #endif // V8_FACTORY_H_ |
| OLD | NEW |