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

Unified Diff: src/factory.cc

Issue 1895603002: [esnext] prototype runtime implementation for async functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@AsyncFunction
Patch Set: properly rebase Created 4 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
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 9cebd3f1b470e8e743d163ee17fe69040445a113..7d1251e0b4f0c688a03df25e6f5978456876db4a 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1227,6 +1227,7 @@ Handle<JSFunction> Factory::NewFunction(Handle<Map> map,
map.is_identical_to(
isolate()->sloppy_function_with_readonly_prototype_map()) ||
map.is_identical_to(isolate()->strict_function_map()) ||
+ map.is_identical_to(isolate()->strict_function_without_prototype_map()) ||
Dan Ehrenberg 2016/05/04 22:52:36 Why do we suddenly need this now, but we didn't ne
caitp (gmail) 2016/05/06 18:45:26 I have no idea --- but I'm pretty sure it is a mis
Dan Ehrenberg 2016/05/09 23:02:54 Well, if it fixes a previous bug, then at least ch
// TODO(titzer): wasm_function_map() could be undefined here. ugly.
(*map == context->get(Context::WASM_FUNCTION_MAP_INDEX)) ||
map.is_identical_to(isolate()->proxy_function_map()));
@@ -1660,7 +1661,7 @@ void Factory::NewJSArrayStorage(Handle<JSArray> array,
Handle<JSGeneratorObject> Factory::NewJSGeneratorObject(
Handle<JSFunction> function) {
- DCHECK(function->shared()->is_generator());
+ DCHECK(function->shared()->is_generator() || function->shared()->is_async());
JSFunction::EnsureHasInitialMap(function);
Handle<Map> map(function->initial_map());
DCHECK_EQ(JS_GENERATOR_OBJECT_TYPE, map->instance_type());
@@ -2066,6 +2067,9 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
shared->set_instance_class_name(isolate()->heap()->Generator_string());
shared->DisableOptimization(kGenerator);
}
+ if (IsAsyncFunction(kind)) {
+ shared->DisableOptimization(kGenerator);
+ }
Dan Ehrenberg 2016/05/04 22:52:36 Nit: Any way you could merge this with the above D
return shared;
}

Powered by Google App Engine
This is Rietveld 408576698