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 2010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2021 value = UseRegister(instr->value()); | 2021 value = UseRegister(instr->value()); |
2022 temp = NULL; | 2022 temp = NULL; |
2023 } | 2023 } |
2024 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp); | 2024 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp); |
2025 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; | 2025 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; |
2026 } | 2026 } |
2027 | 2027 |
2028 | 2028 |
2029 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { | 2029 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
2030 LOperand* obj = UseRegisterAtStart(instr->object()); | 2030 LOperand* obj = UseRegisterAtStart(instr->object()); |
2031 LOperand* temp = instr->representation().IsDouble() ? TempRegister() : NULL; | 2031 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); |
2032 ASSERT(temp == NULL || FLAG_track_double_fields); | |
2033 return DefineAsRegister(new(zone()) LLoadNamedField(obj, temp)); | |
2034 } | 2032 } |
2035 | 2033 |
2036 | 2034 |
2037 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( | 2035 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( |
2038 HLoadNamedFieldPolymorphic* instr) { | 2036 HLoadNamedFieldPolymorphic* instr) { |
2039 ASSERT(instr->representation().IsTagged()); | 2037 ASSERT(instr->representation().IsTagged()); |
2040 if (instr->need_generic()) { | 2038 if (instr->need_generic()) { |
2041 LOperand* obj = UseFixed(instr->object(), rax); | 2039 LOperand* obj = UseFixed(instr->object(), rax); |
2042 LLoadNamedFieldPolymorphic* result = | 2040 LLoadNamedFieldPolymorphic* result = |
2043 new(zone()) LLoadNamedFieldPolymorphic(obj); | 2041 new(zone()) LLoadNamedFieldPolymorphic(obj); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2243 HConstant::cast(instr->value())->NotInNewSpace() && | 2241 HConstant::cast(instr->value())->NotInNewSpace() && |
2244 !(FLAG_track_double_fields && instr->field_representation().IsDouble()); | 2242 !(FLAG_track_double_fields && instr->field_representation().IsDouble()); |
2245 | 2243 |
2246 LOperand* val; | 2244 LOperand* val; |
2247 if (needs_write_barrier) { | 2245 if (needs_write_barrier) { |
2248 val = UseTempRegister(instr->value()); | 2246 val = UseTempRegister(instr->value()); |
2249 } else if (can_be_constant) { | 2247 } else if (can_be_constant) { |
2250 val = UseRegisterOrConstant(instr->value()); | 2248 val = UseRegisterOrConstant(instr->value()); |
2251 } else if (FLAG_track_fields && instr->field_representation().IsSmi()) { | 2249 } else if (FLAG_track_fields && instr->field_representation().IsSmi()) { |
2252 val = UseTempRegister(instr->value()); | 2250 val = UseTempRegister(instr->value()); |
| 2251 } else if (FLAG_track_double_fields && |
| 2252 instr->field_representation().IsDouble()) { |
| 2253 val = UseRegisterAtStart(instr->value()); |
2253 } else { | 2254 } else { |
2254 val = UseRegister(instr->value()); | 2255 val = UseRegister(instr->value()); |
2255 } | 2256 } |
2256 | 2257 |
2257 // We only need a scratch register if we have a write barrier or we | 2258 // We only need a scratch register if we have a write barrier or we |
2258 // have a store into the properties array (not in-object-property). | 2259 // have a store into the properties array (not in-object-property). |
2259 LOperand* temp = (!instr->is_in_object() || needs_write_barrier || | 2260 LOperand* temp = (!instr->is_in_object() || needs_write_barrier || |
2260 needs_write_barrier_for_map) ? TempRegister() : NULL; | 2261 needs_write_barrier_for_map) ? TempRegister() : NULL; |
2261 | 2262 |
2262 LStoreNamedField* result = new(zone()) LStoreNamedField(obj, val, temp); | 2263 LStoreNamedField* result = new(zone()) LStoreNamedField(obj, val, temp); |
2263 if ((FLAG_track_fields && instr->field_representation().IsSmi()) || | 2264 if (FLAG_track_fields && instr->field_representation().IsSmi()) { |
2264 (FLAG_track_double_fields && instr->field_representation().IsDouble())) { | |
2265 return AssignEnvironment(result); | 2265 return AssignEnvironment(result); |
2266 } | 2266 } |
2267 return result; | 2267 return result; |
2268 } | 2268 } |
2269 | 2269 |
2270 | 2270 |
2271 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2271 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
2272 LOperand* object = UseFixed(instr->object(), rdx); | 2272 LOperand* object = UseFixed(instr->object(), rdx); |
2273 LOperand* value = UseFixed(instr->value(), rax); | 2273 LOperand* value = UseFixed(instr->value(), rax); |
2274 | 2274 |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2556 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2556 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2557 LOperand* object = UseRegister(instr->object()); | 2557 LOperand* object = UseRegister(instr->object()); |
2558 LOperand* index = UseTempRegister(instr->index()); | 2558 LOperand* index = UseTempRegister(instr->index()); |
2559 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2559 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2560 } | 2560 } |
2561 | 2561 |
2562 | 2562 |
2563 } } // namespace v8::internal | 2563 } } // namespace v8::internal |
2564 | 2564 |
2565 #endif // V8_TARGET_ARCH_X64 | 2565 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |