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/base/adapters.h" | 8 #include "src/base/adapters.h" |
9 #include "src/compiler/code-generator-impl.h" | 9 #include "src/compiler/code-generator-impl.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
857 } else { | 857 } else { |
858 DCHECK_EQ(MachineRepresentation::kFloat32, type.representation()); | 858 DCHECK_EQ(MachineRepresentation::kFloat32, type.representation()); |
859 translation->StoreFloatRegister(converter.ToFloatRegister(op)); | 859 translation->StoreFloatRegister(converter.ToFloatRegister(op)); |
860 } | 860 } |
861 } else if (op->IsImmediate()) { | 861 } else if (op->IsImmediate()) { |
862 InstructionOperandConverter converter(this, instr); | 862 InstructionOperandConverter converter(this, instr); |
863 Constant constant = converter.ToConstant(op); | 863 Constant constant = converter.ToConstant(op); |
864 Handle<Object> constant_object; | 864 Handle<Object> constant_object; |
865 switch (constant.type()) { | 865 switch (constant.type()) { |
866 case Constant::kInt32: | 866 case Constant::kInt32: |
867 DCHECK(type == MachineType::Int32() || type == MachineType::Uint32() || | 867 if (type.representation() == MachineRepresentation::kTagged) { |
Benedikt Meurer
2016/08/01 17:33:44
As discussed offline, this should only ever happen
| |
868 type.representation() == MachineRepresentation::kBit || | 868 constant_object = |
869 type.representation() == MachineRepresentation::kNone); | 869 handle(reinterpret_cast<Smi*>(constant.ToInt32()), isolate()); |
870 DCHECK(type.representation() != MachineRepresentation::kNone || | 870 } else { |
871 constant.ToInt32() == FrameStateDescriptor::kImpossibleValue); | 871 DCHECK(type == MachineType::Int32() || |
872 type == MachineType::Uint32() || | |
873 type.representation() == MachineRepresentation::kBit || | |
874 type.representation() == MachineRepresentation::kNone); | |
875 DCHECK(type.representation() != MachineRepresentation::kNone || | |
876 constant.ToInt32() == FrameStateDescriptor::kImpossibleValue); | |
872 | 877 |
873 constant_object = | 878 constant_object = |
874 isolate()->factory()->NewNumberFromInt(constant.ToInt32()); | 879 isolate()->factory()->NewNumberFromInt(constant.ToInt32()); |
880 } | |
875 break; | 881 break; |
876 case Constant::kFloat32: | 882 case Constant::kFloat32: |
877 DCHECK(type.representation() == MachineRepresentation::kFloat32 || | 883 DCHECK(type.representation() == MachineRepresentation::kFloat32 || |
878 type.representation() == MachineRepresentation::kTagged); | 884 type.representation() == MachineRepresentation::kTagged); |
879 constant_object = isolate()->factory()->NewNumber(constant.ToFloat32()); | 885 constant_object = isolate()->factory()->NewNumber(constant.ToFloat32()); |
880 break; | 886 break; |
881 case Constant::kFloat64: | 887 case Constant::kFloat64: |
882 DCHECK(type.representation() == MachineRepresentation::kFloat64 || | 888 DCHECK(type.representation() == MachineRepresentation::kFloat64 || |
883 type.representation() == MachineRepresentation::kTagged); | 889 type.representation() == MachineRepresentation::kTagged); |
884 constant_object = isolate()->factory()->NewNumber(constant.ToFloat64()); | 890 constant_object = isolate()->factory()->NewNumber(constant.ToFloat64()); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
920 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { | 926 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { |
921 gen->ools_ = this; | 927 gen->ools_ = this; |
922 } | 928 } |
923 | 929 |
924 | 930 |
925 OutOfLineCode::~OutOfLineCode() {} | 931 OutOfLineCode::~OutOfLineCode() {} |
926 | 932 |
927 } // namespace compiler | 933 } // namespace compiler |
928 } // namespace internal | 934 } // namespace internal |
929 } // namespace v8 | 935 } // namespace v8 |
OLD | NEW |