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 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2159 } else { | 2159 } else { |
2160 value = UseRegister(instr->value()); | 2160 value = UseRegister(instr->value()); |
2161 temp = NULL; | 2161 temp = NULL; |
2162 } | 2162 } |
2163 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp); | 2163 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp); |
2164 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; | 2164 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; |
2165 } | 2165 } |
2166 | 2166 |
2167 | 2167 |
2168 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { | 2168 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
2169 ASSERT(instr->representation().IsTagged()); | |
2170 LOperand* obj = UseRegisterAtStart(instr->object()); | 2169 LOperand* obj = UseRegisterAtStart(instr->object()); |
2171 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); | 2170 LOperand* temp = instr->representation().IsDouble() ? TempRegister() : NULL; |
| 2171 ASSERT(temp == NULL || FLAG_track_double_fields); |
| 2172 return DefineAsRegister(new(zone()) LLoadNamedField(obj, temp)); |
2172 } | 2173 } |
2173 | 2174 |
2174 | 2175 |
2175 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( | 2176 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( |
2176 HLoadNamedFieldPolymorphic* instr) { | 2177 HLoadNamedFieldPolymorphic* instr) { |
2177 ASSERT(instr->representation().IsTagged()); | 2178 ASSERT(instr->representation().IsTagged()); |
2178 if (instr->need_generic()) { | 2179 if (instr->need_generic()) { |
2179 LOperand* context = UseFixed(instr->context(), esi); | 2180 LOperand* context = UseFixed(instr->context(), esi); |
2180 LOperand* obj = UseFixed(instr->object(), edx); | 2181 LOperand* obj = UseFixed(instr->object(), edx); |
2181 LLoadNamedFieldPolymorphic* result = | 2182 LLoadNamedFieldPolymorphic* result = |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2436 obj = needs_write_barrier_for_map | 2437 obj = needs_write_barrier_for_map |
2437 ? UseRegister(instr->object()) | 2438 ? UseRegister(instr->object()) |
2438 : UseRegisterAtStart(instr->object()); | 2439 : UseRegisterAtStart(instr->object()); |
2439 } | 2440 } |
2440 | 2441 |
2441 LOperand* val; | 2442 LOperand* val; |
2442 if (needs_write_barrier) { | 2443 if (needs_write_barrier) { |
2443 val = UseTempRegister(instr->value()); | 2444 val = UseTempRegister(instr->value()); |
2444 } else if (StoreConstantValueAllowed(instr->value())) { | 2445 } else if (StoreConstantValueAllowed(instr->value())) { |
2445 val = UseRegisterOrConstant(instr->value()); | 2446 val = UseRegisterOrConstant(instr->value()); |
| 2447 } else if (FLAG_track_fields && instr->field_representation().IsSmi()) { |
| 2448 val = UseTempRegister(instr->value()); |
2446 } else { | 2449 } else { |
2447 val = UseRegister(instr->value()); | 2450 val = UseRegister(instr->value()); |
2448 } | 2451 } |
2449 | 2452 |
2450 // We only need a scratch register if we have a write barrier or we | 2453 // We only need a scratch register if we have a write barrier or we |
2451 // have a store into the properties array (not in-object-property). | 2454 // have a store into the properties array (not in-object-property). |
2452 LOperand* temp = (!instr->is_in_object() || needs_write_barrier || | 2455 LOperand* temp = (!instr->is_in_object() || needs_write_barrier || |
2453 needs_write_barrier_for_map) ? TempRegister() : NULL; | 2456 needs_write_barrier_for_map) ? TempRegister() : NULL; |
2454 | 2457 |
2455 // We need a temporary register for write barrier of the map field. | 2458 // We need a temporary register for write barrier of the map field. |
2456 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; | 2459 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; |
2457 | 2460 |
2458 return new(zone()) LStoreNamedField(obj, val, temp, temp_map); | 2461 LStoreNamedField* result = new(zone()) LStoreNamedField( |
| 2462 obj, val, temp, temp_map, instr->field_representation()); |
| 2463 if ((FLAG_track_fields && instr->field_representation().IsSmi()) || |
| 2464 (FLAG_track_double_fields && instr->field_representation().IsDouble())) { |
| 2465 return AssignEnvironment(result); |
| 2466 } |
| 2467 return result; |
2459 } | 2468 } |
2460 | 2469 |
2461 | 2470 |
2462 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2471 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
2463 LOperand* context = UseFixed(instr->context(), esi); | 2472 LOperand* context = UseFixed(instr->context(), esi); |
2464 LOperand* object = UseFixed(instr->object(), edx); | 2473 LOperand* object = UseFixed(instr->object(), edx); |
2465 LOperand* value = UseFixed(instr->value(), eax); | 2474 LOperand* value = UseFixed(instr->value(), eax); |
2466 | 2475 |
2467 LStoreNamedGeneric* result = | 2476 LStoreNamedGeneric* result = |
2468 new(zone()) LStoreNamedGeneric(context, object, value); | 2477 new(zone()) LStoreNamedGeneric(context, object, value); |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2772 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2781 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2773 LOperand* object = UseRegister(instr->object()); | 2782 LOperand* object = UseRegister(instr->object()); |
2774 LOperand* index = UseTempRegister(instr->index()); | 2783 LOperand* index = UseTempRegister(instr->index()); |
2775 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2784 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2776 } | 2785 } |
2777 | 2786 |
2778 | 2787 |
2779 } } // namespace v8::internal | 2788 } } // namespace v8::internal |
2780 | 2789 |
2781 #endif // V8_TARGET_ARCH_IA32 | 2790 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |