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 7085034: Reapply change to Pass undefined to JS builtins when called with (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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') | src/x64/full-codegen-x64.cc » ('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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); 668 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
669 669
670 // Do not transform the receiver for strict mode functions. 670 // Do not transform the receiver for strict mode functions.
671 __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); 671 __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
672 __ testb(FieldOperand(rbx, SharedFunctionInfo::kStrictModeByteOffset), 672 __ testb(FieldOperand(rbx, SharedFunctionInfo::kStrictModeByteOffset),
673 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); 673 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte));
674 __ j(not_equal, &shift_arguments); 674 __ j(not_equal, &shift_arguments);
675 675
676 // Do not transform the receiver for natives. 676 // Do not transform the receiver for natives.
677 // SharedFunctionInfo is already loaded into rbx. 677 // SharedFunctionInfo is already loaded into rbx.
678 __ testb(FieldOperand(rbx, SharedFunctionInfo::kES5NativeByteOffset), 678 __ testb(FieldOperand(rbx, SharedFunctionInfo::kNativeByteOffset),
679 Immediate(1 << SharedFunctionInfo::kES5NativeBitWithinByte)); 679 Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte));
680 __ j(not_zero, &shift_arguments); 680 __ j(not_zero, &shift_arguments);
681 681
682 // Compute the receiver in non-strict mode. 682 // Compute the receiver in non-strict mode.
683 __ movq(rbx, Operand(rsp, rax, times_pointer_size, 0)); 683 __ movq(rbx, Operand(rsp, rax, times_pointer_size, 0));
684 __ JumpIfSmi(rbx, &convert_to_object, Label::kNear); 684 __ JumpIfSmi(rbx, &convert_to_object, Label::kNear);
685 685
686 __ CompareRoot(rbx, Heap::kNullValueRootIndex); 686 __ CompareRoot(rbx, Heap::kNullValueRootIndex);
687 __ j(equal, &use_global_receiver); 687 __ j(equal, &use_global_receiver);
688 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); 688 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex);
689 __ j(equal, &use_global_receiver); 689 __ j(equal, &use_global_receiver);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 Label call_to_object, use_global_receiver, push_receiver; 840 Label call_to_object, use_global_receiver, push_receiver;
841 __ movq(rbx, Operand(rbp, kReceiverOffset)); 841 __ movq(rbx, Operand(rbp, kReceiverOffset));
842 842
843 // Do not transform the receiver for strict mode functions. 843 // Do not transform the receiver for strict mode functions.
844 __ movq(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); 844 __ movq(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
845 __ testb(FieldOperand(rdx, SharedFunctionInfo::kStrictModeByteOffset), 845 __ testb(FieldOperand(rdx, SharedFunctionInfo::kStrictModeByteOffset),
846 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); 846 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte));
847 __ j(not_equal, &push_receiver); 847 __ j(not_equal, &push_receiver);
848 848
849 // Do not transform the receiver for natives. 849 // Do not transform the receiver for natives.
850 __ testb(FieldOperand(rdx, SharedFunctionInfo::kES5NativeByteOffset), 850 __ testb(FieldOperand(rdx, SharedFunctionInfo::kNativeByteOffset),
851 Immediate(1 << SharedFunctionInfo::kES5NativeBitWithinByte)); 851 Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte));
852 __ j(not_zero, &push_receiver); 852 __ j(not_zero, &push_receiver);
853 853
854 // Compute the receiver in non-strict mode. 854 // Compute the receiver in non-strict mode.
855 __ JumpIfSmi(rbx, &call_to_object, Label::kNear); 855 __ JumpIfSmi(rbx, &call_to_object, Label::kNear);
856 __ CompareRoot(rbx, Heap::kNullValueRootIndex); 856 __ CompareRoot(rbx, Heap::kNullValueRootIndex);
857 __ j(equal, &use_global_receiver); 857 __ j(equal, &use_global_receiver);
858 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex); 858 __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex);
859 __ j(equal, &use_global_receiver); 859 __ j(equal, &use_global_receiver);
860 860
861 // If given receiver is already a JavaScript object then there's no 861 // If given receiver is already a JavaScript object then there's no
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); 1515 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR);
1516 generator.Generate(); 1516 generator.Generate();
1517 } 1517 }
1518 1518
1519 1519
1520 #undef __ 1520 #undef __
1521 1521
1522 } } // namespace v8::internal 1522 } } // namespace v8::internal
1523 1523
1524 #endif // V8_TARGET_ARCH_X64 1524 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/v8natives.js ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698