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/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 case Constant::kInt32: | 852 case Constant::kInt32: |
853 if (type.representation() == MachineRepresentation::kTagged || | 853 if (type.representation() == MachineRepresentation::kTagged || |
854 type.representation() == MachineRepresentation::kTaggedSigned) { | 854 type.representation() == MachineRepresentation::kTaggedSigned) { |
855 // When pointers are 4 bytes, we can use int32 constants to represent | 855 // When pointers are 4 bytes, we can use int32 constants to represent |
856 // Smis. | 856 // Smis. |
857 DCHECK_EQ(4, kPointerSize); | 857 DCHECK_EQ(4, kPointerSize); |
858 constant_object = | 858 constant_object = |
859 handle(reinterpret_cast<Smi*>(constant.ToInt32()), isolate()); | 859 handle(reinterpret_cast<Smi*>(constant.ToInt32()), isolate()); |
860 DCHECK(constant_object->IsSmi()); | 860 DCHECK(constant_object->IsSmi()); |
861 } else { | 861 } else { |
| 862 // TODO(jarin,bmeurer): We currently pass in raw pointers to the |
| 863 // JSFunction::entry here. We should really consider fixing this. |
862 DCHECK(type == MachineType::Int32() || | 864 DCHECK(type == MachineType::Int32() || |
863 type == MachineType::Uint32() || | 865 type == MachineType::Uint32() || |
864 type.representation() == MachineRepresentation::kBit || | 866 type.representation() == MachineRepresentation::kBit || |
| 867 type.representation() == MachineRepresentation::kWord32 || |
865 type.representation() == MachineRepresentation::kNone); | 868 type.representation() == MachineRepresentation::kNone); |
866 DCHECK(type.representation() != MachineRepresentation::kNone || | 869 DCHECK(type.representation() != MachineRepresentation::kNone || |
867 constant.ToInt32() == FrameStateDescriptor::kImpossibleValue); | 870 constant.ToInt32() == FrameStateDescriptor::kImpossibleValue); |
868 | 871 |
869 constant_object = | 872 constant_object = |
870 isolate()->factory()->NewNumberFromInt(constant.ToInt32()); | 873 isolate()->factory()->NewNumberFromInt(constant.ToInt32()); |
871 } | 874 } |
872 break; | 875 break; |
873 case Constant::kInt64: | 876 case Constant::kInt64: |
874 // When pointers are 8 bytes, we can use int64 constants to represent | 877 // When pointers are 8 bytes, we can use int64 constants to represent |
875 // Smis. | 878 // Smis. |
876 DCHECK(type.representation() == MachineRepresentation::kTagged || | 879 // TODO(jarin,bmeurer): We currently pass in raw pointers to the |
| 880 // JSFunction::entry here. We should really consider fixing this. |
| 881 DCHECK(type.representation() == MachineRepresentation::kWord64 || |
| 882 type.representation() == MachineRepresentation::kTagged || |
877 type.representation() == MachineRepresentation::kTaggedSigned); | 883 type.representation() == MachineRepresentation::kTaggedSigned); |
878 DCHECK_EQ(8, kPointerSize); | 884 DCHECK_EQ(8, kPointerSize); |
879 constant_object = | 885 constant_object = |
880 handle(reinterpret_cast<Smi*>(constant.ToInt64()), isolate()); | 886 handle(reinterpret_cast<Smi*>(constant.ToInt64()), isolate()); |
881 DCHECK(constant_object->IsSmi()); | 887 DCHECK(constant_object->IsSmi()); |
882 break; | 888 break; |
883 case Constant::kFloat32: | 889 case Constant::kFloat32: |
884 if (type.representation() == MachineRepresentation::kTaggedSigned) { | 890 if (type.representation() == MachineRepresentation::kTaggedSigned) { |
885 DCHECK(IsSmiDouble(constant.ToFloat32())); | 891 DCHECK(IsSmiDouble(constant.ToFloat32())); |
886 } else { | 892 } else { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { | 941 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { |
936 gen->ools_ = this; | 942 gen->ools_ = this; |
937 } | 943 } |
938 | 944 |
939 | 945 |
940 OutOfLineCode::~OutOfLineCode() {} | 946 OutOfLineCode::~OutOfLineCode() {} |
941 | 947 |
942 } // namespace compiler | 948 } // namespace compiler |
943 } // namespace internal | 949 } // namespace internal |
944 } // namespace v8 | 950 } // namespace v8 |
OLD | NEW |