| 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_double_fields && |
| 2429 instr->field_representation().IsDouble()) { |
| 2430 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { |
| 2431 val = UseRegisterAtStart(instr->value()); |
| 2432 } else { |
| 2433 val = UseX87TopOfStack(instr->value()); |
| 2434 } |
| 2430 } else { | 2435 } else { |
| 2431 val = UseRegister(instr->value()); | 2436 val = UseRegister(instr->value()); |
| 2432 } | 2437 } |
| 2433 | 2438 |
| 2434 // We only need a scratch register if we have a write barrier or we | 2439 // 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). | 2440 // have a store into the properties array (not in-object-property). |
| 2436 LOperand* temp = (!instr->is_in_object() || needs_write_barrier || | 2441 LOperand* temp = (!instr->is_in_object() || needs_write_barrier || |
| 2437 needs_write_barrier_for_map) ? TempRegister() : NULL; | 2442 needs_write_barrier_for_map) ? TempRegister() : NULL; |
| 2438 | 2443 |
| 2439 // We need a temporary register for write barrier of the map field. | 2444 // We need a temporary register for write barrier of the map field. |
| 2440 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; | 2445 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; |
| 2441 | 2446 |
| 2442 LStoreNamedField* result = | 2447 LStoreNamedField* result = |
| 2443 new(zone()) LStoreNamedField(obj, val, temp, temp_map); | 2448 new(zone()) LStoreNamedField(obj, val, temp, temp_map); |
| 2444 if ((FLAG_track_fields && instr->field_representation().IsSmi()) || | 2449 if (FLAG_track_fields && instr->field_representation().IsSmi()) { |
| 2445 (FLAG_track_double_fields && instr->field_representation().IsDouble())) { | |
| 2446 return AssignEnvironment(result); | 2450 return AssignEnvironment(result); |
| 2447 } | 2451 } |
| 2448 return result; | 2452 return result; |
| 2449 } | 2453 } |
| 2450 | 2454 |
| 2451 | 2455 |
| 2452 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2456 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
| 2453 LOperand* context = UseFixed(instr->context(), esi); | 2457 LOperand* context = UseFixed(instr->context(), esi); |
| 2454 LOperand* object = UseFixed(instr->object(), edx); | 2458 LOperand* object = UseFixed(instr->object(), edx); |
| 2455 LOperand* value = UseFixed(instr->value(), eax); | 2459 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) { | 2769 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2766 LOperand* object = UseRegister(instr->object()); | 2770 LOperand* object = UseRegister(instr->object()); |
| 2767 LOperand* index = UseTempRegister(instr->index()); | 2771 LOperand* index = UseTempRegister(instr->index()); |
| 2768 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2772 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2769 } | 2773 } |
| 2770 | 2774 |
| 2771 | 2775 |
| 2772 } } // namespace v8::internal | 2776 } } // namespace v8::internal |
| 2773 | 2777 |
| 2774 #endif // V8_TARGET_ARCH_IA32 | 2778 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |