| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
| 8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
| 9 #include "src/compiler/pipeline.h" | 9 #include "src/compiler/pipeline.h" |
| 10 | 10 |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 | 521 |
| 522 return deoptimization_id; | 522 return deoptimization_id; |
| 523 } | 523 } |
| 524 | 524 |
| 525 | 525 |
| 526 void CodeGenerator::AddTranslationForOperand(Translation* translation, | 526 void CodeGenerator::AddTranslationForOperand(Translation* translation, |
| 527 Instruction* instr, | 527 Instruction* instr, |
| 528 InstructionOperand* op, | 528 InstructionOperand* op, |
| 529 MachineType type) { | 529 MachineType type) { |
| 530 if (op->IsStackSlot()) { | 530 if (op->IsStackSlot()) { |
| 531 // TODO(jarin) kMachBool and kRepBit should materialize true and false | 531 if (type == kMachBool || type == kRepBit) { |
| 532 // rather than creating an int value. | 532 translation->StoreBoolStackSlot(StackSlotOperand::cast(op)->index()); |
| 533 if (type == kMachBool || type == kRepBit || type == kMachInt32 || | 533 } else if (type == kMachInt32 || type == kMachInt8 || type == kMachInt16) { |
| 534 type == kMachInt8 || type == kMachInt16) { | |
| 535 translation->StoreInt32StackSlot(StackSlotOperand::cast(op)->index()); | 534 translation->StoreInt32StackSlot(StackSlotOperand::cast(op)->index()); |
| 536 } else if (type == kMachUint32 || type == kMachUint16 || | 535 } else if (type == kMachUint32 || type == kMachUint16 || |
| 537 type == kMachUint8) { | 536 type == kMachUint8) { |
| 538 translation->StoreUint32StackSlot(StackSlotOperand::cast(op)->index()); | 537 translation->StoreUint32StackSlot(StackSlotOperand::cast(op)->index()); |
| 539 } else if ((type & kRepMask) == kRepTagged) { | 538 } else if ((type & kRepMask) == kRepTagged) { |
| 540 translation->StoreStackSlot(StackSlotOperand::cast(op)->index()); | 539 translation->StoreStackSlot(StackSlotOperand::cast(op)->index()); |
| 541 } else { | 540 } else { |
| 542 CHECK(false); | 541 CHECK(false); |
| 543 } | 542 } |
| 544 } else if (op->IsDoubleStackSlot()) { | 543 } else if (op->IsDoubleStackSlot()) { |
| 545 DCHECK((type & (kRepFloat32 | kRepFloat64)) != 0); | 544 DCHECK((type & (kRepFloat32 | kRepFloat64)) != 0); |
| 546 translation->StoreDoubleStackSlot( | 545 translation->StoreDoubleStackSlot( |
| 547 DoubleStackSlotOperand::cast(op)->index()); | 546 DoubleStackSlotOperand::cast(op)->index()); |
| 548 } else if (op->IsRegister()) { | 547 } else if (op->IsRegister()) { |
| 549 InstructionOperandConverter converter(this, instr); | 548 InstructionOperandConverter converter(this, instr); |
| 550 // TODO(jarin) kMachBool and kRepBit should materialize true and false | 549 if (type == kMachBool || type == kRepBit) { |
| 551 // rather than creating an int value. | 550 translation->StoreBoolRegister(converter.ToRegister(op)); |
| 552 if (type == kMachBool || type == kRepBit || type == kMachInt32 || | 551 } else if (type == kMachInt32 || type == kMachInt8 || type == kMachInt16) { |
| 553 type == kMachInt8 || type == kMachInt16) { | |
| 554 translation->StoreInt32Register(converter.ToRegister(op)); | 552 translation->StoreInt32Register(converter.ToRegister(op)); |
| 555 } else if (type == kMachUint32 || type == kMachUint16 || | 553 } else if (type == kMachUint32 || type == kMachUint16 || |
| 556 type == kMachUint8) { | 554 type == kMachUint8) { |
| 557 translation->StoreUint32Register(converter.ToRegister(op)); | 555 translation->StoreUint32Register(converter.ToRegister(op)); |
| 558 } else if ((type & kRepMask) == kRepTagged) { | 556 } else if ((type & kRepMask) == kRepTagged) { |
| 559 translation->StoreRegister(converter.ToRegister(op)); | 557 translation->StoreRegister(converter.ToRegister(op)); |
| 560 } else { | 558 } else { |
| 561 CHECK(false); | 559 CHECK(false); |
| 562 } | 560 } |
| 563 } else if (op->IsDoubleRegister()) { | 561 } else if (op->IsDoubleRegister()) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 : masm_(gen->masm()), next_(gen->ools_) { | 658 : masm_(gen->masm()), next_(gen->ools_) { |
| 661 gen->ools_ = this; | 659 gen->ools_ = this; |
| 662 } | 660 } |
| 663 | 661 |
| 664 | 662 |
| 665 OutOfLineCode::~OutOfLineCode() {} | 663 OutOfLineCode::~OutOfLineCode() {} |
| 666 | 664 |
| 667 } // namespace compiler | 665 } // namespace compiler |
| 668 } // namespace internal | 666 } // namespace internal |
| 669 } // namespace v8 | 667 } // namespace v8 |
| OLD | NEW |