Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: src/arm/lithium-arm.cc

Issue 20843012: Extract hardcoded error strings into a single place and replace them with enum. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: styles fixed Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 HBasicBlock* next = NULL; 430 HBasicBlock* next = NULL;
431 if (i < blocks->length() - 1) next = blocks->at(i + 1); 431 if (i < blocks->length() - 1) next = blocks->at(i + 1);
432 DoBasicBlock(blocks->at(i), next); 432 DoBasicBlock(blocks->at(i), next);
433 if (is_aborted()) return NULL; 433 if (is_aborted()) return NULL;
434 } 434 }
435 status_ = DONE; 435 status_ = DONE;
436 return chunk_; 436 return chunk_;
437 } 437 }
438 438
439 439
440 void LChunkBuilder::Abort(const char* reason) { 440 void LChunkBuilder::Abort(BailoutReason reason) {
441 info()->set_bailout_reason(reason); 441 info()->set_bailout_reason(reason);
442 status_ = ABORTED; 442 status_ = ABORTED;
443 } 443 }
444 444
445 445
446 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) { 446 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) {
447 return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER, 447 return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER,
448 Register::ToAllocationIndex(reg)); 448 Register::ToAllocationIndex(reg));
449 } 449 }
450 450
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 instr->set_pointer_map(new(zone()) LPointerMap(position_, zone())); 638 instr->set_pointer_map(new(zone()) LPointerMap(position_, zone()));
639 return instr; 639 return instr;
640 } 640 }
641 641
642 642
643 LUnallocated* LChunkBuilder::TempRegister() { 643 LUnallocated* LChunkBuilder::TempRegister() {
644 LUnallocated* operand = 644 LUnallocated* operand =
645 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER); 645 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER);
646 int vreg = allocator_->GetVirtualRegister(); 646 int vreg = allocator_->GetVirtualRegister();
647 if (!allocator_->AllocationOk()) { 647 if (!allocator_->AllocationOk()) {
648 Abort("Out of virtual registers while trying to allocate temp register."); 648 Abort(kOutOfVirtualRegistersWhileTryingToAllocateTempRegister);
649 vreg = 0; 649 vreg = 0;
650 } 650 }
651 operand->set_virtual_register(vreg); 651 operand->set_virtual_register(vreg);
652 return operand; 652 return operand;
653 } 653 }
654 654
655 655
656 LOperand* LChunkBuilder::FixedTemp(Register reg) { 656 LOperand* LChunkBuilder::FixedTemp(Register reg) {
657 LUnallocated* operand = ToUnallocated(reg); 657 LUnallocated* operand = ToUnallocated(reg);
658 ASSERT(operand->HasFixedPolicy()); 658 ASSERT(operand->HasFixedPolicy());
(...skipping 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after
2435 int index = static_cast<int>(instr->index()); 2435 int index = static_cast<int>(instr->index());
2436 Register reg = DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index); 2436 Register reg = DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index);
2437 return DefineFixed(result, reg); 2437 return DefineFixed(result, reg);
2438 } 2438 }
2439 } 2439 }
2440 2440
2441 2441
2442 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { 2442 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
2443 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. 2443 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width.
2444 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { 2444 if (spill_index > LUnallocated::kMaxFixedSlotIndex) {
2445 Abort("Too many spill slots needed for OSR"); 2445 Abort(kTooManySpillSlotsNeededForOSR);
2446 spill_index = 0; 2446 spill_index = 0;
2447 } 2447 }
2448 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); 2448 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index);
2449 } 2449 }
2450 2450
2451 2451
2452 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { 2452 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
2453 argument_count_ -= instr->argument_count(); 2453 argument_count_ -= instr->argument_count();
2454 return MarkAsCall(DefineFixed(new(zone()) LCallStub, r0), instr); 2454 return MarkAsCall(DefineFixed(new(zone()) LCallStub, r0), instr);
2455 } 2455 }
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2608 2608
2609 2609
2610 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2610 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2611 LOperand* object = UseRegister(instr->object()); 2611 LOperand* object = UseRegister(instr->object());
2612 LOperand* index = UseRegister(instr->index()); 2612 LOperand* index = UseRegister(instr->index());
2613 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2613 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2614 } 2614 }
2615 2615
2616 2616
2617 } } // namespace v8::internal 2617 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.h » ('j') | src/compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698