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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 217 |
218 // Creates a new external String object. There are two String encodings | 218 // Creates a new external String object. There are two String encodings |
219 // in the system: one-byte and two-byte. Unlike other String types, it does | 219 // in the system: one-byte and two-byte. Unlike other String types, it does |
220 // not make sense to have a UTF-8 factory function for external strings, | 220 // not make sense to have a UTF-8 factory function for external strings, |
221 // because we cannot change the underlying buffer. Note that these strings | 221 // because we cannot change the underlying buffer. Note that these strings |
222 // are backed by a string resource that resides outside the V8 heap. | 222 // are backed by a string resource that resides outside the V8 heap. |
223 MUST_USE_RESULT MaybeHandle<String> NewExternalStringFromOneByte( | 223 MUST_USE_RESULT MaybeHandle<String> NewExternalStringFromOneByte( |
224 const ExternalOneByteString::Resource* resource); | 224 const ExternalOneByteString::Resource* resource); |
225 MUST_USE_RESULT MaybeHandle<String> NewExternalStringFromTwoByte( | 225 MUST_USE_RESULT MaybeHandle<String> NewExternalStringFromTwoByte( |
226 const ExternalTwoByteString::Resource* resource); | 226 const ExternalTwoByteString::Resource* resource); |
| 227 // Create a new external string object for one-byte encoded native script. |
| 228 // It does not cache the resource data pointer. |
| 229 Handle<ExternalOneByteString> NewNativeSourceString( |
| 230 const ExternalOneByteString::Resource* resource); |
227 | 231 |
228 // Create a symbol. | 232 // Create a symbol. |
229 Handle<Symbol> NewSymbol(); | 233 Handle<Symbol> NewSymbol(); |
230 Handle<Symbol> NewPrivateSymbol(); | 234 Handle<Symbol> NewPrivateSymbol(); |
231 | 235 |
232 // Create a global (but otherwise uninitialized) context. | 236 // Create a global (but otherwise uninitialized) context. |
233 Handle<Context> NewNativeContext(); | 237 Handle<Context> NewNativeContext(); |
234 | 238 |
235 // Create a script context. | 239 // Create a script context. |
236 Handle<Context> NewScriptContext(Handle<JSFunction> function, | 240 Handle<Context> NewScriptContext(Handle<JSFunction> function, |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 718 |
715 // Create a JSArray with no elements and no length. | 719 // Create a JSArray with no elements and no length. |
716 Handle<JSArray> NewJSArray(ElementsKind elements_kind, | 720 Handle<JSArray> NewJSArray(ElementsKind elements_kind, |
717 PretenureFlag pretenure = NOT_TENURED); | 721 PretenureFlag pretenure = NOT_TENURED); |
718 }; | 722 }; |
719 | 723 |
720 } // namespace internal | 724 } // namespace internal |
721 } // namespace v8 | 725 } // namespace v8 |
722 | 726 |
723 #endif // V8_FACTORY_H_ | 727 #endif // V8_FACTORY_H_ |
OLD | NEW |