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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 // Some branch instructions (e.g. loops' back edges) | 1050 // Some branch instructions (e.g. loops' back edges) |
1051 // can potentially cause a GC so they have a pointer map. | 1051 // can potentially cause a GC so they have a pointer map. |
1052 // By inserting a move we essentially create a copy of a | 1052 // By inserting a move we essentially create a copy of a |
1053 // value which is invisible to PopulatePointerMaps(), because we store | 1053 // value which is invisible to PopulatePointerMaps(), because we store |
1054 // it into a location different from the operand of a live range | 1054 // it into a location different from the operand of a live range |
1055 // covering a branch instruction. | 1055 // covering a branch instruction. |
1056 // Thus we need to manually record a pointer. | 1056 // Thus we need to manually record a pointer. |
1057 LInstruction* branch = | 1057 LInstruction* branch = |
1058 InstructionAt(cur_block->last_instruction_index()); | 1058 InstructionAt(cur_block->last_instruction_index()); |
1059 if (branch->HasPointerMap()) { | 1059 if (branch->HasPointerMap()) { |
1060 if (phi->representation().IsSmiOrTagged()) { | 1060 if (phi->representation().IsTagged() && !phi->type().IsSmi()) { |
1061 branch->pointer_map()->RecordPointer(phi_operand, zone()); | 1061 branch->pointer_map()->RecordPointer(phi_operand, zone()); |
1062 } else if (!phi->representation().IsDouble()) { | 1062 } else if (!phi->representation().IsDouble()) { |
1063 branch->pointer_map()->RecordUntagged(phi_operand, zone()); | 1063 branch->pointer_map()->RecordUntagged(phi_operand, zone()); |
1064 } | 1064 } |
1065 } | 1065 } |
1066 } | 1066 } |
1067 | 1067 |
1068 LiveRange* live_range = LiveRangeFor(phi->id()); | 1068 LiveRange* live_range = LiveRangeFor(phi->id()); |
1069 LLabel* label = chunk_->GetLabel(phi->block()->block_id()); | 1069 LLabel* label = chunk_->GetLabel(phi->block()->block_id()); |
1070 label->GetOrCreateParallelMove(LGap::START, zone())-> | 1070 label->GetOrCreateParallelMove(LGap::START, zone())-> |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 va_start(arguments, msg); | 1633 va_start(arguments, msg); |
1634 OS::VPrint(msg, arguments); | 1634 OS::VPrint(msg, arguments); |
1635 va_end(arguments); | 1635 va_end(arguments); |
1636 } | 1636 } |
1637 } | 1637 } |
1638 | 1638 |
1639 | 1639 |
1640 bool LAllocator::HasTaggedValue(int virtual_register) const { | 1640 bool LAllocator::HasTaggedValue(int virtual_register) const { |
1641 HValue* value = graph_->LookupValue(virtual_register); | 1641 HValue* value = graph_->LookupValue(virtual_register); |
1642 if (value == NULL) return false; | 1642 if (value == NULL) return false; |
1643 return value->representation().IsSmiOrTagged(); | 1643 return value->representation().IsTagged() && !value->type().IsSmi(); |
1644 } | 1644 } |
1645 | 1645 |
1646 | 1646 |
1647 RegisterKind LAllocator::RequiredRegisterKind(int virtual_register) const { | 1647 RegisterKind LAllocator::RequiredRegisterKind(int virtual_register) const { |
1648 if (virtual_register < first_artificial_register_) { | 1648 if (virtual_register < first_artificial_register_) { |
1649 HValue* value = graph_->LookupValue(virtual_register); | 1649 HValue* value = graph_->LookupValue(virtual_register); |
1650 if (value != NULL && value->representation().IsDouble()) { | 1650 if (value != NULL && value->representation().IsDouble()) { |
1651 return DOUBLE_REGISTERS; | 1651 return DOUBLE_REGISTERS; |
1652 } | 1652 } |
1653 } else if (double_artificial_registers_.Contains( | 1653 } else if (double_artificial_registers_.Contains( |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2185 LiveRange* current = live_ranges()->at(i); | 2185 LiveRange* current = live_ranges()->at(i); |
2186 if (current != NULL) current->Verify(); | 2186 if (current != NULL) current->Verify(); |
2187 } | 2187 } |
2188 } | 2188 } |
2189 | 2189 |
2190 | 2190 |
2191 #endif | 2191 #endif |
2192 | 2192 |
2193 | 2193 |
2194 } } // namespace v8::internal | 2194 } } // namespace v8::internal |
OLD | NEW |