| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); | 582 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
| 583 __ j(not_equal, &non_function, not_taken); | 583 __ j(not_equal, &non_function, not_taken); |
| 584 | 584 |
| 585 | 585 |
| 586 // 3a. Patch the first argument if necessary when calling a function. | 586 // 3a. Patch the first argument if necessary when calling a function. |
| 587 Label shift_arguments; | 587 Label shift_arguments; |
| 588 { Label convert_to_object, use_global_receiver, patch_receiver; | 588 { Label convert_to_object, use_global_receiver, patch_receiver; |
| 589 // Change context eagerly in case we need the global receiver. | 589 // Change context eagerly in case we need the global receiver. |
| 590 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 590 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
| 591 | 591 |
| 592 // Do not transform the receiver for strict mode functions. |
| 593 __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
| 594 __ test_b(FieldOperand(ebx, SharedFunctionInfo::kStrictModeByteOffset), |
| 595 1 << SharedFunctionInfo::kStrictModeBitWithinByte); |
| 596 __ j(not_equal, &shift_arguments); |
| 597 |
| 598 // Compute the receiver in non-strict mode. |
| 592 __ mov(ebx, Operand(esp, eax, times_4, 0)); // First argument. | 599 __ mov(ebx, Operand(esp, eax, times_4, 0)); // First argument. |
| 593 __ test(ebx, Immediate(kSmiTagMask)); | 600 __ test(ebx, Immediate(kSmiTagMask)); |
| 594 __ j(zero, &convert_to_object); | 601 __ j(zero, &convert_to_object); |
| 595 | 602 |
| 596 __ cmp(ebx, Factory::null_value()); | 603 __ cmp(ebx, Factory::null_value()); |
| 597 __ j(equal, &use_global_receiver); | 604 __ j(equal, &use_global_receiver); |
| 598 __ cmp(ebx, Factory::undefined_value()); | 605 __ cmp(ebx, Factory::undefined_value()); |
| 599 __ j(equal, &use_global_receiver); | 606 __ j(equal, &use_global_receiver); |
| 600 | 607 |
| 601 // We don't use IsObjectJSObjectType here because we jump on success. | 608 // We don't use IsObjectJSObjectType here because we jump on success. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 __ push(Immediate(0)); // index | 736 __ push(Immediate(0)); // index |
| 730 | 737 |
| 731 // Change context eagerly to get the right global object if | 738 // Change context eagerly to get the right global object if |
| 732 // necessary. | 739 // necessary. |
| 733 __ mov(edi, Operand(ebp, 4 * kPointerSize)); | 740 __ mov(edi, Operand(ebp, 4 * kPointerSize)); |
| 734 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 741 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
| 735 | 742 |
| 736 // Compute the receiver. | 743 // Compute the receiver. |
| 737 Label call_to_object, use_global_receiver, push_receiver; | 744 Label call_to_object, use_global_receiver, push_receiver; |
| 738 __ mov(ebx, Operand(ebp, 3 * kPointerSize)); | 745 __ mov(ebx, Operand(ebp, 3 * kPointerSize)); |
| 746 |
| 747 // Do not transform the receiver for strict mode functions. |
| 748 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
| 749 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrictModeByteOffset), |
| 750 1 << SharedFunctionInfo::kStrictModeBitWithinByte); |
| 751 __ j(not_equal, &push_receiver); |
| 752 |
| 753 // Compute the receiver in non-strict mode. |
| 739 __ test(ebx, Immediate(kSmiTagMask)); | 754 __ test(ebx, Immediate(kSmiTagMask)); |
| 740 __ j(zero, &call_to_object); | 755 __ j(zero, &call_to_object); |
| 741 __ cmp(ebx, Factory::null_value()); | 756 __ cmp(ebx, Factory::null_value()); |
| 742 __ j(equal, &use_global_receiver); | 757 __ j(equal, &use_global_receiver); |
| 743 __ cmp(ebx, Factory::undefined_value()); | 758 __ cmp(ebx, Factory::undefined_value()); |
| 744 __ j(equal, &use_global_receiver); | 759 __ j(equal, &use_global_receiver); |
| 745 | 760 |
| 746 // If given receiver is already a JavaScript object then there's no | 761 // If given receiver is already a JavaScript object then there's no |
| 747 // reason for converting it. | 762 // reason for converting it. |
| 748 // We don't use IsObjectJSObjectType here because we jump on success. | 763 // We don't use IsObjectJSObjectType here because we jump on success. |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1581 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
| 1567 generator.Generate(); | 1582 generator.Generate(); |
| 1568 } | 1583 } |
| 1569 | 1584 |
| 1570 | 1585 |
| 1571 #undef __ | 1586 #undef __ |
| 1572 | 1587 |
| 1573 } } // namespace v8::internal | 1588 } } // namespace v8::internal |
| 1574 | 1589 |
| 1575 #endif // V8_TARGET_ARCH_IA32 | 1590 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |