Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index a36f4b1c6c06074f104e4ee2ef8856a196e096b5..25539b045db98de43378f558a935b61f0cb268d0 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -2270,6 +2270,15 @@ void CallFunctionStub::Generate(MacroAssembler* masm) { |
if (CallAsMethod()) { |
if (NeedsChecks()) { |
+ // FIXME: expedient but expensive; surely a better way? |
+ // Always call ToObject() on symbol values. |
+ Label not_a_symbol; |
+ __ movp(rax, Operand(rsp, (argc_ + 1) * kPointerSize)); |
+ __ JumpIfSmi(rax, ¬_a_symbol, Label::kNear); |
+ __ CmpObjectType(rax, SYMBOL_TYPE, rcx); |
+ __ j(equal, &wrap); |
+ |
+ __ bind(¬_a_symbol); |
// Do not transform the receiver for strict mode functions. |
__ movp(rcx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); |
__ testb(FieldOperand(rcx, SharedFunctionInfo::kStrictModeByteOffset), |