Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index ca78236aa2157eef69c4b9838d6272fd22ee2b4e..96ef755a1d745baa84badd5ac7547c55b536aabf 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -68,11 +68,15 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) { |
// Get the function info from the stack. |
__ movq(rdx, Operand(rsp, 1 * kPointerSize)); |
+ int map_index = strict_mode_ == kStrictMode |
+ ? Context::FUNCTION_MAP_STRICT_INDEX |
+ : Context::FUNCTION_MAP_INDEX; |
+ |
// Compute the function map in the current global context and set that |
// as the map of the allocated object. |
__ movq(rcx, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX))); |
__ movq(rcx, FieldOperand(rcx, GlobalObject::kGlobalContextOffset)); |
- __ movq(rcx, Operand(rcx, Context::SlotOffset(Context::FUNCTION_MAP_INDEX))); |
+ __ movq(rcx, Operand(rcx, Context::SlotOffset(map_index))); |
__ movq(FieldOperand(rax, JSObject::kMapOffset), rcx); |
// Initialize the rest of the function. We don't have to update the |