1 // Copyright 2016 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "src/builtins/builtins-promise-gen.h" 6 7 #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 #include "src/codegen/code-factory.h" 13 #include "src/codegen/code-stub-assembler.h" 14 #include "src/objects/fixed-array.h" 15 #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 namespace v8 { 21 namespace internal { 22 ZeroOutEmbedderOffsets(TNode<JSPromise> promise)23void PromiseBuiltinsAssembler::ZeroOutEmbedderOffsets( 24 TNode<JSPromise> promise) { 25 for (int offset = JSPromise::kHeaderSize; 26 offset < JSPromise::kSizeWithEmbedderFields; offset += kTaggedSize) { 27 StoreObjectFieldNoWriteBarrier(promise, offset, SmiConstant(Smi::zero())); 28 } 29 } 30 AllocateJSPromise(TNode<Context> context)31TNode<HeapObject> PromiseBuiltinsAssembler::AllocateJSPromise( 32 TNode<Context> context) { 33 return Allocate(JSPromise::kSizeWithEmbedderFields); 34 } 35 36 } // namespace internal 37 } // namespace v8 38