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

Unified Diff: src/factory.cc

Issue 2459283004: [promises] Move CreateResolvingFunctions to c++ (Closed)
Patch Set: Address comments Created 4 years, 1 month 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
« src/contexts.h ('K') | « src/factory.h ('k') | src/js/async-await.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 564f821c42875dd1e14e68d0344678b1fe9f8dc0..fc2adac655dbaec4e2818a4bad7922001ca7f7fb 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -962,6 +962,14 @@ Handle<Context> Factory::NewBlockContext(Handle<JSFunction> function,
return context;
}
+Handle<Context> Factory::NewPromiseResolvingFunctionContext(int length) {
+ DCHECK(length >= Context::MIN_CONTEXT_SLOTS);
adamk 2016/11/09 21:36:21 Nit: DCHECK_GE(length, Context::MIN_CONTEXT_SLOTS)
gsathya 2016/11/10 15:26:21 Done.
+ Handle<FixedArray> array = NewFixedArray(length);
+ array->set_map_no_write_barrier(*function_context_map());
+ Handle<Context> context = Handle<Context>::cast(array);
+ context->set_extension(*the_hole_value());
+ return context;
+}
Handle<Struct> Factory::NewStruct(InstanceType type) {
CALL_HEAP_FUNCTION(
« src/contexts.h ('K') | « src/factory.h ('k') | src/js/async-await.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698