OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1022 LUnallocated* unalloc = new LUnallocated(LUnallocated::NONE); | 1022 LUnallocated* unalloc = new LUnallocated(LUnallocated::NONE); |
1023 unalloc->set_virtual_register(op->id()); | 1023 unalloc->set_virtual_register(op->id()); |
1024 operand = unalloc; | 1024 operand = unalloc; |
1025 } | 1025 } |
1026 HBasicBlock* cur_block = block->predecessors()->at(j); | 1026 HBasicBlock* cur_block = block->predecessors()->at(j); |
1027 // The gap move must be added without any special processing as in | 1027 // The gap move must be added without any special processing as in |
1028 // the AddConstraintsGapMove. | 1028 // the AddConstraintsGapMove. |
1029 chunk_->AddGapMove(cur_block->last_instruction_index() - 1, | 1029 chunk_->AddGapMove(cur_block->last_instruction_index() - 1, |
1030 operand, | 1030 operand, |
1031 phi_operand); | 1031 phi_operand); |
1032 | |
1033 // We are going to insert a move before the branch instruction. | |
1034 // Some branch instructions (e.g. loops' back edges) | |
1035 // can potentially cause a GC so they have a pointer map. | |
1036 // By insterting a move we essentially create a copy of a | |
fschneider
2011/04/18 20:20:05
->inserting
| |
1037 // value which is invisible to PopulatePointerMaps(), because we store | |
1038 // it into a location different from the operand of a live range | |
1039 // covering a branch instruction. | |
1040 // Thus we need to manually record a pointer. | |
1041 if (phi->representation().IsTagged()) { | |
1042 LInstruction* branch = | |
1043 InstructionAt(cur_block->last_instruction_index()); | |
1044 if (branch->HasPointerMap()) { | |
1045 branch->pointer_map()->RecordPointer(phi_operand); | |
1046 } | |
1047 } | |
1032 } | 1048 } |
1033 | 1049 |
1034 LiveRange* live_range = LiveRangeFor(phi->id()); | 1050 LiveRange* live_range = LiveRangeFor(phi->id()); |
1035 LLabel* label = chunk_->GetLabel(phi->block()->block_id()); | 1051 LLabel* label = chunk_->GetLabel(phi->block()->block_id()); |
1036 label->GetOrCreateParallelMove(LGap::START)-> | 1052 label->GetOrCreateParallelMove(LGap::START)-> |
1037 AddMove(phi_operand, live_range->GetSpillOperand()); | 1053 AddMove(phi_operand, live_range->GetSpillOperand()); |
1038 live_range->SetSpillStartIndex(phi->block()->first_instruction_index()); | 1054 live_range->SetSpillStartIndex(phi->block()->first_instruction_index()); |
1039 } | 1055 } |
1040 } | 1056 } |
1041 | 1057 |
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2096 LiveRange* current = live_ranges()->at(i); | 2112 LiveRange* current = live_ranges()->at(i); |
2097 if (current != NULL) current->Verify(); | 2113 if (current != NULL) current->Verify(); |
2098 } | 2114 } |
2099 } | 2115 } |
2100 | 2116 |
2101 | 2117 |
2102 #endif | 2118 #endif |
2103 | 2119 |
2104 | 2120 |
2105 } } // namespace v8::internal | 2121 } } // namespace v8::internal |
OLD | NEW |