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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
651 { Label convert_to_object, use_global_receiver, patch_receiver; | 651 { Label convert_to_object, use_global_receiver, patch_receiver; |
652 // Change context eagerly in case we need the global receiver. | 652 // Change context eagerly in case we need the global receiver. |
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 (shared already in ebx). | |
Lasse Reichstein
2011/05/04 07:34:08
More verbose comments: (SharedFunctionInfo is alre
| |
662 __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kScriptOffset)); | |
663 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); | |
Lasse Reichstein
2011/05/04 07:34:08
Create a bug for handling non-native functions wit
Rico
2011/05/04 08:42:18
Don issue 1366
| |
664 __ j(equal, &shift_arguments); | |
665 __ movq(rbx, FieldOperand(rbx, Script::kTypeOffset)); | |
666 __ SmiToInteger32(rbx, rbx); | |
Lasse Reichstein
2011/05/04 07:34:08
Use
__ SmiToInteger32(rbx, FieldOperand(rbx, Scr
Rico
2011/05/04 08:42:18
Done.
| |
667 __ cmpq(rbx, Immediate(Script::TYPE_NATIVE)); | |
Lasse Reichstein
2011/05/04 07:34:08
Should have been cmpl.
Rico
2011/05/04 08:42:18
Using SmiCompare instead
| |
668 __ j(equal, &shift_arguments); | |
669 | |
661 // Compute the receiver in non-strict mode. | 670 // Compute the receiver in non-strict mode. |
662 __ movq(rbx, Operand(rsp, rax, times_pointer_size, 0)); | 671 __ movq(rbx, Operand(rsp, rax, times_pointer_size, 0)); |
663 __ JumpIfSmi(rbx, &convert_to_object); | 672 __ JumpIfSmi(rbx, &convert_to_object); |
664 | 673 |
665 __ CompareRoot(rbx, Heap::kNullValueRootIndex); | 674 __ CompareRoot(rbx, Heap::kNullValueRootIndex); |
666 __ j(equal, &use_global_receiver); | 675 __ j(equal, &use_global_receiver); |
667 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); | 676 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); |
668 __ j(equal, &use_global_receiver); | 677 __ j(equal, &use_global_receiver); |
669 | 678 |
670 __ CmpObjectType(rbx, FIRST_JS_OBJECT_TYPE, rcx); | 679 __ CmpObjectType(rbx, FIRST_JS_OBJECT_TYPE, rcx); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
815 // Compute the receiver. | 824 // Compute the receiver. |
816 Label call_to_object, use_global_receiver, push_receiver; | 825 Label call_to_object, use_global_receiver, push_receiver; |
817 __ movq(rbx, Operand(rbp, kReceiverOffset)); | 826 __ movq(rbx, Operand(rbp, kReceiverOffset)); |
818 | 827 |
819 // Do not transform the receiver for strict mode functions. | 828 // Do not transform the receiver for strict mode functions. |
820 __ movq(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); | 829 __ movq(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); |
821 __ testb(FieldOperand(rdx, SharedFunctionInfo::kStrictModeByteOffset), | 830 __ testb(FieldOperand(rdx, SharedFunctionInfo::kStrictModeByteOffset), |
822 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); | 831 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); |
823 __ j(not_equal, &push_receiver); | 832 __ j(not_equal, &push_receiver); |
824 | 833 |
834 // Do not transform the receiver for natives (shared already in rdx). | |
835 __ movq(rdx, FieldOperand(rdx, SharedFunctionInfo::kScriptOffset)); | |
836 __ CompareRoot(rdx, Heap::kUndefinedValueRootIndex); | |
837 __ j(equal, &push_receiver); | |
838 __ movq(rdx, FieldOperand(rdx, Script::kTypeOffset)); | |
839 __ SmiToInteger32(rdx, rdx); | |
840 __ cmpq(rdx, Immediate(Script::TYPE_NATIVE)); | |
841 __ j(equal, &push_receiver); | |
842 | |
825 // Compute the receiver in non-strict mode. | 843 // Compute the receiver in non-strict mode. |
826 __ JumpIfSmi(rbx, &call_to_object); | 844 __ JumpIfSmi(rbx, &call_to_object); |
827 __ CompareRoot(rbx, Heap::kNullValueRootIndex); | 845 __ CompareRoot(rbx, Heap::kNullValueRootIndex); |
828 __ j(equal, &use_global_receiver); | 846 __ j(equal, &use_global_receiver); |
829 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); | 847 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); |
830 __ j(equal, &use_global_receiver); | 848 __ j(equal, &use_global_receiver); |
831 | 849 |
832 // If given receiver is already a JavaScript object then there's no | 850 // If given receiver is already a JavaScript object then there's no |
833 // reason for converting it. | 851 // reason for converting it. |
834 __ CmpObjectType(rbx, FIRST_JS_OBJECT_TYPE, rcx); | 852 __ CmpObjectType(rbx, FIRST_JS_OBJECT_TYPE, rcx); |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1484 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1502 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
1485 generator.Generate(); | 1503 generator.Generate(); |
1486 } | 1504 } |
1487 | 1505 |
1488 | 1506 |
1489 #undef __ | 1507 #undef __ |
1490 | 1508 |
1491 } } // namespace v8::internal | 1509 } } // namespace v8::internal |
1492 | 1510 |
1493 #endif // V8_TARGET_ARCH_X64 | 1511 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |