OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 // Change context eagerly in case we need the global receiver. | 593 // Change context eagerly in case we need the global receiver. |
594 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 594 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
595 | 595 |
596 // Do not transform the receiver for strict mode functions. | 596 // Do not transform the receiver for strict mode functions. |
597 __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 597 __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
598 __ test_b(FieldOperand(ebx, SharedFunctionInfo::kStrictModeByteOffset), | 598 __ test_b(FieldOperand(ebx, SharedFunctionInfo::kStrictModeByteOffset), |
599 1 << SharedFunctionInfo::kStrictModeBitWithinByte); | 599 1 << SharedFunctionInfo::kStrictModeBitWithinByte); |
600 __ j(not_equal, &shift_arguments); | 600 __ j(not_equal, &shift_arguments); |
601 | 601 |
602 // Do not transform the receiver for natives (shared already in ebx). | 602 // Do not transform the receiver for natives (shared already in ebx). |
603 __ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kScriptOffset)); | 603 __ test_b(FieldOperand(ebx, SharedFunctionInfo::kES5NativeByteOffset), |
604 __ cmp(ebx, factory->undefined_value()); | 604 1 << SharedFunctionInfo::kES5NativeBitWithinByte); |
605 __ j(equal, &shift_arguments); | 605 __ j(not_equal, &shift_arguments); |
606 __ mov(ebx, FieldOperand(ebx, Script::kTypeOffset)); | |
607 __ SmiUntag(ebx); | |
608 __ cmp(ebx, Script::TYPE_NATIVE); | |
609 __ j(equal, &shift_arguments); | |
610 | 606 |
611 // Compute the receiver in non-strict mode. | 607 // Compute the receiver in non-strict mode. |
612 __ mov(ebx, Operand(esp, eax, times_4, 0)); // First argument. | 608 __ mov(ebx, Operand(esp, eax, times_4, 0)); // First argument. |
613 __ test(ebx, Immediate(kSmiTagMask)); | 609 __ test(ebx, Immediate(kSmiTagMask)); |
614 __ j(zero, &convert_to_object); | 610 __ j(zero, &convert_to_object); |
615 | 611 |
616 __ cmp(ebx, factory->null_value()); | 612 __ cmp(ebx, factory->null_value()); |
617 __ j(equal, &use_global_receiver); | 613 __ j(equal, &use_global_receiver); |
618 __ cmp(ebx, factory->undefined_value()); | 614 __ cmp(ebx, factory->undefined_value()); |
619 __ j(equal, &use_global_receiver); | 615 __ j(equal, &use_global_receiver); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 | 756 |
761 // Do not transform the receiver for strict mode functions. | 757 // Do not transform the receiver for strict mode functions. |
762 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 758 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
763 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrictModeByteOffset), | 759 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrictModeByteOffset), |
764 1 << SharedFunctionInfo::kStrictModeBitWithinByte); | 760 1 << SharedFunctionInfo::kStrictModeBitWithinByte); |
765 __ j(not_equal, &push_receiver); | 761 __ j(not_equal, &push_receiver); |
766 | 762 |
767 Factory* factory = masm->isolate()->factory(); | 763 Factory* factory = masm->isolate()->factory(); |
768 | 764 |
769 // Do not transform the receiver for natives (shared already in ecx). | 765 // Do not transform the receiver for natives (shared already in ecx). |
770 __ mov(ecx, FieldOperand(ecx, SharedFunctionInfo::kScriptOffset)); | 766 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kES5NativeByteOffset), |
771 __ cmp(ecx, factory->undefined_value()); | 767 1 << SharedFunctionInfo::kES5NativeBitWithinByte); |
772 __ j(equal, &push_receiver); | 768 __ j(not_equal, &push_receiver); |
773 __ mov(ecx, FieldOperand(ecx, Script::kTypeOffset)); | |
774 __ SmiUntag(ecx); | |
775 __ cmp(ecx, Script::TYPE_NATIVE); | |
776 __ j(equal, &push_receiver); | |
777 | 769 |
778 // Compute the receiver in non-strict mode. | 770 // Compute the receiver in non-strict mode. |
779 __ test(ebx, Immediate(kSmiTagMask)); | 771 __ test(ebx, Immediate(kSmiTagMask)); |
780 __ j(zero, &call_to_object); | 772 __ j(zero, &call_to_object); |
781 __ cmp(ebx, factory->null_value()); | 773 __ cmp(ebx, factory->null_value()); |
782 __ j(equal, &use_global_receiver); | 774 __ j(equal, &use_global_receiver); |
783 __ cmp(ebx, factory->undefined_value()); | 775 __ cmp(ebx, factory->undefined_value()); |
784 __ j(equal, &use_global_receiver); | 776 __ j(equal, &use_global_receiver); |
785 | 777 |
786 // If given receiver is already a JavaScript object then there's no | 778 // If given receiver is already a JavaScript object then there's no |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1598 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
1607 generator.Generate(); | 1599 generator.Generate(); |
1608 } | 1600 } |
1609 | 1601 |
1610 | 1602 |
1611 #undef __ | 1603 #undef __ |
1612 } | 1604 } |
1613 } // namespace v8::internal | 1605 } // namespace v8::internal |
1614 | 1606 |
1615 #endif // V8_TARGET_ARCH_IA32 | 1607 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |