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/address-map.h" | 7 #include "src/address-map.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
10 #include "src/compiler/pipeline.h" | 10 #include "src/compiler/pipeline.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 if (!descriptor->state_combine().IsOutputIgnored()) { | 526 if (!descriptor->state_combine().IsOutputIgnored()) { |
527 deopt_state_id = BuildTranslation(instr, -1, frame_state_offset, | 527 deopt_state_id = BuildTranslation(instr, -1, frame_state_offset, |
528 OutputFrameStateCombine::Ignore()); | 528 OutputFrameStateCombine::Ignore()); |
529 } | 529 } |
530 #if DEBUG | 530 #if DEBUG |
531 // Make sure all the values live in stack slots or they are immediates. | 531 // Make sure all the values live in stack slots or they are immediates. |
532 // (The values should not live in register because registers are clobbered | 532 // (The values should not live in register because registers are clobbered |
533 // by calls.) | 533 // by calls.) |
534 for (size_t i = 0; i < descriptor->GetSize(); i++) { | 534 for (size_t i = 0; i < descriptor->GetSize(); i++) { |
535 InstructionOperand* op = instr->InputAt(frame_state_offset + 1 + i); | 535 InstructionOperand* op = instr->InputAt(frame_state_offset + 1 + i); |
536 CHECK(op->IsStackSlot() || op->IsDoubleStackSlot() || op->IsImmediate()); | 536 CHECK(op->IsStackSlot() || op->IsFPStackSlot() || op->IsImmediate()); |
537 } | 537 } |
538 #endif | 538 #endif |
539 safepoints()->RecordLazyDeoptimizationIndex(deopt_state_id); | 539 safepoints()->RecordLazyDeoptimizationIndex(deopt_state_id); |
540 } | 540 } |
541 } | 541 } |
542 | 542 |
543 | 543 |
544 int CodeGenerator::DefineDeoptimizationLiteral(Handle<Object> literal) { | 544 int CodeGenerator::DefineDeoptimizationLiteral(Handle<Object> literal) { |
545 int result = static_cast<int>(deoptimization_literals_.size()); | 545 int result = static_cast<int>(deoptimization_literals_.size()); |
546 for (unsigned i = 0; i < deoptimization_literals_.size(); ++i) { | 546 for (unsigned i = 0; i < deoptimization_literals_.size(); ++i) { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 type == MachineType::Int32()) { | 708 type == MachineType::Int32()) { |
709 translation->StoreInt32StackSlot(LocationOperand::cast(op)->index()); | 709 translation->StoreInt32StackSlot(LocationOperand::cast(op)->index()); |
710 } else if (type == MachineType::Uint8() || type == MachineType::Uint16() || | 710 } else if (type == MachineType::Uint8() || type == MachineType::Uint16() || |
711 type == MachineType::Uint32()) { | 711 type == MachineType::Uint32()) { |
712 translation->StoreUint32StackSlot(LocationOperand::cast(op)->index()); | 712 translation->StoreUint32StackSlot(LocationOperand::cast(op)->index()); |
713 } else if (type.representation() == MachineRepresentation::kTagged) { | 713 } else if (type.representation() == MachineRepresentation::kTagged) { |
714 translation->StoreStackSlot(LocationOperand::cast(op)->index()); | 714 translation->StoreStackSlot(LocationOperand::cast(op)->index()); |
715 } else { | 715 } else { |
716 CHECK(false); | 716 CHECK(false); |
717 } | 717 } |
718 } else if (op->IsDoubleStackSlot()) { | 718 } else if (op->IsFPStackSlot()) { |
719 DCHECK(IsFloatingPoint(type.representation())); | 719 DCHECK(IsFloatingPoint(type.representation())); |
720 translation->StoreDoubleStackSlot(LocationOperand::cast(op)->index()); | 720 translation->StoreDoubleStackSlot(LocationOperand::cast(op)->index()); |
721 } else if (op->IsRegister()) { | 721 } else if (op->IsRegister()) { |
722 InstructionOperandConverter converter(this, instr); | 722 InstructionOperandConverter converter(this, instr); |
723 if (type.representation() == MachineRepresentation::kBit) { | 723 if (type.representation() == MachineRepresentation::kBit) { |
724 translation->StoreBoolRegister(converter.ToRegister(op)); | 724 translation->StoreBoolRegister(converter.ToRegister(op)); |
725 } else if (type == MachineType::Int8() || type == MachineType::Int16() || | 725 } else if (type == MachineType::Int8() || type == MachineType::Int16() || |
726 type == MachineType::Int32()) { | 726 type == MachineType::Int32()) { |
727 translation->StoreInt32Register(converter.ToRegister(op)); | 727 translation->StoreInt32Register(converter.ToRegister(op)); |
728 } else if (type == MachineType::Uint8() || type == MachineType::Uint16() || | 728 } else if (type == MachineType::Uint8() || type == MachineType::Uint16() || |
729 type == MachineType::Uint32()) { | 729 type == MachineType::Uint32()) { |
730 translation->StoreUint32Register(converter.ToRegister(op)); | 730 translation->StoreUint32Register(converter.ToRegister(op)); |
731 } else if (type.representation() == MachineRepresentation::kTagged) { | 731 } else if (type.representation() == MachineRepresentation::kTagged) { |
732 translation->StoreRegister(converter.ToRegister(op)); | 732 translation->StoreRegister(converter.ToRegister(op)); |
733 } else { | 733 } else { |
734 CHECK(false); | 734 CHECK(false); |
735 } | 735 } |
736 } else if (op->IsDoubleRegister()) { | 736 } else if (op->IsFPRegister()) { |
737 DCHECK(IsFloatingPoint(type.representation())); | 737 DCHECK(IsFloatingPoint(type.representation())); |
738 InstructionOperandConverter converter(this, instr); | 738 InstructionOperandConverter converter(this, instr); |
739 translation->StoreDoubleRegister(converter.ToDoubleRegister(op)); | 739 translation->StoreDoubleRegister(converter.ToDoubleRegister(op)); |
740 } else if (op->IsImmediate()) { | 740 } else if (op->IsImmediate()) { |
741 InstructionOperandConverter converter(this, instr); | 741 InstructionOperandConverter converter(this, instr); |
742 Constant constant = converter.ToConstant(op); | 742 Constant constant = converter.ToConstant(op); |
743 Handle<Object> constant_object; | 743 Handle<Object> constant_object; |
744 switch (constant.type()) { | 744 switch (constant.type()) { |
745 case Constant::kInt32: | 745 case Constant::kInt32: |
746 DCHECK(type == MachineType::Int32() || type == MachineType::Uint32() || | 746 DCHECK(type == MachineType::Int32() || type == MachineType::Uint32() || |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { | 807 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { |
808 gen->ools_ = this; | 808 gen->ools_ = this; |
809 } | 809 } |
810 | 810 |
811 | 811 |
812 OutOfLineCode::~OutOfLineCode() {} | 812 OutOfLineCode::~OutOfLineCode() {} |
813 | 813 |
814 } // namespace compiler | 814 } // namespace compiler |
815 } // namespace internal | 815 } // namespace internal |
816 } // namespace v8 | 816 } // namespace v8 |
OLD | NEW |