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

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

Issue 192075: Rename a constant to kCallTargetAddressOffset (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 3 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/ia32/assembler-ia32.h ('k') | 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 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = 842 Address test_instruction_address =
843 address + Assembler::kPatchReturnSequenceLength; 843 address + Assembler::kCallTargetAddressOffset;
844 // 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
845 // was inlined. 845 // was inlined.
846 if (*test_instruction_address != kTestEaxByte) return false; 846 if (*test_instruction_address != kTestEaxByte) return false;
847 847
848 Address delta_address = test_instruction_address + 1; 848 Address delta_address = test_instruction_address + 1;
849 // The delta to the start of the map check instruction. 849 // The delta to the start of the map check instruction.
850 int delta = *reinterpret_cast<int*>(delta_address); 850 int delta = *reinterpret_cast<int*>(delta_address);
851 851
852 // 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
853 // operand-immediate compare instruction, so we add 3 to get the 853 // operand-immediate compare instruction, so we add 3 to get the
854 // offset to the last 4 bytes. 854 // offset to the last 4 bytes.
855 Address map_address = test_instruction_address + delta + 3; 855 Address map_address = test_instruction_address + delta + 3;
856 *(reinterpret_cast<Object**>(map_address)) = map; 856 *(reinterpret_cast<Object**>(map_address)) = map;
857 857
858 // 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
859 // 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
860 // offset to the last 4 bytes. 860 // offset to the last 4 bytes.
861 Address offset_address = 861 Address offset_address =
862 test_instruction_address + delta + kOffsetToLoadInstruction + 2; 862 test_instruction_address + delta + kOffsetToLoadInstruction + 2;
863 *reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag; 863 *reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag;
864 return true; 864 return true;
865 } 865 }
866 866
867 867
868 static bool PatchInlinedMapCheck(Address address, Object* map) { 868 static bool PatchInlinedMapCheck(Address address, Object* map) {
869 Address test_instruction_address = 869 Address test_instruction_address =
870 address + Assembler::kPatchReturnSequenceLength; 870 address + Assembler::kCallTargetAddressOffset;
871 // 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
872 // is immediately followed by a test instruction. 872 // is immediately followed by a test instruction.
873 if (*test_instruction_address != kTestEaxByte) return false; 873 if (*test_instruction_address != kTestEaxByte) return false;
874 874
875 // Fetch the offset from the test instruction to the map cmp 875 // Fetch the offset from the test instruction to the map cmp
876 // 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
877 // byte test instruction. 877 // byte test instruction.
878 Address delta_address = test_instruction_address + 1; 878 Address delta_address = test_instruction_address + 1;
879 int delta = *reinterpret_cast<int*>(delta_address); 879 int delta = *reinterpret_cast<int*>(delta_address);
880 // 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
1032 1032
1033 // Do tail-call to runtime routine. 1033 // Do tail-call to runtime routine.
1034 __ TailCallRuntime( 1034 __ TailCallRuntime(
1035 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1); 1035 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1);
1036 } 1036 }
1037 1037
1038 #undef __ 1038 #undef __
1039 1039
1040 1040
1041 } } // namespace v8::internal 1041 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698