OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2426 if (RecordCallTarget()) { | 2426 if (RecordCallTarget()) { |
2427 GenerateRecordCallTarget(masm); | 2427 GenerateRecordCallTarget(masm); |
2428 } | 2428 } |
2429 } | 2429 } |
2430 | 2430 |
2431 // Fast-case: Just invoke the function. | 2431 // Fast-case: Just invoke the function. |
2432 ParameterCount actual(argc_); | 2432 ParameterCount actual(argc_); |
2433 | 2433 |
2434 if (CallAsMethod()) { | 2434 if (CallAsMethod()) { |
2435 if (NeedsChecks()) { | 2435 if (NeedsChecks()) { |
2436 // Do not transform the receiver for strict mode functions. | 2436 // FIXME: expedient but expensive; surely a better way? |
| 2437 // Always call ToObject() on symbol values. |
| 2438 Label not_a_symbol; |
| 2439 __ mov(eax, Operand(esp, (argc_ + 1) * kPointerSize)); |
| 2440 __ JumpIfSmi(eax, ¬_a_symbol, Label::kNear); |
| 2441 __ CmpObjectType(eax, SYMBOL_TYPE, ecx); |
| 2442 __ j(equal, &wrap); |
| 2443 |
| 2444 __ bind(¬_a_symbol); |
| 2445 // Do not transform the receiver for strict mode functions. |
2437 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 2446 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
2438 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrictModeByteOffset), | 2447 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrictModeByteOffset), |
2439 1 << SharedFunctionInfo::kStrictModeBitWithinByte); | 2448 1 << SharedFunctionInfo::kStrictModeBitWithinByte); |
2440 __ j(not_equal, &cont); | 2449 __ j(not_equal, &cont); |
2441 | 2450 |
2442 // Do not transform the receiver for natives (shared already in ecx). | 2451 // Do not transform the receiver for natives (shared already in ecx). |
2443 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kNativeByteOffset), | 2452 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kNativeByteOffset), |
2444 1 << SharedFunctionInfo::kNativeBitWithinByte); | 2453 1 << SharedFunctionInfo::kNativeBitWithinByte); |
2445 __ j(not_equal, &cont); | 2454 __ j(not_equal, &cont); |
2446 } | 2455 } |
(...skipping 2983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5430 Operand(ebp, 7 * kPointerSize), | 5439 Operand(ebp, 7 * kPointerSize), |
5431 NULL); | 5440 NULL); |
5432 } | 5441 } |
5433 | 5442 |
5434 | 5443 |
5435 #undef __ | 5444 #undef __ |
5436 | 5445 |
5437 } } // namespace v8::internal | 5446 } } // namespace v8::internal |
5438 | 5447 |
5439 #endif // V8_TARGET_ARCH_IA32 | 5448 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |