| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 | 160 |
| 161 // One byte opcode for test eax,0xXXXXXXXX. | 161 // One byte opcode for test eax,0xXXXXXXXX. |
| 162 static const byte kTestEaxByte = 0xA9; | 162 static const byte kTestEaxByte = 0xA9; |
| 163 | 163 |
| 164 | 164 |
| 165 static bool PatchInlinedMapCheck(Address address, Object* map) { | 165 static bool PatchInlinedMapCheck(Address address, Object* map) { |
| 166 // Arguments are address of start of call sequence that called | 166 // Arguments are address of start of call sequence that called |
| 167 // the IC, | 167 // the IC, |
| 168 Address test_instruction_address = | 168 Address test_instruction_address = |
| 169 address + Assembler::kPatchReturnSequenceLength; | 169 address + Assembler::kCallTargetAddressOffset; |
| 170 // The keyed load has a fast inlined case if the IC call instruction | 170 // The keyed load has a fast inlined case if the IC call instruction |
| 171 // is immediately followed by a test instruction. | 171 // is immediately followed by a test instruction. |
| 172 if (*test_instruction_address != kTestEaxByte) return false; | 172 if (*test_instruction_address != kTestEaxByte) return false; |
| 173 | 173 |
| 174 // Fetch the offset from the test instruction to the map compare | 174 // Fetch the offset from the test instruction to the map compare |
| 175 // instructions (starting with the 64-bit immediate mov of the map | 175 // instructions (starting with the 64-bit immediate mov of the map |
| 176 // address). This offset is stored in the last 4 bytes of the 5 | 176 // address). This offset is stored in the last 4 bytes of the 5 |
| 177 // byte test instruction. | 177 // byte test instruction. |
| 178 Address delta_address = test_instruction_address + 1; | 178 Address delta_address = test_instruction_address + 1; |
| 179 int delta = *reinterpret_cast<int*>(delta_address); | 179 int delta = *reinterpret_cast<int*>(delta_address); |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 StubCompiler::GenerateLoadStringLength(masm, rax, rdx, &miss); | 884 StubCompiler::GenerateLoadStringLength(masm, rax, rdx, &miss); |
| 885 __ bind(&miss); | 885 __ bind(&miss); |
| 886 StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC); | 886 StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC); |
| 887 } | 887 } |
| 888 | 888 |
| 889 | 889 |
| 890 | 890 |
| 891 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { | 891 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { |
| 892 // The address of the instruction following the call. | 892 // The address of the instruction following the call. |
| 893 Address test_instruction_address = | 893 Address test_instruction_address = |
| 894 address + Assembler::kPatchReturnSequenceLength; | 894 address + Assembler::kCallTargetAddressOffset; |
| 895 // If the instruction following the call is not a test eax, nothing | 895 // If the instruction following the call is not a test eax, nothing |
| 896 // was inlined. | 896 // was inlined. |
| 897 if (*test_instruction_address != kTestEaxByte) return false; | 897 if (*test_instruction_address != kTestEaxByte) return false; |
| 898 | 898 |
| 899 Address delta_address = test_instruction_address + 1; | 899 Address delta_address = test_instruction_address + 1; |
| 900 // The delta to the start of the map check instruction. | 900 // The delta to the start of the map check instruction. |
| 901 int delta = *reinterpret_cast<int*>(delta_address); | 901 int delta = *reinterpret_cast<int*>(delta_address); |
| 902 | 902 |
| 903 // The map address is the last 8 bytes of the 10-byte | 903 // The map address is the last 8 bytes of the 10-byte |
| 904 // immediate move instruction, so we add 2 to get the | 904 // immediate move instruction, so we add 2 to get the |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 | 968 |
| 969 // Cache miss: Jump to runtime. | 969 // Cache miss: Jump to runtime. |
| 970 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); | 970 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); |
| 971 } | 971 } |
| 972 | 972 |
| 973 | 973 |
| 974 #undef __ | 974 #undef __ |
| 975 | 975 |
| 976 | 976 |
| 977 } } // namespace v8::internal | 977 } } // namespace v8::internal |
| OLD | NEW |