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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 } | 854 } |
855 | 855 |
856 | 856 |
857 void LChunkBuilder::VisitInstruction(HInstruction* current) { | 857 void LChunkBuilder::VisitInstruction(HInstruction* current) { |
858 HInstruction* old_current = current_instruction_; | 858 HInstruction* old_current = current_instruction_; |
859 current_instruction_ = current; | 859 current_instruction_ = current; |
860 if (current->has_position()) position_ = current->position(); | 860 if (current->has_position()) position_ = current->position(); |
861 LInstruction* instr = current->CompileToLithium(this); | 861 LInstruction* instr = current->CompileToLithium(this); |
862 | 862 |
863 if (instr != NULL) { | 863 if (instr != NULL) { |
| 864 // Associate the hydrogen instruction first, since we may need it for |
| 865 // the ClobbersRegisters() or ClobbersDoubleRegisters() calls below. |
| 866 instr->set_hydrogen_value(current); |
| 867 |
864 #if DEBUG | 868 #if DEBUG |
865 // Make sure that the lithium instruction has either no fixed register | 869 // Make sure that the lithium instruction has either no fixed register |
866 // constraints in temps or the result OR no uses that are only used at | 870 // constraints in temps or the result OR no uses that are only used at |
867 // start. If this invariant doesn't hold, the register allocator can decide | 871 // start. If this invariant doesn't hold, the register allocator can decide |
868 // to insert a split of a range immediately before the instruction due to an | 872 // to insert a split of a range immediately before the instruction due to an |
869 // already allocated register needing to be used for the instruction's fixed | 873 // already allocated register needing to be used for the instruction's fixed |
870 // register constraint. In this case, The register allocator won't see an | 874 // register constraint. In this case, The register allocator won't see an |
871 // interference between the split child and the use-at-start (it would if | 875 // interference between the split child and the use-at-start (it would if |
872 // the it was just a plain use), so it is free to move the split child into | 876 // the it was just a plain use), so it is free to move the split child into |
873 // the same register that is used for the use-at-start. | 877 // the same register that is used for the use-at-start. |
(...skipping 16 matching lines...) Expand all Loading... |
890 } | 894 } |
891 #endif | 895 #endif |
892 | 896 |
893 instr->set_position(position_); | 897 instr->set_position(position_); |
894 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { | 898 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { |
895 instr = AssignPointerMap(instr); | 899 instr = AssignPointerMap(instr); |
896 } | 900 } |
897 if (FLAG_stress_environments && !instr->HasEnvironment()) { | 901 if (FLAG_stress_environments && !instr->HasEnvironment()) { |
898 instr = AssignEnvironment(instr); | 902 instr = AssignEnvironment(instr); |
899 } | 903 } |
900 instr->set_hydrogen_value(current); | |
901 chunk_->AddInstruction(instr, current_block_); | 904 chunk_->AddInstruction(instr, current_block_); |
902 } | 905 } |
903 current_instruction_ = old_current; | 906 current_instruction_ = old_current; |
904 } | 907 } |
905 | 908 |
906 | 909 |
907 LEnvironment* LChunkBuilder::CreateEnvironment( | 910 LEnvironment* LChunkBuilder::CreateEnvironment( |
908 HEnvironment* hydrogen_env, | 911 HEnvironment* hydrogen_env, |
909 int* argument_index_accumulator, | 912 int* argument_index_accumulator, |
910 ZoneList<HValue*>* objects_to_materialize) { | 913 ZoneList<HValue*>* objects_to_materialize) { |
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2601 | 2604 |
2602 | 2605 |
2603 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2606 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2604 LOperand* object = UseRegister(instr->object()); | 2607 LOperand* object = UseRegister(instr->object()); |
2605 LOperand* index = UseRegister(instr->index()); | 2608 LOperand* index = UseRegister(instr->index()); |
2606 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2609 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2607 } | 2610 } |
2608 | 2611 |
2609 | 2612 |
2610 } } // namespace v8::internal | 2613 } } // namespace v8::internal |
OLD | NEW |