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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 Vector<const char> str, | 125 Vector<const char> str, |
126 PretenureFlag pretenure = NOT_TENURED); | 126 PretenureFlag pretenure = NOT_TENURED); |
127 | 127 |
128 Handle<String> NewStringFromTwoByte( | 128 Handle<String> NewStringFromTwoByte( |
129 Vector<const uc16> str, | 129 Vector<const uc16> str, |
130 PretenureFlag pretenure = NOT_TENURED); | 130 PretenureFlag pretenure = NOT_TENURED); |
131 | 131 |
132 // Allocates and partially initializes an ASCII or TwoByte String. The | 132 // Allocates and partially initializes an ASCII or TwoByte String. The |
133 // characters of the string are uninitialized. Currently used in regexp code | 133 // characters of the string are uninitialized. Currently used in regexp code |
134 // only, where they are pretenured. | 134 // only, where they are pretenured. |
135 MaybeHandle<SeqOneByteString> NewRawOneByteString( | 135 MUST_USE_RESULT MaybeHandle<SeqOneByteString> NewRawOneByteString( |
136 int length, | 136 int length, |
137 PretenureFlag pretenure = NOT_TENURED); | 137 PretenureFlag pretenure = NOT_TENURED); |
138 MaybeHandle<SeqTwoByteString> NewRawTwoByteString( | 138 MUST_USE_RESULT MaybeHandle<SeqTwoByteString> NewRawTwoByteString( |
139 int length, | 139 int length, |
140 PretenureFlag pretenure = NOT_TENURED); | 140 PretenureFlag pretenure = NOT_TENURED); |
141 | 141 |
142 // Create a new cons string object which consists of a pair of strings. | 142 // Create a new cons string object which consists of a pair of strings. |
143 MUST_USE_RESULT MaybeHandle<String> NewConsString(Handle<String> left, | 143 MUST_USE_RESULT MaybeHandle<String> NewConsString(Handle<String> left, |
144 Handle<String> right); | 144 Handle<String> right); |
145 | 145 |
146 Handle<ConsString> NewRawConsString(String::Encoding encoding); | 146 Handle<ConsString> NewRawConsString(String::Encoding encoding); |
147 | 147 |
148 // Create a new sequential string containing the concatenation of the inputs. | 148 // Create a new sequential string containing the concatenation of the inputs. |
(...skipping 10 matching lines...) Expand all Loading... |
159 if (begin == 0 && end == str->length()) return str; | 159 if (begin == 0 && end == str->length()) return str; |
160 return NewProperSubString(str, begin, end); | 160 return NewProperSubString(str, begin, end); |
161 } | 161 } |
162 | 162 |
163 Handle<SlicedString> NewRawSlicedString(String::Encoding encoding); | 163 Handle<SlicedString> NewRawSlicedString(String::Encoding encoding); |
164 | 164 |
165 // Creates a new external String object. There are two String encodings | 165 // Creates a new external String object. There are two String encodings |
166 // in the system: ASCII and two byte. Unlike other String types, it does | 166 // in the system: ASCII and two byte. Unlike other String types, it does |
167 // not make sense to have a UTF-8 factory function for external strings, | 167 // not make sense to have a UTF-8 factory function for external strings, |
168 // because we cannot change the underlying buffer. | 168 // because we cannot change the underlying buffer. |
169 MaybeHandle<String> NewExternalStringFromAscii( | 169 MUST_USE_RESULT MaybeHandle<String> NewExternalStringFromAscii( |
170 const ExternalAsciiString::Resource* resource); | 170 const ExternalAsciiString::Resource* resource); |
171 MaybeHandle<String> NewExternalStringFromTwoByte( | 171 MUST_USE_RESULT MaybeHandle<String> NewExternalStringFromTwoByte( |
172 const ExternalTwoByteString::Resource* resource); | 172 const ExternalTwoByteString::Resource* resource); |
173 | 173 |
174 // Create a symbol. | 174 // Create a symbol. |
175 Handle<Symbol> NewSymbol(); | 175 Handle<Symbol> NewSymbol(); |
176 Handle<Symbol> NewPrivateSymbol(); | 176 Handle<Symbol> NewPrivateSymbol(); |
177 | 177 |
178 // Create a global (but otherwise uninitialized) context. | 178 // Create a global (but otherwise uninitialized) context. |
179 Handle<Context> NewNativeContext(); | 179 Handle<Context> NewNativeContext(); |
180 | 180 |
181 // Create a global context. | 181 // Create a global context. |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 | 597 |
598 // Update the map cache in the native context with (keys, map) | 598 // Update the map cache in the native context with (keys, map) |
599 Handle<MapCache> AddToMapCache(Handle<Context> context, | 599 Handle<MapCache> AddToMapCache(Handle<Context> context, |
600 Handle<FixedArray> keys, | 600 Handle<FixedArray> keys, |
601 Handle<Map> map); | 601 Handle<Map> map); |
602 }; | 602 }; |
603 | 603 |
604 } } // namespace v8::internal | 604 } } // namespace v8::internal |
605 | 605 |
606 #endif // V8_FACTORY_H_ | 606 #endif // V8_FACTORY_H_ |
OLD | NEW |