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