| 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 HBasicBlock* next = NULL; | 480 HBasicBlock* next = NULL; |
| 481 if (i < blocks->length() - 1) next = blocks->at(i + 1); | 481 if (i < blocks->length() - 1) next = blocks->at(i + 1); |
| 482 DoBasicBlock(blocks->at(i), next); | 482 DoBasicBlock(blocks->at(i), next); |
| 483 if (is_aborted()) return NULL; | 483 if (is_aborted()) return NULL; |
| 484 } | 484 } |
| 485 status_ = DONE; | 485 status_ = DONE; |
| 486 return chunk_; | 486 return chunk_; |
| 487 } | 487 } |
| 488 | 488 |
| 489 | 489 |
| 490 void LChunkBuilder::Abort(const char* reason) { | 490 void LChunkBuilder::Abort(BailoutReason reason) { |
| 491 info()->set_bailout_reason(reason); | 491 info()->set_bailout_reason(reason); |
| 492 status_ = ABORTED; | 492 status_ = ABORTED; |
| 493 } | 493 } |
| 494 | 494 |
| 495 | 495 |
| 496 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) { | 496 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) { |
| 497 return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER, | 497 return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER, |
| 498 Register::ToAllocationIndex(reg)); | 498 Register::ToAllocationIndex(reg)); |
| 499 } | 499 } |
| 500 | 500 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 instr->set_pointer_map(new(zone()) LPointerMap(position_, zone())); | 691 instr->set_pointer_map(new(zone()) LPointerMap(position_, zone())); |
| 692 return instr; | 692 return instr; |
| 693 } | 693 } |
| 694 | 694 |
| 695 | 695 |
| 696 LUnallocated* LChunkBuilder::TempRegister() { | 696 LUnallocated* LChunkBuilder::TempRegister() { |
| 697 LUnallocated* operand = | 697 LUnallocated* operand = |
| 698 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER); | 698 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER); |
| 699 int vreg = allocator_->GetVirtualRegister(); | 699 int vreg = allocator_->GetVirtualRegister(); |
| 700 if (!allocator_->AllocationOk()) { | 700 if (!allocator_->AllocationOk()) { |
| 701 Abort("Out of virtual registers while trying to allocate temp register."); | 701 Abort(kOutOfVirtualRegistersWhileTryingToAllocateTempRegister); |
| 702 vreg = 0; | 702 vreg = 0; |
| 703 } | 703 } |
| 704 operand->set_virtual_register(vreg); | 704 operand->set_virtual_register(vreg); |
| 705 return operand; | 705 return operand; |
| 706 } | 706 } |
| 707 | 707 |
| 708 | 708 |
| 709 LOperand* LChunkBuilder::FixedTemp(Register reg) { | 709 LOperand* LChunkBuilder::FixedTemp(Register reg) { |
| 710 LUnallocated* operand = ToUnallocated(reg); | 710 LUnallocated* operand = ToUnallocated(reg); |
| 711 ASSERT(operand->HasFixedPolicy()); | 711 ASSERT(operand->HasFixedPolicy()); |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2560 int index = static_cast<int>(instr->index()); | 2560 int index = static_cast<int>(instr->index()); |
| 2561 Register reg = DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index); | 2561 Register reg = DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index); |
| 2562 return DefineFixed(result, reg); | 2562 return DefineFixed(result, reg); |
| 2563 } | 2563 } |
| 2564 } | 2564 } |
| 2565 | 2565 |
| 2566 | 2566 |
| 2567 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2567 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
| 2568 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. | 2568 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. |
| 2569 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { | 2569 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { |
| 2570 Abort("Too many spill slots needed for OSR"); | 2570 Abort(kTooManySpillSlotsNeededForOSR); |
| 2571 spill_index = 0; | 2571 spill_index = 0; |
| 2572 } | 2572 } |
| 2573 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); | 2573 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); |
| 2574 } | 2574 } |
| 2575 | 2575 |
| 2576 | 2576 |
| 2577 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { | 2577 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { |
| 2578 LOperand* context = UseFixed(instr->context(), esi); | 2578 LOperand* context = UseFixed(instr->context(), esi); |
| 2579 argument_count_ -= instr->argument_count(); | 2579 argument_count_ -= instr->argument_count(); |
| 2580 LCallStub* result = new(zone()) LCallStub(context); | 2580 LCallStub* result = new(zone()) LCallStub(context); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2745 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2745 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2746 LOperand* object = UseRegister(instr->object()); | 2746 LOperand* object = UseRegister(instr->object()); |
| 2747 LOperand* index = UseTempRegister(instr->index()); | 2747 LOperand* index = UseTempRegister(instr->index()); |
| 2748 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2748 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2749 } | 2749 } |
| 2750 | 2750 |
| 2751 | 2751 |
| 2752 } } // namespace v8::internal | 2752 } } // namespace v8::internal |
| 2753 | 2753 |
| 2754 #endif // V8_TARGET_ARCH_IA32 | 2754 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |