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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 13192004: arrange to create prototypes for generators (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Allow fast closure creation for generators 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
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index fffd37f519db9c9dcb19fb44d5640de8e39093e9..7513d13ebe4ce785e622f274aff7021a68d11ef8 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -158,9 +158,13 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) {
// Get the function info from the stack.
__ movq(rdx, Operand(rsp, 1 * kPointerSize));
- int map_index = (language_mode_ == CLASSIC_MODE)
- ? Context::FUNCTION_MAP_INDEX
- : Context::STRICT_MODE_FUNCTION_MAP_INDEX;
+ int map_index = is_generator_
+ ? ((language_mode_ == CLASSIC_MODE)
+ ? Context::GENERATOR_FUNCTION_MAP_INDEX
+ : Context::STRICT_MODE_GENERATOR_FUNCTION_MAP_INDEX)
+ : ((language_mode_ == CLASSIC_MODE)
+ ? Context::FUNCTION_MAP_INDEX
+ : Context::STRICT_MODE_FUNCTION_MAP_INDEX);
// Compute the function map in the current native context and set that
// as the map of the allocated object.

Powered by Google App Engine
This is Rietveld 408576698