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 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 | 1033 |
1034 Result VirtualFrame::CallKeyedStoreIC() { | 1034 Result VirtualFrame::CallKeyedStoreIC() { |
1035 // Value, key, and receiver are on the top of the frame. The IC | 1035 // Value, key, and receiver are on the top of the frame. The IC |
1036 // expects value in eax, key in ecx, and receiver in edx. | 1036 // expects value in eax, key in ecx, and receiver in edx. |
1037 Result value = Pop(); | 1037 Result value = Pop(); |
1038 Result key = Pop(); | 1038 Result key = Pop(); |
1039 Result receiver = Pop(); | 1039 Result receiver = Pop(); |
1040 PrepareForCall(0, 0); | 1040 PrepareForCall(0, 0); |
1041 if (!cgen()->allocator()->is_used(eax) || | 1041 if (!cgen()->allocator()->is_used(eax) || |
1042 (value.is_register() && value.reg().is(eax))) { | 1042 (value.is_register() && value.reg().is(eax))) { |
1043 value.ToRegister(eax); // No effect if value is in eax already. | 1043 if (!cgen()->allocator()->is_used(eax)) { |
| 1044 value.ToRegister(eax); |
| 1045 } |
1044 MoveResultsToRegisters(&key, &receiver, ecx, edx); | 1046 MoveResultsToRegisters(&key, &receiver, ecx, edx); |
1045 value.Unuse(); | 1047 value.Unuse(); |
1046 } else if (!cgen()->allocator()->is_used(ecx) || | 1048 } else if (!cgen()->allocator()->is_used(ecx) || |
1047 (key.is_register() && key.reg().is(ecx))) { | 1049 (key.is_register() && key.reg().is(ecx))) { |
1048 // Receiver and/or key are in eax. | 1050 if (!cgen()->allocator()->is_used(ecx)) { |
1049 key.ToRegister(ecx); | 1051 key.ToRegister(ecx); |
| 1052 } |
1050 MoveResultsToRegisters(&value, &receiver, eax, edx); | 1053 MoveResultsToRegisters(&value, &receiver, eax, edx); |
1051 key.Unuse(); | 1054 key.Unuse(); |
1052 } else if (!cgen()->allocator()->is_used(edx) || | 1055 } else if (!cgen()->allocator()->is_used(edx) || |
1053 (receiver.is_register() && receiver.reg().is(edx))) { | 1056 (receiver.is_register() && receiver.reg().is(edx))) { |
1054 receiver.ToRegister(edx); | 1057 if (!cgen()->allocator()->is_used(edx)) { |
| 1058 receiver.ToRegister(edx); |
| 1059 } |
1055 MoveResultsToRegisters(&key, &value, ecx, eax); | 1060 MoveResultsToRegisters(&key, &value, ecx, eax); |
1056 receiver.Unuse(); | 1061 receiver.Unuse(); |
1057 } else { | 1062 } else { |
1058 // All three registers are used, and no value is in the correct place. | 1063 // All three registers are used, and no value is in the correct place. |
1059 // We have one of the two circular permutations of eax, ecx, edx. | 1064 // We have one of the two circular permutations of eax, ecx, edx. |
1060 ASSERT(value.is_register()); | 1065 ASSERT(value.is_register()); |
1061 if (value.reg().is(ecx)) { | 1066 if (value.reg().is(ecx)) { |
1062 __ xchg(eax, edx); | 1067 __ xchg(eax, edx); |
1063 __ xchg(eax, ecx); | 1068 __ xchg(eax, ecx); |
1064 } else { | 1069 } else { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 return; | 1284 return; |
1280 } | 1285 } |
1281 } | 1286 } |
1282 UNREACHABLE(); | 1287 UNREACHABLE(); |
1283 } | 1288 } |
1284 | 1289 |
1285 | 1290 |
1286 #undef __ | 1291 #undef __ |
1287 | 1292 |
1288 } } // namespace v8::internal | 1293 } } // namespace v8::internal |
OLD | NEW |