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

Side by Side Diff: src/ia32/ic-ia32.cc

Issue 160272: X64: Added inline keyed load/store and a bunch of other missing functions. (Closed)
Patch Set: Addressed review comments, and fixed bugs introduced by updating. Created 11 years, 4 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
« no previous file with comments | « no previous file | src/ic.h » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 832
833 void KeyedStoreIC::RestoreInlinedVersion(Address address) { 833 void KeyedStoreIC::RestoreInlinedVersion(Address address) {
834 // Restore the fast-case elements map check so that the inlined 834 // Restore the fast-case elements map check so that the inlined
835 // version can be used again. 835 // version can be used again.
836 PatchInlinedStore(address, Heap::fixed_array_map()); 836 PatchInlinedStore(address, Heap::fixed_array_map());
837 } 837 }
838 838
839 839
840 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { 840 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
841 // The address of the instruction following the call. 841 // The address of the instruction following the call.
842 Address test_instruction_address = address + 4; 842 Address test_instruction_address =
843 address + Assembler::kTargetAddrToReturnAddrDist;
843 // If the instruction following the call is not a test eax, nothing 844 // If the instruction following the call is not a test eax, nothing
844 // was inlined. 845 // was inlined.
845 if (*test_instruction_address != kTestEaxByte) return false; 846 if (*test_instruction_address != kTestEaxByte) return false;
846 847
847 Address delta_address = test_instruction_address + 1; 848 Address delta_address = test_instruction_address + 1;
848 // The delta to the start of the map check instruction. 849 // The delta to the start of the map check instruction.
849 int delta = *reinterpret_cast<int*>(delta_address); 850 int delta = *reinterpret_cast<int*>(delta_address);
850 851
851 // The map address is the last 4 bytes of the 7-byte 852 // The map address is the last 4 bytes of the 7-byte
852 // operand-immediate compare instruction, so we add 3 to get the 853 // operand-immediate compare instruction, so we add 3 to get the
853 // offset to the last 4 bytes. 854 // offset to the last 4 bytes.
854 Address map_address = test_instruction_address + delta + 3; 855 Address map_address = test_instruction_address + delta + 3;
855 *(reinterpret_cast<Object**>(map_address)) = map; 856 *(reinterpret_cast<Object**>(map_address)) = map;
856 857
857 // The offset is in the last 4 bytes of a six byte 858 // The offset is in the last 4 bytes of a six byte
858 // memory-to-register move instruction, so we add 2 to get the 859 // memory-to-register move instruction, so we add 2 to get the
859 // offset to the last 4 bytes. 860 // offset to the last 4 bytes.
860 Address offset_address = 861 Address offset_address =
861 test_instruction_address + delta + kOffsetToLoadInstruction + 2; 862 test_instruction_address + delta + kOffsetToLoadInstruction + 2;
862 *reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag; 863 *reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag;
863 return true; 864 return true;
864 } 865 }
865 866
866 867
867 static bool PatchInlinedMapCheck(Address address, Object* map) { 868 static bool PatchInlinedMapCheck(Address address, Object* map) {
868 Address test_instruction_address = address + 4; // 4 = stub address 869 Address test_instruction_address =
870 address + Assembler::kTargetAddrToReturnAddrDist;
869 // The keyed load has a fast inlined case if the IC call instruction 871 // The keyed load has a fast inlined case if the IC call instruction
870 // is immediately followed by a test instruction. 872 // is immediately followed by a test instruction.
871 if (*test_instruction_address != kTestEaxByte) return false; 873 if (*test_instruction_address != kTestEaxByte) return false;
872 874
873 // Fetch the offset from the test instruction to the map cmp 875 // Fetch the offset from the test instruction to the map cmp
874 // instruction. This offset is stored in the last 4 bytes of the 5 876 // instruction. This offset is stored in the last 4 bytes of the 5
875 // byte test instruction. 877 // byte test instruction.
876 Address delta_address = test_instruction_address + 1; 878 Address delta_address = test_instruction_address + 1;
877 int delta = *reinterpret_cast<int*>(delta_address); 879 int delta = *reinterpret_cast<int*>(delta_address);
878 // Compute the map address. The map address is in the last 4 bytes 880 // Compute the map address. The map address is in the last 4 bytes
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 1032
1031 // Do tail-call to runtime routine. 1033 // Do tail-call to runtime routine.
1032 __ TailCallRuntime( 1034 __ TailCallRuntime(
1033 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); 1035 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3);
1034 } 1036 }
1035 1037
1036 #undef __ 1038 #undef __
1037 1039
1038 1040
1039 } } // namespace v8::internal 1041 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698