OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 phi_operand); | 1036 phi_operand); |
1037 | 1037 |
1038 // We are going to insert a move before the branch instruction. | 1038 // We are going to insert a move before the branch instruction. |
1039 // Some branch instructions (e.g. loops' back edges) | 1039 // Some branch instructions (e.g. loops' back edges) |
1040 // can potentially cause a GC so they have a pointer map. | 1040 // can potentially cause a GC so they have a pointer map. |
1041 // By inserting a move we essentially create a copy of a | 1041 // By inserting a move we essentially create a copy of a |
1042 // value which is invisible to PopulatePointerMaps(), because we store | 1042 // value which is invisible to PopulatePointerMaps(), because we store |
1043 // it into a location different from the operand of a live range | 1043 // it into a location different from the operand of a live range |
1044 // covering a branch instruction. | 1044 // covering a branch instruction. |
1045 // Thus we need to manually record a pointer. | 1045 // Thus we need to manually record a pointer. |
1046 if (phi->representation().IsTagged()) { | 1046 LInstruction* branch = |
1047 LInstruction* branch = | 1047 InstructionAt(cur_block->last_instruction_index()); |
1048 InstructionAt(cur_block->last_instruction_index()); | 1048 if (branch->HasPointerMap()) { |
1049 if (branch->HasPointerMap()) { | 1049 if (phi->representation().IsTagged()) { |
1050 branch->pointer_map()->RecordPointer(phi_operand); | 1050 branch->pointer_map()->RecordPointer(phi_operand); |
| 1051 } else if (!phi->representation().IsDouble()) { |
| 1052 branch->pointer_map()->RecordUntagged(phi_operand); |
1051 } | 1053 } |
1052 } | 1054 } |
1053 } | 1055 } |
1054 | 1056 |
1055 LiveRange* live_range = LiveRangeFor(phi->id()); | 1057 LiveRange* live_range = LiveRangeFor(phi->id()); |
1056 LLabel* label = chunk_->GetLabel(phi->block()->block_id()); | 1058 LLabel* label = chunk_->GetLabel(phi->block()->block_id()); |
1057 label->GetOrCreateParallelMove(LGap::START)-> | 1059 label->GetOrCreateParallelMove(LGap::START)-> |
1058 AddMove(phi_operand, live_range->GetSpillOperand()); | 1060 AddMove(phi_operand, live_range->GetSpillOperand()); |
1059 live_range->SetSpillStartIndex(phi->block()->first_instruction_index()); | 1061 live_range->SetSpillStartIndex(phi->block()->first_instruction_index()); |
1060 } | 1062 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 gap = GetLastGap(pred); | 1137 gap = GetLastGap(pred); |
1136 | 1138 |
1137 // We are going to insert a move before the branch instruction. | 1139 // We are going to insert a move before the branch instruction. |
1138 // Some branch instructions (e.g. loops' back edges) | 1140 // Some branch instructions (e.g. loops' back edges) |
1139 // can potentially cause a GC so they have a pointer map. | 1141 // can potentially cause a GC so they have a pointer map. |
1140 // By inserting a move we essentially create a copy of a | 1142 // By inserting a move we essentially create a copy of a |
1141 // value which is invisible to PopulatePointerMaps(), because we store | 1143 // value which is invisible to PopulatePointerMaps(), because we store |
1142 // it into a location different from the operand of a live range | 1144 // it into a location different from the operand of a live range |
1143 // covering a branch instruction. | 1145 // covering a branch instruction. |
1144 // Thus we need to manually record a pointer. | 1146 // Thus we need to manually record a pointer. |
1145 if (HasTaggedValue(range->id())) { | 1147 LInstruction* branch = InstructionAt(pred->last_instruction_index()); |
1146 LInstruction* branch = InstructionAt(pred->last_instruction_index()); | 1148 if (branch->HasPointerMap()) { |
1147 if (branch->HasPointerMap()) { | 1149 if (HasTaggedValue(range->id())) { |
1148 branch->pointer_map()->RecordPointer(cur_op); | 1150 branch->pointer_map()->RecordPointer(cur_op); |
| 1151 } else if (!cur_op->IsDoubleStackSlot() && |
| 1152 !cur_op->IsDoubleRegister()) { |
| 1153 branch->pointer_map()->RemovePointer(cur_op); |
1149 } | 1154 } |
1150 } | 1155 } |
1151 } | 1156 } |
1152 gap->GetOrCreateParallelMove(LGap::START)->AddMove(pred_op, cur_op); | 1157 gap->GetOrCreateParallelMove(LGap::START)->AddMove(pred_op, cur_op); |
1153 } | 1158 } |
1154 } | 1159 } |
1155 } | 1160 } |
1156 | 1161 |
1157 | 1162 |
1158 LParallelMove* LAllocator::GetConnectingParallelMove(LifetimePosition pos) { | 1163 LParallelMove* LAllocator::GetConnectingParallelMove(LifetimePosition pos) { |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2119 LiveRange* current = live_ranges()->at(i); | 2124 LiveRange* current = live_ranges()->at(i); |
2120 if (current != NULL) current->Verify(); | 2125 if (current != NULL) current->Verify(); |
2121 } | 2126 } |
2122 } | 2127 } |
2123 | 2128 |
2124 | 2129 |
2125 #endif | 2130 #endif |
2126 | 2131 |
2127 | 2132 |
2128 } } // namespace v8::internal | 2133 } } // namespace v8::internal |
OLD | NEW |