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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 block->UpdateEnvironment(last_environment); | 877 block->UpdateEnvironment(last_environment); |
878 ASSERT(pred->argument_count() >= 0); | 878 ASSERT(pred->argument_count() >= 0); |
879 argument_count_ = pred->argument_count(); | 879 argument_count_ = pred->argument_count(); |
880 } else { | 880 } else { |
881 // We are at a state join => process phis. | 881 // We are at a state join => process phis. |
882 HBasicBlock* pred = block->predecessors()->at(0); | 882 HBasicBlock* pred = block->predecessors()->at(0); |
883 // No need to copy the environment, it cannot be used later. | 883 // No need to copy the environment, it cannot be used later. |
884 HEnvironment* last_environment = pred->last_environment(); | 884 HEnvironment* last_environment = pred->last_environment(); |
885 for (int i = 0; i < block->phis()->length(); ++i) { | 885 for (int i = 0; i < block->phis()->length(); ++i) { |
886 HPhi* phi = block->phis()->at(i); | 886 HPhi* phi = block->phis()->at(i); |
887 last_environment->SetValueAt(phi->merged_index(), phi); | 887 if (phi->merged_index() < last_environment->length()) { |
| 888 last_environment->SetValueAt(phi->merged_index(), phi); |
| 889 } |
888 } | 890 } |
889 for (int i = 0; i < block->deleted_phis()->length(); ++i) { | 891 for (int i = 0; i < block->deleted_phis()->length(); ++i) { |
890 last_environment->SetValueAt(block->deleted_phis()->at(i), | 892 if (block->deleted_phis()->at(i) < last_environment->length()) { |
891 graph_->GetConstantUndefined()); | 893 last_environment->SetValueAt(block->deleted_phis()->at(i), |
| 894 graph_->GetConstantUndefined()); |
| 895 } |
892 } | 896 } |
893 block->UpdateEnvironment(last_environment); | 897 block->UpdateEnvironment(last_environment); |
894 // Pick up the outgoing argument count of one of the predecessors. | 898 // Pick up the outgoing argument count of one of the predecessors. |
895 argument_count_ = pred->argument_count(); | 899 argument_count_ = pred->argument_count(); |
896 } | 900 } |
897 HInstruction* current = block->first(); | 901 HInstruction* current = block->first(); |
898 int start = chunk_->instructions()->length(); | 902 int start = chunk_->instructions()->length(); |
899 while (current != NULL && !is_aborted()) { | 903 while (current != NULL && !is_aborted()) { |
900 // Code for constants in registers is generated lazily. | 904 // Code for constants in registers is generated lazily. |
901 if (!current->EmitAtUses()) { | 905 if (!current->EmitAtUses()) { |
(...skipping 1822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2724 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2728 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2725 LOperand* object = UseRegister(instr->object()); | 2729 LOperand* object = UseRegister(instr->object()); |
2726 LOperand* index = UseTempRegister(instr->index()); | 2730 LOperand* index = UseTempRegister(instr->index()); |
2727 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2731 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2728 } | 2732 } |
2729 | 2733 |
2730 | 2734 |
2731 } } // namespace v8::internal | 2735 } } // namespace v8::internal |
2732 | 2736 |
2733 #endif // V8_TARGET_ARCH_IA32 | 2737 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |