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

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

Issue 2889863002: Allow embedder to set promise internal field count (Closed)
Patch Set: Initialize external fields for promises constructed through factory 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..cd4e381a1bbfbad2a3fa6c540bf5c13a1c9116e3 100644
--- a/src/builtins/builtins-promise-gen.cc
+++ b/src/builtins/builtins-promise-gen.cc
@@ -17,6 +17,7 @@ namespace internal {
using compiler::Node;
Node* PromiseBuiltinsAssembler::AllocateJSPromise(Node* context) {
+ // Does this need to change to account for new internal fields?
Node* const native_context = LoadNativeContext(context);
Node* const promise_fun =
LoadContextElement(native_context, Context::PROMISE_FUNCTION_INDEX);
@@ -31,6 +32,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) {
« 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