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 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2165 value = UseRegister(instr->value()); | 2165 value = UseRegister(instr->value()); |
2166 temp = NULL; | 2166 temp = NULL; |
2167 } | 2167 } |
2168 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp); | 2168 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp); |
2169 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; | 2169 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; |
2170 } | 2170 } |
2171 | 2171 |
2172 | 2172 |
2173 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { | 2173 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
2174 LOperand* obj = UseRegisterAtStart(instr->object()); | 2174 LOperand* obj = UseRegisterAtStart(instr->object()); |
2175 LOperand* temp = instr->representation().IsDouble() ? TempRegister() : NULL; | 2175 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); |
2176 ASSERT(temp == NULL || FLAG_track_double_fields); | |
2177 return DefineAsRegister(new(zone()) LLoadNamedField(obj, temp)); | |
2178 } | 2176 } |
2179 | 2177 |
2180 | 2178 |
2181 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( | 2179 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( |
2182 HLoadNamedFieldPolymorphic* instr) { | 2180 HLoadNamedFieldPolymorphic* instr) { |
2183 ASSERT(instr->representation().IsTagged()); | 2181 ASSERT(instr->representation().IsTagged()); |
2184 if (instr->need_generic()) { | 2182 if (instr->need_generic()) { |
2185 LOperand* context = UseFixed(instr->context(), esi); | 2183 LOperand* context = UseFixed(instr->context(), esi); |
2186 LOperand* obj = UseFixed(instr->object(), edx); | 2184 LOperand* obj = UseFixed(instr->object(), edx); |
2187 LLoadNamedFieldPolymorphic* result = | 2185 LLoadNamedFieldPolymorphic* result = |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2420 HConstant::cast(instr->value())->NotInNewSpace() && | 2418 HConstant::cast(instr->value())->NotInNewSpace() && |
2421 !(FLAG_track_double_fields && instr->field_representation().IsDouble()); | 2419 !(FLAG_track_double_fields && instr->field_representation().IsDouble()); |
2422 | 2420 |
2423 LOperand* val; | 2421 LOperand* val; |
2424 if (needs_write_barrier) { | 2422 if (needs_write_barrier) { |
2425 val = UseTempRegister(instr->value()); | 2423 val = UseTempRegister(instr->value()); |
2426 } else if (can_be_constant) { | 2424 } else if (can_be_constant) { |
2427 val = UseRegisterOrConstant(instr->value()); | 2425 val = UseRegisterOrConstant(instr->value()); |
2428 } else if (FLAG_track_fields && instr->field_representation().IsSmi()) { | 2426 } else if (FLAG_track_fields && instr->field_representation().IsSmi()) { |
2429 val = UseTempRegister(instr->value()); | 2427 val = UseTempRegister(instr->value()); |
| 2428 } else if (FLAG_track_fields && instr->field_representation().IsDouble()) { |
| 2429 val = UseRegisterAtStart(instr->value()); |
2430 } else { | 2430 } else { |
2431 val = UseRegister(instr->value()); | 2431 val = UseRegister(instr->value()); |
2432 } | 2432 } |
2433 | 2433 |
2434 // We only need a scratch register if we have a write barrier or we | 2434 // We only need a scratch register if we have a write barrier or we |
2435 // have a store into the properties array (not in-object-property). | 2435 // have a store into the properties array (not in-object-property). |
2436 LOperand* temp = (!instr->is_in_object() || needs_write_barrier || | 2436 LOperand* temp = |
2437 needs_write_barrier_for_map) ? TempRegister() : NULL; | 2437 (!instr->is_in_object() || needs_write_barrier || |
| 2438 needs_write_barrier_for_map) ? TempRegister() : NULL; |
2438 | 2439 |
2439 // We need a temporary register for write barrier of the map field. | 2440 // We need a temporary register for write barrier of the map field. |
2440 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; | 2441 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; |
2441 | 2442 |
2442 LStoreNamedField* result = | 2443 LStoreNamedField* result = |
2443 new(zone()) LStoreNamedField(obj, val, temp, temp_map); | 2444 new(zone()) LStoreNamedField(obj, val, temp, temp_map); |
2444 if ((FLAG_track_fields && instr->field_representation().IsSmi()) || | 2445 if (FLAG_track_fields && instr->field_representation().IsSmi()) { |
2445 (FLAG_track_double_fields && instr->field_representation().IsDouble())) { | |
2446 return AssignEnvironment(result); | 2446 return AssignEnvironment(result); |
2447 } | 2447 } |
2448 return result; | 2448 return result; |
2449 } | 2449 } |
2450 | 2450 |
2451 | 2451 |
2452 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2452 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
2453 LOperand* context = UseFixed(instr->context(), esi); | 2453 LOperand* context = UseFixed(instr->context(), esi); |
2454 LOperand* object = UseFixed(instr->object(), edx); | 2454 LOperand* object = UseFixed(instr->object(), edx); |
2455 LOperand* value = UseFixed(instr->value(), eax); | 2455 LOperand* value = UseFixed(instr->value(), eax); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2765 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2765 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2766 LOperand* object = UseRegister(instr->object()); | 2766 LOperand* object = UseRegister(instr->object()); |
2767 LOperand* index = UseTempRegister(instr->index()); | 2767 LOperand* index = UseTempRegister(instr->index()); |
2768 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2768 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2769 } | 2769 } |
2770 | 2770 |
2771 | 2771 |
2772 } } // namespace v8::internal | 2772 } } // namespace v8::internal |
2773 | 2773 |
2774 #endif // V8_TARGET_ARCH_IA32 | 2774 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |