Index: src/ia32/code-stubs-ia32.cc |
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
index 09012b6f9bcb981c9a63ca54c5d24111a79bd475..cd170e069f2a53786ec01909a2b9d039f8b30985 100644 |
--- a/src/ia32/code-stubs-ia32.cc |
+++ b/src/ia32/code-stubs-ia32.cc |
@@ -163,9 +163,13 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) { |
// Get the function info from the stack. |
__ mov(edx, Operand(esp, 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. |