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/globals.h" | 8 #include "src/globals.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // Interface for handle based allocation. | 24 // Interface for handle based allocation. |
25 class V8_EXPORT_PRIVATE Factory final { | 25 class V8_EXPORT_PRIVATE Factory final { |
26 public: | 26 public: |
27 Handle<Oddball> NewOddball(Handle<Map> map, const char* to_string, | 27 Handle<Oddball> NewOddball(Handle<Map> map, const char* to_string, |
28 Handle<Object> to_number, const char* type_of, | 28 Handle<Object> to_number, const char* type_of, |
29 byte kind); | 29 byte kind); |
30 | 30 |
31 // Allocates a fixed array initialized with undefined values. | 31 // Allocates a fixed array initialized with undefined values. |
32 Handle<FixedArray> NewFixedArray(int size, | 32 Handle<FixedArray> NewFixedArray(int size, |
33 PretenureFlag pretenure = NOT_TENURED); | 33 PretenureFlag pretenure = NOT_TENURED); |
| 34 // Tries allocating a fixed array initialized with undefined values. |
| 35 // In case of an allocation failure (OOM) an empty handle is returned. |
| 36 // The caller has to manually signal an |
| 37 // v8::internal::Heap::FatalProcessOutOfMemory typically by calling |
| 38 // NewFixedArray as a fallback. |
| 39 MUST_USE_RESULT |
| 40 MaybeHandle<FixedArray> TryNewFixedArray( |
| 41 int size, PretenureFlag pretenure = NOT_TENURED); |
34 | 42 |
35 // Allocate a new fixed array with non-existing entries (the hole). | 43 // Allocate a new fixed array with non-existing entries (the hole). |
36 Handle<FixedArray> NewFixedArrayWithHoles( | 44 Handle<FixedArray> NewFixedArrayWithHoles( |
37 int size, | 45 int size, |
38 PretenureFlag pretenure = NOT_TENURED); | 46 PretenureFlag pretenure = NOT_TENURED); |
39 | 47 |
40 // Allocates an uninitialized fixed array. It must be filled by the caller. | 48 // Allocates an uninitialized fixed array. It must be filled by the caller. |
41 Handle<FixedArray> NewUninitializedFixedArray(int size); | 49 Handle<FixedArray> NewUninitializedFixedArray(int size); |
42 | 50 |
43 // Allocate a new uninitialized fixed double array. | 51 // Allocate a new uninitialized fixed double array. |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 FunctionMode function_mode); | 796 FunctionMode function_mode); |
789 | 797 |
790 void SetStrictFunctionInstanceDescriptor(Handle<Map> map, | 798 void SetStrictFunctionInstanceDescriptor(Handle<Map> map, |
791 FunctionMode function_mode); | 799 FunctionMode function_mode); |
792 }; | 800 }; |
793 | 801 |
794 } // namespace internal | 802 } // namespace internal |
795 } // namespace v8 | 803 } // namespace v8 |
796 | 804 |
797 #endif // V8_FACTORY_H_ | 805 #endif // V8_FACTORY_H_ |
OLD | NEW |