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

Unified Diff: src/factory.cc

Issue 13192004: arrange to create prototypes for generators (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Explicitly add constructor properties in generator.js Created 7 years, 8 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/contexts.h ('k') | src/generator.js » ('j') | src/generator.js » ('J')
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 fece9a09c91779c6f360d842a7c2b3b9a7a51791..2c0ceb192c9edfbb724f3067e8dda04a9ed0c85e 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -578,15 +578,22 @@ Handle<JSFunction> Factory::BaseNewFunctionFromSharedFunctionInfo(
}
+static Handle<Map> MapForNewFunction(Isolate *isolate,
+ Handle<SharedFunctionInfo> function_info) {
+ Context *context = isolate->context()->native_context();
+ int map_index = Context::FunctionMapIndex(function_info->language_mode(),
+ function_info->is_generator());
+ return Handle<Map>(Map::cast(context->get(map_index)));
+}
+
+
Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
Handle<SharedFunctionInfo> function_info,
Handle<Context> context,
PretenureFlag pretenure) {
Handle<JSFunction> result = BaseNewFunctionFromSharedFunctionInfo(
function_info,
- function_info->is_classic_mode()
- ? isolate()->function_map()
- : isolate()->strict_mode_function_map(),
+ MapForNewFunction(isolate(), function_info),
pretenure);
if (function_info->ic_age() != isolate()->heap()->global_ic_age()) {
« no previous file with comments | « src/contexts.h ('k') | src/generator.js » ('j') | src/generator.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698