| 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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 } | 850 } |
| 851 | 851 |
| 852 | 852 |
| 853 void LChunkBuilder::VisitInstruction(HInstruction* current) { | 853 void LChunkBuilder::VisitInstruction(HInstruction* current) { |
| 854 HInstruction* old_current = current_instruction_; | 854 HInstruction* old_current = current_instruction_; |
| 855 current_instruction_ = current; | 855 current_instruction_ = current; |
| 856 if (current->has_position()) position_ = current->position(); | 856 if (current->has_position()) position_ = current->position(); |
| 857 LInstruction* instr = current->CompileToLithium(this); | 857 LInstruction* instr = current->CompileToLithium(this); |
| 858 | 858 |
| 859 if (instr != NULL) { | 859 if (instr != NULL) { |
| 860 #if DEBUG |
| 861 // Make sure that the lithium instruction has either no fixed register |
| 862 // constraints in temps or the result OR no uses that are only used at |
| 863 // start. If this invariant doesn't hold, the register allocator can decide |
| 864 // to insert a split of a range immediately before the instruction due to an |
| 865 // already allocated register needing to be used for the instruction's fixed |
| 866 // register constraint. In this case, The register allocator won't see an |
| 867 // interference between the split child and the use-at-start (it would if |
| 868 // the it was just a plain use), so it is free to move the split child into |
| 869 // the same register that is used for the use-at-start. |
| 870 // See https://code.google.com/p/chromium/issues/detail?id=201590 |
| 871 if (!(instr->ClobbersRegisters() && instr->ClobbersDoubleRegisters())) { |
| 872 int fixed = 0; |
| 873 int used_at_start = 0; |
| 874 for (UseIterator it(instr); !it.Done(); it.Advance()) { |
| 875 LUnallocated* operand = LUnallocated::cast(it.Current()); |
| 876 if (operand->IsUsedAtStart()) ++used_at_start; |
| 877 } |
| 878 if (instr->Output() != NULL) { |
| 879 if (LUnallocated::cast(instr->Output())->HasFixedPolicy()) ++fixed; |
| 880 } |
| 881 for (TempIterator it(instr); !it.Done(); it.Advance()) { |
| 882 LUnallocated* operand = LUnallocated::cast(it.Current()); |
| 883 if (operand->HasFixedPolicy()) ++fixed; |
| 884 } |
| 885 ASSERT(fixed == 0 || used_at_start == 0); |
| 886 } |
| 887 #endif |
| 888 |
| 860 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { | 889 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { |
| 861 instr = AssignPointerMap(instr); | 890 instr = AssignPointerMap(instr); |
| 862 } | 891 } |
| 863 if (FLAG_stress_environments && !instr->HasEnvironment()) { | 892 if (FLAG_stress_environments && !instr->HasEnvironment()) { |
| 864 instr = AssignEnvironment(instr); | 893 instr = AssignEnvironment(instr); |
| 865 } | 894 } |
| 866 instr->set_hydrogen_value(current); | 895 instr->set_hydrogen_value(current); |
| 867 chunk_->AddInstruction(instr, current_block_); | 896 chunk_->AddInstruction(instr, current_block_); |
| 868 } | 897 } |
| 869 current_instruction_ = old_current; | 898 current_instruction_ = old_current; |
| (...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2417 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2446 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2418 LOperand* object = UseRegister(instr->object()); | 2447 LOperand* object = UseRegister(instr->object()); |
| 2419 LOperand* index = UseTempRegister(instr->index()); | 2448 LOperand* index = UseTempRegister(instr->index()); |
| 2420 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2449 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2421 } | 2450 } |
| 2422 | 2451 |
| 2423 | 2452 |
| 2424 } } // namespace v8::internal | 2453 } } // namespace v8::internal |
| 2425 | 2454 |
| 2426 #endif // V8_TARGET_ARCH_X64 | 2455 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |