diff options
Diffstat (limited to 'deps/v8/src/heap/factory.h')
-rw-r--r-- | deps/v8/src/heap/factory.h | 70 |
1 files changed, 48 insertions, 22 deletions
diff --git a/deps/v8/src/heap/factory.h b/deps/v8/src/heap/factory.h index 073f0fbcf5..b73e8a922a 100644 --- a/deps/v8/src/heap/factory.h +++ b/deps/v8/src/heap/factory.h @@ -23,13 +23,14 @@ namespace internal { // Forward declarations. class AliasedArgumentsEntry; -class BoilerplateDescription; +class ObjectBoilerplateDescription; class BreakPoint; class BreakPointInfo; class CallableTask; class CallbackTask; class CallHandlerInfo; -class ConstantElementsPair; +class Expression; +class ArrayBoilerplateDescription; class CoverageInfo; class DebugInfo; class EnumCache; @@ -50,6 +51,8 @@ class RegExpMatchInfo; class ScriptContextTable; class StoreHandler; class TemplateObjectDescription; +class UncompiledDataWithoutPreParsedScope; +class UncompiledDataWithPreParsedScope; class WasmExportedFunctionData; struct SourceRange; template <typename T> @@ -143,10 +146,8 @@ class V8_EXPORT_PRIVATE Factory { // Allocates a fixed array for name-value pairs of boilerplate properties and // calculates the number of properties we need to store in the backing store. - Handle<BoilerplateDescription> NewBoilerplateDescription(int boilerplate, - int all_properties, - int index_keys, - bool has_seen_proto); + Handle<ObjectBoilerplateDescription> NewObjectBoilerplateDescription( + int boilerplate, int all_properties, int index_keys, bool has_seen_proto); // Allocate a new uninitialized fixed double array. // The function returns a pre-allocated empty fixed array for length = 0, @@ -190,8 +191,8 @@ class V8_EXPORT_PRIVATE Factory { Handle<Tuple3> NewTuple3(Handle<Object> value1, Handle<Object> value2, Handle<Object> value3, PretenureFlag pretenure); - // Create a new ConstantElementsPair struct. - Handle<ConstantElementsPair> NewConstantElementsPair( + // Create a new ArrayBoilerplateDescription struct. + Handle<ArrayBoilerplateDescription> NewArrayBoilerplateDescription( ElementsKind elements_kind, Handle<FixedArrayBase> constant_values); // Create a new TemplateObjectDescription struct. @@ -391,6 +392,13 @@ class V8_EXPORT_PRIVATE Factory { Handle<Context> NewBlockContext(Handle<Context> previous, Handle<ScopeInfo> scope_info); + // Create a context that's used by builtin functions. + // + // These are similar to function context but don't have a previous + // context or any scope info. These are used to store spec defined + // context values. + Handle<Context> NewBuiltinContext(Handle<Context> native_context, int length); + Handle<Struct> NewStruct(InstanceType type, PretenureFlag pretenure = NOT_TENURED); @@ -401,6 +409,9 @@ class V8_EXPORT_PRIVATE Factory { Handle<Script> NewScript(Handle<String> source, PretenureFlag tenure = TENURED); + Handle<Script> NewScriptWithId(Handle<String> source, int script_id, + PretenureFlag tenure = TENURED); + Handle<Script> CloneScript(Handle<Script> script); Handle<BreakPointInfo> NewBreakPointInfo(int source_position); Handle<BreakPoint> NewBreakPoint(int id, Handle<String> condition); @@ -454,7 +465,7 @@ class V8_EXPORT_PRIVATE Factory { int slack = 0); // Allocate a tenured AllocationSite. Its payload is null. - Handle<AllocationSite> NewAllocationSite(); + Handle<AllocationSite> NewAllocationSite(bool with_weak_next); // Allocates and initializes a new Map. Handle<Map> NewMap(InstanceType type, int instance_size, @@ -525,18 +536,21 @@ class V8_EXPORT_PRIVATE Factory { inline Handle<Object> NewNumberFromInt64( int64_t value, PretenureFlag pretenure = NOT_TENURED); inline Handle<HeapNumber> NewHeapNumber( - double value, MutableMode mode = IMMUTABLE, - PretenureFlag pretenure = NOT_TENURED); + double value, PretenureFlag pretenure = NOT_TENURED); inline Handle<HeapNumber> NewHeapNumberFromBits( - uint64_t bits, MutableMode mode = IMMUTABLE, - PretenureFlag pretenure = NOT_TENURED); - // Creates mutable heap number object with value field set to hole NaN. - inline Handle<HeapNumber> NewMutableHeapNumber( - PretenureFlag pretenure = NOT_TENURED); + uint64_t bits, PretenureFlag pretenure = NOT_TENURED); // Creates heap number object with not yet set value field. - Handle<HeapNumber> NewHeapNumber(MutableMode mode, - PretenureFlag pretenure = NOT_TENURED); + Handle<HeapNumber> NewHeapNumber(PretenureFlag pretenure = NOT_TENURED); + + Handle<MutableHeapNumber> NewMutableHeapNumber( + PretenureFlag pretenure = NOT_TENURED); + inline Handle<MutableHeapNumber> NewMutableHeapNumber( + double value, PretenureFlag pretenure = NOT_TENURED); + inline Handle<MutableHeapNumber> NewMutableHeapNumberFromBits( + uint64_t bits, PretenureFlag pretenure = NOT_TENURED); + inline Handle<MutableHeapNumber> NewMutableHeapNumberWithHoleNaN( + PretenureFlag pretenure = NOT_TENURED); // Allocates a new BigInt with {length} digits. Only to be used by // MutableBigInt::New*. @@ -710,7 +724,16 @@ class V8_EXPORT_PRIVATE Factory { Handle<ModuleInfo> NewModuleInfo(); - Handle<PreParsedScopeData> NewPreParsedScopeData(); + Handle<PreParsedScopeData> NewPreParsedScopeData(int length); + + Handle<UncompiledDataWithoutPreParsedScope> + NewUncompiledDataWithoutPreParsedScope(int32_t start_position, + int32_t end_position, + int32_t function_literal_id); + + Handle<UncompiledDataWithPreParsedScope> NewUncompiledDataWithPreParsedScope( + int32_t start_position, int32_t end_position, int32_t function_literal_id, + Handle<PreParsedScopeData>); // Create an External object for V8's external API. Handle<JSObject> NewExternal(void* value); @@ -755,12 +778,10 @@ class V8_EXPORT_PRIVATE Factory { // initialization by the caller. Handle<Code> NewCodeForDeserialization(uint32_t size); -#ifdef V8_EMBEDDED_BUILTINS // Allocates a new code object and initializes it as the trampoline to the // given off-heap entry point. Handle<Code> NewOffHeapTrampolineFor(Handle<Code> code, Address off_heap_entry); -#endif Handle<Code> CopyCode(Handle<Code> code); @@ -809,6 +830,11 @@ class V8_EXPORT_PRIVATE Factory { STRUCT_LIST(STRUCT_MAP_ACCESSOR) #undef STRUCT_MAP_ACCESSOR +#define ALLOCATION_SITE_MAP_ACCESSOR(NAME, Name, Size, name) \ + inline Handle<Map> name##_map(); + ALLOCATION_SITE_LIST(ALLOCATION_SITE_MAP_ACCESSOR) +#undef ALLOCATION_SITE_MAP_ACCESSOR + #define DATA_HANDLER_MAP_ACCESSOR(NAME, Name, Size, name) \ inline Handle<Map> name##_map(); DATA_HANDLER_LIST(DATA_HANDLER_MAP_ACCESSOR) @@ -873,7 +899,7 @@ class V8_EXPORT_PRIVATE Factory { Handle<Object> argument, int start_position, int end_position, - Handle<Object> script, + Handle<Script> script, Handle<Object> stack_frames); Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared); |