Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: src/x64/builtins-x64.cc

Issue 6928007: Reapply 7763, including arm and x64 variants. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/v8natives.js ('k') | test/es5conform/es5conform.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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.
662 // SharedFunctionInfo is already loaded into rbx.
663 __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kScriptOffset));
664 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex);
665 __ j(equal, &shift_arguments);
666 __ SmiCompare(FieldOperand(rbx, Script::kTypeOffset),
667 Smi::FromInt(Script::TYPE_NATIVE));
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
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.
835 // SharedFunctionInfo is already loaded into rdx.
836 __ movq(rdx, FieldOperand(rdx, SharedFunctionInfo::kScriptOffset));
837 __ CompareRoot(rdx, Heap::kUndefinedValueRootIndex);
838 __ j(equal, &push_receiver);
839 __ SmiCompare(FieldOperand(rdx, Script::kTypeOffset),
840 Smi::FromInt(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
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
OLDNEW
« no previous file with comments | « src/v8natives.js ('k') | test/es5conform/es5conform.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698