Chromium Code Reviews| 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 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2415 | 2415 |
| 2416 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { | 2416 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
| 2417 bool is_in_object = instr->access().IsInobject(); | 2417 bool is_in_object = instr->access().IsInobject(); |
| 2418 bool is_external_location = instr->access().IsExternalMemory() && | 2418 bool is_external_location = instr->access().IsExternalMemory() && |
| 2419 instr->access().offset() == 0; | 2419 instr->access().offset() == 0; |
| 2420 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 2420 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
| 2421 bool needs_write_barrier_for_map = !instr->transition().is_null() && | 2421 bool needs_write_barrier_for_map = !instr->transition().is_null() && |
| 2422 instr->NeedsWriteBarrierForMap(); | 2422 instr->NeedsWriteBarrierForMap(); |
| 2423 | 2423 |
| 2424 LOperand* obj; | 2424 LOperand* obj; |
| 2425 if (needs_write_barrier) { | 2425 if (is_external_location) { |
| 2426 obj = is_in_object | |
| 2427 ? UseRegister(instr->object()) | |
| 2428 : UseTempRegister(instr->object()); | |
| 2429 } else if (is_external_location) { | |
| 2430 ASSERT(!is_in_object); | 2426 ASSERT(!is_in_object); |
| 2431 ASSERT(!needs_write_barrier); | 2427 ASSERT(!needs_write_barrier); |
| 2432 ASSERT(!needs_write_barrier_for_map); | 2428 ASSERT(!needs_write_barrier_for_map); |
| 2433 obj = UseRegisterOrConstant(instr->object()); | 2429 obj = UseRegisterOrConstant(instr->object()); |
| 2430 } else if (needs_write_barrier) { | |
| 2431 obj = is_in_object | |
| 2432 ? UseRegister(instr->object()) | |
|
mvstanton
2013/07/31 13:37:47
Is this reordering needed?
If so, do you need to m
Benedikt Meurer
2013/07/31 13:45:39
Nope.
| |
| 2433 : UseTempRegister(instr->object()); | |
| 2434 } else { | 2434 } else { |
| 2435 obj = needs_write_barrier_for_map | 2435 obj = needs_write_barrier_for_map |
| 2436 ? UseRegister(instr->object()) | 2436 ? UseRegister(instr->object()) |
| 2437 : UseRegisterAtStart(instr->object()); | 2437 : UseRegisterAtStart(instr->object()); |
| 2438 } | 2438 } |
| 2439 | 2439 |
| 2440 bool can_be_constant = instr->value()->IsConstant() && | 2440 bool can_be_constant = instr->value()->IsConstant() && |
| 2441 HConstant::cast(instr->value())->NotInNewSpace() && | 2441 HConstant::cast(instr->value())->NotInNewSpace() && |
| 2442 !(FLAG_track_double_fields && instr->field_representation().IsDouble()); | 2442 !(FLAG_track_double_fields && instr->field_representation().IsDouble()); |
| 2443 | 2443 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2751 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2751 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2752 LOperand* object = UseRegister(instr->object()); | 2752 LOperand* object = UseRegister(instr->object()); |
| 2753 LOperand* index = UseTempRegister(instr->index()); | 2753 LOperand* index = UseTempRegister(instr->index()); |
| 2754 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2754 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2755 } | 2755 } |
| 2756 | 2756 |
| 2757 | 2757 |
| 2758 } } // namespace v8::internal | 2758 } } // namespace v8::internal |
| 2759 | 2759 |
| 2760 #endif // V8_TARGET_ARCH_IA32 | 2760 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |