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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 __ testb(FieldOperand(rbx, SharedFunctionInfo::kStrictModeByteOffset), | 792 __ testb(FieldOperand(rbx, SharedFunctionInfo::kStrictModeByteOffset), |
793 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); | 793 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); |
794 __ j(not_equal, &shift_arguments); | 794 __ j(not_equal, &shift_arguments); |
795 | 795 |
796 // Do not transform the receiver for natives. | 796 // Do not transform the receiver for natives. |
797 // SharedFunctionInfo is already loaded into rbx. | 797 // SharedFunctionInfo is already loaded into rbx. |
798 __ testb(FieldOperand(rbx, SharedFunctionInfo::kNativeByteOffset), | 798 __ testb(FieldOperand(rbx, SharedFunctionInfo::kNativeByteOffset), |
799 Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte)); | 799 Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte)); |
800 __ j(not_zero, &shift_arguments); | 800 __ j(not_zero, &shift_arguments); |
801 | 801 |
802 // Compute the receiver in non-strict mode. | 802 // Compute the receiver in sloppy mode. |
803 __ movp(rbx, args.GetArgumentOperand(1)); | 803 __ movp(rbx, args.GetArgumentOperand(1)); |
804 __ JumpIfSmi(rbx, &convert_to_object, Label::kNear); | 804 __ JumpIfSmi(rbx, &convert_to_object, Label::kNear); |
805 | 805 |
806 __ CompareRoot(rbx, Heap::kNullValueRootIndex); | 806 __ CompareRoot(rbx, Heap::kNullValueRootIndex); |
807 __ j(equal, &use_global_receiver); | 807 __ j(equal, &use_global_receiver); |
808 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); | 808 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); |
809 __ j(equal, &use_global_receiver); | 809 __ j(equal, &use_global_receiver); |
810 | 810 |
811 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); | 811 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
812 __ CmpObjectType(rbx, FIRST_SPEC_OBJECT_TYPE, rcx); | 812 __ CmpObjectType(rbx, FIRST_SPEC_OBJECT_TYPE, rcx); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); | 983 __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); |
984 __ testb(FieldOperand(rdx, SharedFunctionInfo::kStrictModeByteOffset), | 984 __ testb(FieldOperand(rdx, SharedFunctionInfo::kStrictModeByteOffset), |
985 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); | 985 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); |
986 __ j(not_equal, &push_receiver); | 986 __ j(not_equal, &push_receiver); |
987 | 987 |
988 // Do not transform the receiver for natives. | 988 // Do not transform the receiver for natives. |
989 __ testb(FieldOperand(rdx, SharedFunctionInfo::kNativeByteOffset), | 989 __ testb(FieldOperand(rdx, SharedFunctionInfo::kNativeByteOffset), |
990 Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte)); | 990 Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte)); |
991 __ j(not_equal, &push_receiver); | 991 __ j(not_equal, &push_receiver); |
992 | 992 |
993 // Compute the receiver in non-strict mode. | 993 // Compute the receiver in sloppy mode. |
994 __ JumpIfSmi(rbx, &call_to_object, Label::kNear); | 994 __ JumpIfSmi(rbx, &call_to_object, Label::kNear); |
995 __ CompareRoot(rbx, Heap::kNullValueRootIndex); | 995 __ CompareRoot(rbx, Heap::kNullValueRootIndex); |
996 __ j(equal, &use_global_receiver); | 996 __ j(equal, &use_global_receiver); |
997 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); | 997 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); |
998 __ j(equal, &use_global_receiver); | 998 __ j(equal, &use_global_receiver); |
999 | 999 |
1000 // If given receiver is already a JavaScript object then there's no | 1000 // If given receiver is already a JavaScript object then there's no |
1001 // reason for converting it. | 1001 // reason for converting it. |
1002 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); | 1002 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
1003 __ CmpObjectType(rbx, FIRST_SPEC_OBJECT_TYPE, rcx); | 1003 __ CmpObjectType(rbx, FIRST_SPEC_OBJECT_TYPE, rcx); |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 __ bind(&ok); | 1434 __ bind(&ok); |
1435 __ ret(0); | 1435 __ ret(0); |
1436 } | 1436 } |
1437 | 1437 |
1438 | 1438 |
1439 #undef __ | 1439 #undef __ |
1440 | 1440 |
1441 } } // namespace v8::internal | 1441 } } // namespace v8::internal |
1442 | 1442 |
1443 #endif // V8_TARGET_ARCH_X64 | 1443 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |