OLD | NEW |
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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 // Check that the object is some kind of JSObject. | 845 // Check that the object is some kind of JSObject. |
846 __ CmpObjectType(object, FIRST_JS_RECEIVER_TYPE, scratch1); | 846 __ CmpObjectType(object, FIRST_JS_RECEIVER_TYPE, scratch1); |
847 __ j(below, slow_case); | 847 __ j(below, slow_case); |
848 | 848 |
849 // Check that the key is a positive smi. | 849 // Check that the key is a positive smi. |
850 Condition check = masm->CheckNonNegativeSmi(key); | 850 Condition check = masm->CheckNonNegativeSmi(key); |
851 __ j(NegateCondition(check), slow_case); | 851 __ j(NegateCondition(check), slow_case); |
852 | 852 |
853 // Load the elements into scratch1 and check its map. If not, jump | 853 // Load the elements into scratch1 and check its map. If not, jump |
854 // to the unmapped lookup with the parameter map in scratch1. | 854 // to the unmapped lookup with the parameter map in scratch1. |
855 Handle<Map> arguments_map(heap->non_strict_arguments_elements_map()); | 855 Handle<Map> arguments_map(heap->sloppy_arguments_elements_map()); |
856 __ movp(scratch1, FieldOperand(object, JSObject::kElementsOffset)); | 856 __ movp(scratch1, FieldOperand(object, JSObject::kElementsOffset)); |
857 __ CheckMap(scratch1, arguments_map, slow_case, DONT_DO_SMI_CHECK); | 857 __ CheckMap(scratch1, arguments_map, slow_case, DONT_DO_SMI_CHECK); |
858 | 858 |
859 // Check if element is in the range of mapped arguments. | 859 // Check if element is in the range of mapped arguments. |
860 __ movp(scratch2, FieldOperand(scratch1, FixedArray::kLengthOffset)); | 860 __ movp(scratch2, FieldOperand(scratch1, FixedArray::kLengthOffset)); |
861 __ SmiSubConstant(scratch2, scratch2, Smi::FromInt(2)); | 861 __ SmiSubConstant(scratch2, scratch2, Smi::FromInt(2)); |
862 __ cmpq(key, scratch2); | 862 __ cmpq(key, scratch2); |
863 __ j(greater_equal, unmapped_case); | 863 __ j(greater_equal, unmapped_case); |
864 | 864 |
865 // Load element index and check whether it is the hole. | 865 // Load element index and check whether it is the hole. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 __ cmpq(key, scratch); | 902 __ cmpq(key, scratch); |
903 __ j(greater_equal, slow_case); | 903 __ j(greater_equal, slow_case); |
904 __ SmiToInteger64(scratch, key); | 904 __ SmiToInteger64(scratch, key); |
905 return FieldOperand(backing_store, | 905 return FieldOperand(backing_store, |
906 scratch, | 906 scratch, |
907 times_pointer_size, | 907 times_pointer_size, |
908 FixedArray::kHeaderSize); | 908 FixedArray::kHeaderSize); |
909 } | 909 } |
910 | 910 |
911 | 911 |
912 void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) { | 912 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { |
913 // ----------- S t a t e ------------- | 913 // ----------- S t a t e ------------- |
914 // -- rax : key | 914 // -- rax : key |
915 // -- rdx : receiver | 915 // -- rdx : receiver |
916 // -- rsp[0] : return address | 916 // -- rsp[0] : return address |
917 // ----------------------------------- | 917 // ----------------------------------- |
918 Label slow, notin; | 918 Label slow, notin; |
919 Operand mapped_location = | 919 Operand mapped_location = |
920 GenerateMappedArgumentsLookup( | 920 GenerateMappedArgumentsLookup( |
921 masm, rdx, rax, rbx, rcx, rdi, ¬in, &slow); | 921 masm, rdx, rax, rbx, rcx, rdi, ¬in, &slow); |
922 __ movp(rax, mapped_location); | 922 __ movp(rax, mapped_location); |
923 __ Ret(); | 923 __ Ret(); |
924 __ bind(¬in); | 924 __ bind(¬in); |
925 // The unmapped lookup expects that the parameter map is in rbx. | 925 // The unmapped lookup expects that the parameter map is in rbx. |
926 Operand unmapped_location = | 926 Operand unmapped_location = |
927 GenerateUnmappedArgumentsLookup(masm, rax, rbx, rcx, &slow); | 927 GenerateUnmappedArgumentsLookup(masm, rax, rbx, rcx, &slow); |
928 __ CompareRoot(unmapped_location, Heap::kTheHoleValueRootIndex); | 928 __ CompareRoot(unmapped_location, Heap::kTheHoleValueRootIndex); |
929 __ j(equal, &slow); | 929 __ j(equal, &slow); |
930 __ movp(rax, unmapped_location); | 930 __ movp(rax, unmapped_location); |
931 __ Ret(); | 931 __ Ret(); |
932 __ bind(&slow); | 932 __ bind(&slow); |
933 GenerateMiss(masm); | 933 GenerateMiss(masm); |
934 } | 934 } |
935 | 935 |
936 | 936 |
937 void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) { | 937 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { |
938 // ----------- S t a t e ------------- | 938 // ----------- S t a t e ------------- |
939 // -- rax : value | 939 // -- rax : value |
940 // -- rcx : key | 940 // -- rcx : key |
941 // -- rdx : receiver | 941 // -- rdx : receiver |
942 // -- rsp[0] : return address | 942 // -- rsp[0] : return address |
943 // ----------------------------------- | 943 // ----------------------------------- |
944 Label slow, notin; | 944 Label slow, notin; |
945 Operand mapped_location = GenerateMappedArgumentsLookup( | 945 Operand mapped_location = GenerateMappedArgumentsLookup( |
946 masm, rdx, rcx, rbx, rdi, r8, ¬in, &slow); | 946 masm, rdx, rcx, rbx, rdi, r8, ¬in, &slow); |
947 __ movp(mapped_location, rax); | 947 __ movp(mapped_location, rax); |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 1321 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) |
1322 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1322 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
1323 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1323 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
1324 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1324 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1325 } | 1325 } |
1326 | 1326 |
1327 | 1327 |
1328 } } // namespace v8::internal | 1328 } } // namespace v8::internal |
1329 | 1329 |
1330 #endif // V8_TARGET_ARCH_X64 | 1330 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |