builtins-promise-gen.cc 1.19 KB
Newer Older
1 2 3
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
4

5 6 7
#include "src/builtins/builtins-promise-gen.h"

#include "src/builtins/builtins-constructor-gen.h"
8
#include "src/builtins/builtins-iterator-gen.h"
9
#include "src/builtins/builtins-promise.h"
10
#include "src/builtins/builtins-utils-gen.h"
11
#include "src/builtins/builtins.h"
12 13
#include "src/codegen/code-factory.h"
#include "src/codegen/code-stub-assembler.h"
14 15
#include "src/objects/fixed-array.h"
#include "src/objects/js-objects.h"
16
#include "src/objects/js-promise.h"
17
#include "src/objects/objects-inl.h"
18
#include "src/objects/smi.h"
19

20 21 22
namespace v8 {
namespace internal {

23 24
void PromiseBuiltinsAssembler::ZeroOutEmbedderOffsets(
    TNode<JSPromise> promise) {
25
  for (int offset = JSPromise::kHeaderSize;
26
       offset < JSPromise::kSizeWithEmbedderFields; offset += kTaggedSize) {
27
    StoreObjectFieldNoWriteBarrier(promise, offset, SmiConstant(Smi::zero()));
28
  }
gsathya's avatar
gsathya committed
29 30
}

31 32 33
TNode<HeapObject> PromiseBuiltinsAssembler::AllocateJSPromise(
    TNode<Context> context) {
  return Allocate(JSPromise::kSizeWithEmbedderFields);
34 35
}

36 37
}  // namespace internal
}  // namespace v8