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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 HBasicBlock* next = NULL; | 436 HBasicBlock* next = NULL; |
437 if (i < blocks->length() - 1) next = blocks->at(i + 1); | 437 if (i < blocks->length() - 1) next = blocks->at(i + 1); |
438 DoBasicBlock(blocks->at(i), next); | 438 DoBasicBlock(blocks->at(i), next); |
439 if (is_aborted()) return NULL; | 439 if (is_aborted()) return NULL; |
440 } | 440 } |
441 status_ = DONE; | 441 status_ = DONE; |
442 return chunk_; | 442 return chunk_; |
443 } | 443 } |
444 | 444 |
445 | 445 |
446 void LCodeGen::Abort(const char* reason) { | 446 void LCodeGen::Abort(BailoutReason reason) { |
447 info()->set_bailout_reason(reason); | 447 info()->set_bailout_reason(reason); |
448 status_ = ABORTED; | 448 status_ = ABORTED; |
449 } | 449 } |
450 | 450 |
451 | 451 |
452 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) { | 452 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) { |
453 return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER, | 453 return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER, |
454 Register::ToAllocationIndex(reg)); | 454 Register::ToAllocationIndex(reg)); |
455 } | 455 } |
456 | 456 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 instr->set_pointer_map(new(zone()) LPointerMap(position_, zone())); | 647 instr->set_pointer_map(new(zone()) LPointerMap(position_, zone())); |
648 return instr; | 648 return instr; |
649 } | 649 } |
650 | 650 |
651 | 651 |
652 LUnallocated* LChunkBuilder::TempRegister() { | 652 LUnallocated* LChunkBuilder::TempRegister() { |
653 LUnallocated* operand = | 653 LUnallocated* operand = |
654 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER); | 654 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER); |
655 int vreg = allocator_->GetVirtualRegister(); | 655 int vreg = allocator_->GetVirtualRegister(); |
656 if (!allocator_->AllocationOk()) { | 656 if (!allocator_->AllocationOk()) { |
657 Abort("Out of virtual registers while trying to allocate temp register."); | 657 Abort(kOutOfVirtualRegistersWhileTryingToAllocateTempRegister); |
658 vreg = 0; | 658 vreg = 0; |
659 } | 659 } |
660 operand->set_virtual_register(vreg); | 660 operand->set_virtual_register(vreg); |
661 return operand; | 661 return operand; |
662 } | 662 } |
663 | 663 |
664 | 664 |
665 LOperand* LChunkBuilder::FixedTemp(Register reg) { | 665 LOperand* LChunkBuilder::FixedTemp(Register reg) { |
666 LUnallocated* operand = ToUnallocated(reg); | 666 LUnallocated* operand = ToUnallocated(reg); |
667 ASSERT(operand->HasFixedPolicy()); | 667 ASSERT(operand->HasFixedPolicy()); |
(...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2361 int index = static_cast<int>(instr->index()); | 2361 int index = static_cast<int>(instr->index()); |
2362 Register reg = DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index); | 2362 Register reg = DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index); |
2363 return DefineFixed(result, reg); | 2363 return DefineFixed(result, reg); |
2364 } | 2364 } |
2365 } | 2365 } |
2366 | 2366 |
2367 | 2367 |
2368 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2368 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
2369 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. | 2369 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. |
2370 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { | 2370 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { |
2371 Abort("Too many spill slots needed for OSR"); | 2371 Abort(kTooManySpillSlotsNeededForOSR); |
2372 spill_index = 0; | 2372 spill_index = 0; |
2373 } | 2373 } |
2374 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); | 2374 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); |
2375 } | 2375 } |
2376 | 2376 |
2377 | 2377 |
2378 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { | 2378 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { |
2379 argument_count_ -= instr->argument_count(); | 2379 argument_count_ -= instr->argument_count(); |
2380 return MarkAsCall(DefineFixed(new(zone()) LCallStub, rax), instr); | 2380 return MarkAsCall(DefineFixed(new(zone()) LCallStub, rax), instr); |
2381 } | 2381 } |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2538 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2538 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2539 LOperand* object = UseRegister(instr->object()); | 2539 LOperand* object = UseRegister(instr->object()); |
2540 LOperand* index = UseTempRegister(instr->index()); | 2540 LOperand* index = UseTempRegister(instr->index()); |
2541 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2541 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2542 } | 2542 } |
2543 | 2543 |
2544 | 2544 |
2545 } } // namespace v8::internal | 2545 } } // namespace v8::internal |
2546 | 2546 |
2547 #endif // V8_TARGET_ARCH_X64 | 2547 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |