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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); | 653 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); |
654 | 654 |
655 // Do not transform the receiver for strict mode functions. | 655 // Do not transform the receiver for strict mode functions. |
656 __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); | 656 __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); |
657 __ testb(FieldOperand(rbx, SharedFunctionInfo::kStrictModeByteOffset), | 657 __ testb(FieldOperand(rbx, SharedFunctionInfo::kStrictModeByteOffset), |
658 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); | 658 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); |
659 __ j(not_equal, &shift_arguments); | 659 __ j(not_equal, &shift_arguments); |
660 | 660 |
661 // Do not transform the receiver for natives. | 661 // Do not transform the receiver for natives. |
662 // SharedFunctionInfo is already loaded into rbx. | 662 // SharedFunctionInfo is already loaded into rbx. |
663 __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kScriptOffset)); | 663 __ testb(FieldOperand(rbx, SharedFunctionInfo::kES5NativeByteOffset), |
664 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); | 664 Immediate(1 << SharedFunctionInfo::kES5NativeBitWithinByte)); |
665 __ j(equal, &shift_arguments); | 665 __ j(not_zero, &shift_arguments); |
666 __ SmiCompare(FieldOperand(rbx, Script::kTypeOffset), | |
667 Smi::FromInt(Script::TYPE_NATIVE)); | |
668 __ j(equal, &shift_arguments); | |
669 | 666 |
670 // Compute the receiver in non-strict mode. | 667 // Compute the receiver in non-strict mode. |
671 __ movq(rbx, Operand(rsp, rax, times_pointer_size, 0)); | 668 __ movq(rbx, Operand(rsp, rax, times_pointer_size, 0)); |
672 __ JumpIfSmi(rbx, &convert_to_object); | 669 __ JumpIfSmi(rbx, &convert_to_object); |
673 | 670 |
674 __ CompareRoot(rbx, Heap::kNullValueRootIndex); | 671 __ CompareRoot(rbx, Heap::kNullValueRootIndex); |
675 __ j(equal, &use_global_receiver); | 672 __ j(equal, &use_global_receiver); |
676 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); | 673 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); |
677 __ j(equal, &use_global_receiver); | 674 __ j(equal, &use_global_receiver); |
678 | 675 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 Label call_to_object, use_global_receiver, push_receiver; | 822 Label call_to_object, use_global_receiver, push_receiver; |
826 __ movq(rbx, Operand(rbp, kReceiverOffset)); | 823 __ movq(rbx, Operand(rbp, kReceiverOffset)); |
827 | 824 |
828 // Do not transform the receiver for strict mode functions. | 825 // Do not transform the receiver for strict mode functions. |
829 __ movq(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); | 826 __ movq(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); |
830 __ testb(FieldOperand(rdx, SharedFunctionInfo::kStrictModeByteOffset), | 827 __ testb(FieldOperand(rdx, SharedFunctionInfo::kStrictModeByteOffset), |
831 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); | 828 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); |
832 __ j(not_equal, &push_receiver); | 829 __ j(not_equal, &push_receiver); |
833 | 830 |
834 // Do not transform the receiver for natives. | 831 // Do not transform the receiver for natives. |
835 // SharedFunctionInfo is already loaded into rdx. | 832 __ testb(FieldOperand(rdx, SharedFunctionInfo::kES5NativeByteOffset), |
836 __ movq(rdx, FieldOperand(rdx, SharedFunctionInfo::kScriptOffset)); | 833 Immediate(1 << SharedFunctionInfo::kES5NativeBitWithinByte)); |
837 __ CompareRoot(rdx, Heap::kUndefinedValueRootIndex); | 834 __ j(not_zero, &push_receiver); |
838 __ j(equal, &push_receiver); | |
839 __ SmiCompare(FieldOperand(rdx, Script::kTypeOffset), | |
840 Smi::FromInt(Script::TYPE_NATIVE)); | |
841 __ j(equal, &push_receiver); | |
842 | 835 |
843 // Compute the receiver in non-strict mode. | 836 // Compute the receiver in non-strict mode. |
844 __ JumpIfSmi(rbx, &call_to_object); | 837 __ JumpIfSmi(rbx, &call_to_object); |
845 __ CompareRoot(rbx, Heap::kNullValueRootIndex); | 838 __ CompareRoot(rbx, Heap::kNullValueRootIndex); |
846 __ j(equal, &use_global_receiver); | 839 __ j(equal, &use_global_receiver); |
847 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); | 840 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); |
848 __ j(equal, &use_global_receiver); | 841 __ j(equal, &use_global_receiver); |
849 | 842 |
850 // If given receiver is already a JavaScript object then there's no | 843 // If given receiver is already a JavaScript object then there's no |
851 // reason for converting it. | 844 // reason for converting it. |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1495 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
1503 generator.Generate(); | 1496 generator.Generate(); |
1504 } | 1497 } |
1505 | 1498 |
1506 | 1499 |
1507 #undef __ | 1500 #undef __ |
1508 | 1501 |
1509 } } // namespace v8::internal | 1502 } } // namespace v8::internal |
1510 | 1503 |
1511 #endif // V8_TARGET_ARCH_X64 | 1504 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |