diff options
Diffstat (limited to 'deps/v8/src/heap/factory.h')
-rw-r--r-- | deps/v8/src/heap/factory.h | 73 |
1 files changed, 32 insertions, 41 deletions
diff --git a/deps/v8/src/heap/factory.h b/deps/v8/src/heap/factory.h index 8b7738cad8..3890807e1a 100644 --- a/deps/v8/src/heap/factory.h +++ b/deps/v8/src/heap/factory.h @@ -148,7 +148,8 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { // values. Handle<FeedbackVector> NewFeedbackVector( Handle<SharedFunctionInfo> shared, - Handle<ClosureFeedbackCellArray> closure_feedback_cell_array); + Handle<ClosureFeedbackCellArray> closure_feedback_cell_array, + Handle<FeedbackCell> parent_feedback_cell); // Allocates a clean embedder data array with given capacity. Handle<EmbedderDataArray> NewEmbedderDataArray(int length); @@ -449,7 +450,8 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { Handle<Foreign> NewForeign( Address addr, AllocationType allocation_type = AllocationType::kYoung); - Handle<Cell> NewCell(Handle<Object> value); + Handle<Cell> NewCell(Smi value); + Handle<Cell> NewCell(); Handle<PropertyCell> NewPropertyCell( Handle<Name> name, PropertyDetails details, Handle<Object> value, @@ -635,13 +637,13 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { Handle<Map> rtt); Handle<WasmCapiFunctionData> NewWasmCapiFunctionData( Address call_target, Handle<Foreign> embedder_data, - Handle<CodeT> wrapper_code, Handle<Map> rtt, + Handle<Code> wrapper_code, Handle<Map> rtt, Handle<PodArray<wasm::ValueType>> serialized_sig); Handle<WasmExportedFunctionData> NewWasmExportedFunctionData( - Handle<CodeT> export_wrapper, Handle<WasmInstanceObject> instance, + Handle<Code> export_wrapper, Handle<WasmInstanceObject> instance, Address call_target, Handle<Object> ref, int func_index, - const wasm::FunctionSig* sig, int wrapper_budget, Handle<Map> rtt, - wasm::Promise promise); + const wasm::FunctionSig* sig, uint32_t canonical_type_index, + int wrapper_budget, Handle<Map> rtt, wasm::Promise promise); Handle<WasmApiFunctionRef> NewWasmApiFunctionRef( Handle<JSReceiver> callable, wasm::Suspend suspend, Handle<WasmInstanceObject> instance); @@ -650,7 +652,7 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { Handle<WasmJSFunctionData> NewWasmJSFunctionData( Address opt_call_target, Handle<JSReceiver> callable, int return_count, int parameter_count, Handle<PodArray<wasm::ValueType>> serialized_sig, - Handle<CodeT> wrapper_code, Handle<Map> rtt, wasm::Suspend suspend, + Handle<Code> wrapper_code, Handle<Map> rtt, wasm::Suspend suspend, wasm::Promise promise); Handle<WasmResumeData> NewWasmResumeData( Handle<WasmSuspenderObject> suspender, wasm::OnResume on_resume); @@ -667,7 +669,7 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { // Returns a handle to a WasmArray if successful, or a Smi containing a // {MessageTemplate} if computing the array's elements leads to an error. Handle<Object> NewWasmArrayFromElementSegment( - Handle<WasmInstanceObject> instance, const wasm::WasmElemSegment* segment, + Handle<WasmInstanceObject> instance, uint32_t segment_index, uint32_t start_offset, uint32_t length, Handle<Map> map); Handle<WasmContinuationObject> NewWasmContinuationObject( Address jmpbuf, Handle<Foreign> managed_stack, Handle<HeapObject> parent, @@ -696,6 +698,11 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { size_t byte_length, InitializedFlag initialized, AllocationType allocation = AllocationType::kYoung); + MaybeHandle<JSArrayBuffer> NewJSArrayBufferAndBackingStore( + size_t byte_length, size_t max_byte_length, InitializedFlag initialized, + ResizableFlag resizable = ResizableFlag::kNotResizable, + AllocationType allocation = AllocationType::kYoung); + Handle<JSArrayBuffer> NewJSSharedArrayBuffer( std::shared_ptr<BackingStore> backing_store); @@ -706,10 +713,12 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { // Creates a new JSTypedArray with the specified buffer. Handle<JSTypedArray> NewJSTypedArray(ExternalArrayType type, Handle<JSArrayBuffer> buffer, - size_t byte_offset, size_t length); + size_t byte_offset, size_t length, + bool is_length_tracking = false); - Handle<JSDataView> NewJSDataView(Handle<JSArrayBuffer> buffer, - size_t byte_offset, size_t byte_length); + Handle<JSDataViewOrRabGsabDataView> NewJSDataViewOrRabGsabDataView( + Handle<JSArrayBuffer> buffer, size_t byte_offset, size_t byte_length, + bool is_length_tracking = false); Handle<JSIteratorResult> NewJSIteratorResult(Handle<Object> value, bool done); Handle<JSAsyncFromSyncIterator> NewJSAsyncFromSyncIterator( @@ -746,8 +755,8 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { // Allocates a new code object and initializes it as the trampoline to the // given off-heap entry point. - Handle<CodeT> NewOffHeapTrampolineFor(Handle<CodeT> code, - Address off_heap_entry); + Handle<Code> NewOffHeapTrampolineFor(Handle<Code> code, + Address off_heap_entry); Handle<BytecodeArray> CopyBytecodeArray(Handle<BytecodeArray>); @@ -801,8 +810,6 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { MaybeHandle<String> name, Builtin builtin, FunctionKind kind = FunctionKind::kNormalFunction); - Handle<SharedFunctionInfo> NewSharedFunctionInfoForWebSnapshot(); - static bool IsFunctionModeWithPrototype(FunctionMode function_mode) { return (function_mode & kWithPrototypeBits) != 0; } @@ -910,7 +917,7 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { void PrepareMap(); void PrepareFeedbackCell(); - V8_WARN_UNUSED_RESULT Handle<JSFunction> BuildRaw(Handle<CodeT> code); + V8_WARN_UNUSED_RESULT Handle<JSFunction> BuildRaw(Handle<Code> code); Isolate* const isolate_; Handle<SharedFunctionInfo> sfi_; @@ -922,8 +929,8 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { friend class Factory; }; - // Allows creation of Code objects. It provides two build methods, one of - // which tries to gracefully handle allocation failure. + // Allows creation of InstructionStream objects. It provides two build + // methods, one of which tries to gracefully handle allocation failure. class V8_EXPORT_PRIVATE CodeBuilder final { public: CodeBuilder(Isolate* isolate, const CodeDesc& desc, CodeKind kind); @@ -933,15 +940,16 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { CodeKind kind); // Builds a new code object (fully initialized). All header fields of the - // returned object are immutable and the code object is write protected. + // associated InstructionStream are immutable and the InstructionStream + // object is write protected. V8_WARN_UNUSED_RESULT Handle<Code> Build(); // Like Build, builds a new code object. May return an empty handle if the // allocation fails. V8_WARN_UNUSED_RESULT MaybeHandle<Code> TryBuild(); // Sets the self-reference object in which a reference to the code object is - // stored. This allows generated code to reference its own Code object by - // using this handle. + // stored. This allows generated code to reference its own InstructionStream + // object by using this handle. CodeBuilder& set_self_reference(Handle<Object> self_reference) { DCHECK(!self_reference.is_null()); self_reference_ = self_reference; @@ -998,21 +1006,6 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { return *this; } - CodeBuilder& set_is_executable(bool executable) { - DCHECK_EQ(kind_, CodeKind::BUILTIN); - is_executable_ = executable; - return *this; - } - - // Indicates the CodeDataContainer should be allocated in read-only space. - // As an optimization, if the kind-specific flags match that of a canonical - // container, it will be used instead. - CodeBuilder& set_read_only_data_container(bool read_only) { - CHECK_IMPLIES(V8_EXTERNAL_CODE_SPACE_BOOL, !read_only); - read_only_data_container_ = read_only; - return *this; - } - CodeBuilder& set_kind_specific_flags(int32_t flags) { kind_specific_flags_ = flags; return *this; @@ -1032,8 +1025,9 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { private: MaybeHandle<Code> BuildInternal(bool retry_allocation_or_fail); - MaybeHandle<Code> AllocateCode(bool retry_allocation_or_fail); - MaybeHandle<Code> AllocateConcurrentSparkplugCode( + MaybeHandle<InstructionStream> AllocateInstructionStream( + bool retry_allocation_or_fail); + MaybeHandle<InstructionStream> AllocateConcurrentSparkplugInstructionStream( bool retry_allocation_or_fail); Isolate* const isolate_; @@ -1053,15 +1047,12 @@ class V8_EXPORT_PRIVATE Factory : public FactoryBase<Factory> { DeoptimizationData::Empty(isolate_); Handle<HeapObject> interpreter_data_; BasicBlockProfilerData* profiler_data_ = nullptr; - bool is_executable_ = true; - bool read_only_data_container_ = false; bool is_turbofanned_ = false; int stack_slots_ = 0; }; private: friend class FactoryBase<Factory>; - friend class WebSnapshotDeserializer; // ------ // Customization points for FactoryBase |