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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { | 658 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { |
659 ASSERT(!instr->HasPointerMap()); | 659 ASSERT(!instr->HasPointerMap()); |
660 instr->set_pointer_map(new(zone()) LPointerMap(position_, zone())); | 660 instr->set_pointer_map(new(zone()) LPointerMap(position_, zone())); |
661 return instr; | 661 return instr; |
662 } | 662 } |
663 | 663 |
664 | 664 |
665 LUnallocated* LChunkBuilder::TempRegister() { | 665 LUnallocated* LChunkBuilder::TempRegister() { |
666 LUnallocated* operand = | 666 LUnallocated* operand = |
667 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER); | 667 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER); |
668 operand->set_virtual_register(allocator_->GetVirtualRegister()); | 668 int vreg = allocator_->GetVirtualRegister(); |
669 if (!allocator_->AllocationOk()) Abort("Not enough virtual registers."); | 669 if (!allocator_->AllocationOk()) { |
| 670 Abort("Out of virtual registers while trying to allocate temp register."); |
| 671 return NULL; |
| 672 } |
| 673 operand->set_virtual_register(vreg); |
670 return operand; | 674 return operand; |
671 } | 675 } |
672 | 676 |
673 | 677 |
674 LOperand* LChunkBuilder::FixedTemp(Register reg) { | 678 LOperand* LChunkBuilder::FixedTemp(Register reg) { |
675 LUnallocated* operand = ToUnallocated(reg); | 679 LUnallocated* operand = ToUnallocated(reg); |
676 ASSERT(operand->HasFixedPolicy()); | 680 ASSERT(operand->HasFixedPolicy()); |
677 return operand; | 681 return operand; |
678 } | 682 } |
679 | 683 |
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2385 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2389 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2386 LOperand* object = UseRegister(instr->object()); | 2390 LOperand* object = UseRegister(instr->object()); |
2387 LOperand* index = UseTempRegister(instr->index()); | 2391 LOperand* index = UseTempRegister(instr->index()); |
2388 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2392 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2389 } | 2393 } |
2390 | 2394 |
2391 | 2395 |
2392 } } // namespace v8::internal | 2396 } } // namespace v8::internal |
2393 | 2397 |
2394 #endif // V8_TARGET_ARCH_X64 | 2398 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |