Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: src/builtins/builtins-promise-gen.cc

Issue 2889863002: Allow embedder to set promise internal field count (Closed)
Patch Set: More BUILD.gn fixes Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/bootstrapper.cc ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698