11cb0ef41Sopenharmony_ci// Copyright 2016 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci#include "src/builtins/builtins-promise-gen.h"
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci#include "src/builtins/builtins-constructor-gen.h"
81cb0ef41Sopenharmony_ci#include "src/builtins/builtins-iterator-gen.h"
91cb0ef41Sopenharmony_ci#include "src/builtins/builtins-promise.h"
101cb0ef41Sopenharmony_ci#include "src/builtins/builtins-utils-gen.h"
111cb0ef41Sopenharmony_ci#include "src/builtins/builtins.h"
121cb0ef41Sopenharmony_ci#include "src/codegen/code-factory.h"
131cb0ef41Sopenharmony_ci#include "src/codegen/code-stub-assembler.h"
141cb0ef41Sopenharmony_ci#include "src/objects/fixed-array.h"
151cb0ef41Sopenharmony_ci#include "src/objects/js-objects.h"
161cb0ef41Sopenharmony_ci#include "src/objects/js-promise.h"
171cb0ef41Sopenharmony_ci#include "src/objects/objects-inl.h"
181cb0ef41Sopenharmony_ci#include "src/objects/smi.h"
191cb0ef41Sopenharmony_ci
201cb0ef41Sopenharmony_cinamespace v8 {
211cb0ef41Sopenharmony_cinamespace internal {
221cb0ef41Sopenharmony_ci
231cb0ef41Sopenharmony_civoid PromiseBuiltinsAssembler::ZeroOutEmbedderOffsets(
241cb0ef41Sopenharmony_ci    TNode<JSPromise> promise) {
251cb0ef41Sopenharmony_ci  for (int offset = JSPromise::kHeaderSize;
261cb0ef41Sopenharmony_ci       offset < JSPromise::kSizeWithEmbedderFields; offset += kTaggedSize) {
271cb0ef41Sopenharmony_ci    StoreObjectFieldNoWriteBarrier(promise, offset, SmiConstant(Smi::zero()));
281cb0ef41Sopenharmony_ci  }
291cb0ef41Sopenharmony_ci}
301cb0ef41Sopenharmony_ci
311cb0ef41Sopenharmony_ciTNode<HeapObject> PromiseBuiltinsAssembler::AllocateJSPromise(
321cb0ef41Sopenharmony_ci    TNode<Context> context) {
331cb0ef41Sopenharmony_ci  return Allocate(JSPromise::kSizeWithEmbedderFields);
341cb0ef41Sopenharmony_ci}
351cb0ef41Sopenharmony_ci
361cb0ef41Sopenharmony_ci}  // namespace internal
371cb0ef41Sopenharmony_ci}  // namespace v8
38