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

Side by Side Diff: src/ia32/builtins-ia32.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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); 730 __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
731 __ test_b(FieldOperand(ebx, SharedFunctionInfo::kStrictModeByteOffset), 731 __ test_b(FieldOperand(ebx, SharedFunctionInfo::kStrictModeByteOffset),
732 1 << SharedFunctionInfo::kStrictModeBitWithinByte); 732 1 << SharedFunctionInfo::kStrictModeBitWithinByte);
733 __ j(not_equal, &shift_arguments); 733 __ j(not_equal, &shift_arguments);
734 734
735 // Do not transform the receiver for natives (shared already in ebx). 735 // Do not transform the receiver for natives (shared already in ebx).
736 __ test_b(FieldOperand(ebx, SharedFunctionInfo::kNativeByteOffset), 736 __ test_b(FieldOperand(ebx, SharedFunctionInfo::kNativeByteOffset),
737 1 << SharedFunctionInfo::kNativeBitWithinByte); 737 1 << SharedFunctionInfo::kNativeBitWithinByte);
738 __ j(not_equal, &shift_arguments); 738 __ j(not_equal, &shift_arguments);
739 739
740 // Compute the receiver in non-strict mode. 740 // Compute the receiver in sloppy mode.
741 __ mov(ebx, Operand(esp, eax, times_4, 0)); // First argument. 741 __ mov(ebx, Operand(esp, eax, times_4, 0)); // First argument.
742 742
743 // Call ToObject on the receiver if it is not an object, or use the 743 // Call ToObject on the receiver if it is not an object, or use the
744 // global object if it is null or undefined. 744 // global object if it is null or undefined.
745 __ JumpIfSmi(ebx, &convert_to_object); 745 __ JumpIfSmi(ebx, &convert_to_object);
746 __ cmp(ebx, factory->null_value()); 746 __ cmp(ebx, factory->null_value());
747 __ j(equal, &use_global_receiver); 747 __ j(equal, &use_global_receiver);
748 __ cmp(ebx, factory->undefined_value()); 748 __ cmp(ebx, factory->undefined_value());
749 __ j(equal, &use_global_receiver); 749 __ j(equal, &use_global_receiver);
750 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); 750 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 1 << SharedFunctionInfo::kStrictModeBitWithinByte); 916 1 << SharedFunctionInfo::kStrictModeBitWithinByte);
917 __ j(not_equal, &push_receiver); 917 __ j(not_equal, &push_receiver);
918 918
919 Factory* factory = masm->isolate()->factory(); 919 Factory* factory = masm->isolate()->factory();
920 920
921 // Do not transform the receiver for natives (shared already in ecx). 921 // Do not transform the receiver for natives (shared already in ecx).
922 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kNativeByteOffset), 922 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kNativeByteOffset),
923 1 << SharedFunctionInfo::kNativeBitWithinByte); 923 1 << SharedFunctionInfo::kNativeBitWithinByte);
924 __ j(not_equal, &push_receiver); 924 __ j(not_equal, &push_receiver);
925 925
926 // Compute the receiver in non-strict mode. 926 // Compute the receiver in sloppy mode.
927 // Call ToObject on the receiver if it is not an object, or use the 927 // Call ToObject on the receiver if it is not an object, or use the
928 // global object if it is null or undefined. 928 // global object if it is null or undefined.
929 __ JumpIfSmi(ebx, &call_to_object); 929 __ JumpIfSmi(ebx, &call_to_object);
930 __ cmp(ebx, factory->null_value()); 930 __ cmp(ebx, factory->null_value());
931 __ j(equal, &use_global_receiver); 931 __ j(equal, &use_global_receiver);
932 __ cmp(ebx, factory->undefined_value()); 932 __ cmp(ebx, factory->undefined_value());
933 __ j(equal, &use_global_receiver); 933 __ j(equal, &use_global_receiver);
934 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); 934 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
935 __ CmpObjectType(ebx, FIRST_SPEC_OBJECT_TYPE, ecx); 935 __ CmpObjectType(ebx, FIRST_SPEC_OBJECT_TYPE, ecx);
936 __ j(above_equal, &push_receiver); 936 __ j(above_equal, &push_receiver);
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 1365
1366 __ bind(&ok); 1366 __ bind(&ok);
1367 __ ret(0); 1367 __ ret(0);
1368 } 1368 }
1369 1369
1370 #undef __ 1370 #undef __
1371 } 1371 }
1372 } // namespace v8::internal 1372 } // namespace v8::internal
1373 1373
1374 #endif // V8_TARGET_ARCH_IA32 1374 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698