Index: src/builtins/builtins-promise-gen.cc |
diff --git a/src/builtins/builtins-promise-gen.cc b/src/builtins/builtins-promise-gen.cc |
index a050f18d668a4b591ef78a4766504f7cc7208ba3..b1412eb7cd5f81a889761541ca8efaac7429e7e9 100644 |
--- a/src/builtins/builtins-promise-gen.cc |
+++ b/src/builtins/builtins-promise-gen.cc |
@@ -31,6 +31,10 @@ void PromiseBuiltinsAssembler::PromiseInit(Node* promise) { |
SmiConstant(v8::Promise::kPending)); |
StoreObjectFieldNoWriteBarrier(promise, JSPromise::kFlagsOffset, |
SmiConstant(0)); |
+ for (int i = 0; i < v8::Promise::kEmbedderFieldCount; i++) { |
+ int offset = JSPromise::kSize + i * kPointerSize; |
+ StoreObjectFieldNoWriteBarrier(promise, offset, SmiConstant(Smi::kZero)); |
+ } |
} |
Node* PromiseBuiltinsAssembler::AllocateAndInitJSPromise(Node* context) { |
@@ -62,6 +66,10 @@ Node* PromiseBuiltinsAssembler::AllocateAndSetJSPromise(Node* context, |
StoreObjectFieldNoWriteBarrier(instance, JSPromise::kResultOffset, result); |
StoreObjectFieldNoWriteBarrier(instance, JSPromise::kFlagsOffset, |
SmiConstant(0)); |
+ for (int i = 0; i < v8::Promise::kEmbedderFieldCount; i++) { |
+ int offset = JSPromise::kSize + i * kPointerSize; |
+ StoreObjectFieldNoWriteBarrier(instance, offset, SmiConstant(Smi::kZero)); |
+ } |
Label out(this); |
GotoIfNot(IsPromiseHookEnabledOrDebugIsActive(), &out); |