OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 2213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2224 ASSERT(instr->object()->representation().IsTagged()); | 2224 ASSERT(instr->object()->representation().IsTagged()); |
2225 ASSERT(instr->key()->representation().IsTagged()); | 2225 ASSERT(instr->key()->representation().IsTagged()); |
2226 ASSERT(instr->value()->representation().IsTagged()); | 2226 ASSERT(instr->value()->representation().IsTagged()); |
2227 | 2227 |
2228 return MarkAsCall( | 2228 return MarkAsCall( |
2229 new(zone()) LStoreKeyedGeneric(context, object, key, value), instr); | 2229 new(zone()) LStoreKeyedGeneric(context, object, key, value), instr); |
2230 } | 2230 } |
2231 | 2231 |
2232 | 2232 |
2233 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { | 2233 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
2234 // TODO(jbramley): Optimize register usage in this instruction. For now, it | |
2235 // allocates everything that it might need because it keeps changing in the | |
2236 // merge and keeping it valid is time-consuming. | |
2237 | |
2238 // TODO(jbramley): It might be beneficial to allow value to be a constant in | 2234 // TODO(jbramley): It might be beneficial to allow value to be a constant in |
2239 // some cases. x64 makes use of this with FLAG_track_fields, for example. | 2235 // some cases. x64 makes use of this with FLAG_track_fields, for example. |
2240 | 2236 |
2241 LOperand* object = UseRegister(instr->object()); | 2237 LOperand* object = UseRegister(instr->object()); |
ulan
2014/03/07 15:16:26
This is difficult to understand and to keep in syn
| |
2242 LOperand* value = UseRegisterAndClobber(instr->value()); | 2238 LOperand* value; |
2243 LOperand* temp0 = TempRegister(); | 2239 LOperand* temp0 = NULL; |
2244 LOperand* temp1 = TempRegister(); | 2240 LOperand* temp1 = NULL; |
2241 if (instr->NeedsWriteBarrier()) { | |
2242 value = UseRegisterAndClobber(instr->value()); | |
2243 temp0 = TempRegister(); | |
2244 temp1 = TempRegister(); | |
2245 } else { | |
2246 value = UseRegister(instr->value()); | |
2247 if (!(instr->access().IsExternalMemory() || | |
2248 instr->field_representation().IsDouble())) { | |
2249 temp0 = TempRegister(); | |
2250 if (instr->NeedsWriteBarrierForMap()) { | |
2251 temp1 = TempRegister(); | |
2252 } | |
2253 } | |
2254 } | |
2245 | 2255 |
2246 LStoreNamedField* result = | 2256 LStoreNamedField* result = |
2247 new(zone()) LStoreNamedField(object, value, temp0, temp1); | 2257 new(zone()) LStoreNamedField(object, value, temp0, temp1); |
2248 if (instr->field_representation().IsHeapObject() && | 2258 if (instr->field_representation().IsHeapObject() && |
2249 !instr->value()->type().IsHeapObject()) { | 2259 !instr->value()->type().IsHeapObject()) { |
2250 return AssignEnvironment(result); | 2260 return AssignEnvironment(result); |
2251 } | 2261 } |
2252 return result; | 2262 return result; |
2253 } | 2263 } |
2254 | 2264 |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2552 | 2562 |
2553 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { | 2563 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { |
2554 LOperand* receiver = UseRegister(instr->receiver()); | 2564 LOperand* receiver = UseRegister(instr->receiver()); |
2555 LOperand* function = UseRegister(instr->function()); | 2565 LOperand* function = UseRegister(instr->function()); |
2556 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); | 2566 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function); |
2557 return AssignEnvironment(DefineAsRegister(result)); | 2567 return AssignEnvironment(DefineAsRegister(result)); |
2558 } | 2568 } |
2559 | 2569 |
2560 | 2570 |
2561 } } // namespace v8::internal | 2571 } } // namespace v8::internal |
OLD | NEW |