Index: src/ia32/code-stubs-ia32.cc |
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
index e280c50e7937d30eb3344017332ee6156a5b33bb..fc32866c68c35a46c20d6ac59fbaa34657bca64e 100644 |
--- a/src/ia32/code-stubs-ia32.cc |
+++ b/src/ia32/code-stubs-ia32.cc |
@@ -2433,7 +2433,16 @@ void CallFunctionStub::Generate(MacroAssembler* masm) { |
if (CallAsMethod()) { |
if (NeedsChecks()) { |
- // Do not transform the receiver for strict mode functions. |
+ // FIXME: expedient but expensive; surely a better way? |
+ // Always call ToObject() on symbol values. |
+ Label not_a_symbol; |
+ __ mov(eax, Operand(esp, (argc_ + 1) * kPointerSize)); |
+ __ JumpIfSmi(eax, ¬_a_symbol, Label::kNear); |
+ __ CmpObjectType(eax, SYMBOL_TYPE, ecx); |
+ __ j(equal, &wrap); |
+ |
+ __ bind(¬_a_symbol); |
+ // Do not transform the receiver for strict mode functions. |
__ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
__ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrictModeByteOffset), |
1 << SharedFunctionInfo::kStrictModeBitWithinByte); |