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

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

Issue 177683002: Mode clean-up pt 1: rename classic/non-strict mode to sloppy mode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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
OLDNEW
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
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
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
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
OLDNEW
« src/preparser.h ('K') | « src/variables.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698