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