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 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 // When pointers are 8 bytes, we can use int64 constants to represent | 873 // When pointers are 8 bytes, we can use int64 constants to represent |
874 // Smis. | 874 // Smis. |
875 DCHECK(type.representation() == MachineRepresentation::kTagged || | 875 DCHECK(type.representation() == MachineRepresentation::kTagged || |
876 type.representation() == MachineRepresentation::kTaggedSigned); | 876 type.representation() == MachineRepresentation::kTaggedSigned); |
877 DCHECK_EQ(8, kPointerSize); | 877 DCHECK_EQ(8, kPointerSize); |
878 constant_object = | 878 constant_object = |
879 handle(reinterpret_cast<Smi*>(constant.ToInt64()), isolate()); | 879 handle(reinterpret_cast<Smi*>(constant.ToInt64()), isolate()); |
880 DCHECK(constant_object->IsSmi()); | 880 DCHECK(constant_object->IsSmi()); |
881 break; | 881 break; |
882 case Constant::kFloat32: | 882 case Constant::kFloat32: |
883 DCHECK(type.representation() == MachineRepresentation::kFloat32 || | 883 if (type.representation() == MachineRepresentation::kTaggedSigned) { |
884 CanBeTaggedPointer(type.representation())); | 884 DCHECK(IsSmiDouble(constant.ToFloat32())); |
| 885 } else { |
| 886 DCHECK(type.representation() == MachineRepresentation::kFloat32 || |
| 887 CanBeTaggedPointer(type.representation())); |
| 888 } |
885 constant_object = isolate()->factory()->NewNumber(constant.ToFloat32()); | 889 constant_object = isolate()->factory()->NewNumber(constant.ToFloat32()); |
886 break; | 890 break; |
887 case Constant::kFloat64: | 891 case Constant::kFloat64: |
888 DCHECK(type.representation() == MachineRepresentation::kFloat64 || | 892 if (type.representation() == MachineRepresentation::kTaggedSigned) { |
889 CanBeTaggedPointer(type.representation())); | 893 DCHECK(IsSmiDouble(constant.ToFloat64())); |
| 894 } else { |
| 895 DCHECK(type.representation() == MachineRepresentation::kFloat64 || |
| 896 CanBeTaggedPointer(type.representation())); |
| 897 } |
890 constant_object = isolate()->factory()->NewNumber(constant.ToFloat64()); | 898 constant_object = isolate()->factory()->NewNumber(constant.ToFloat64()); |
891 break; | 899 break; |
892 case Constant::kHeapObject: | 900 case Constant::kHeapObject: |
893 DCHECK(CanBeTaggedPointer(type.representation())); | 901 DCHECK(CanBeTaggedPointer(type.representation())); |
894 constant_object = constant.ToHeapObject(); | 902 constant_object = constant.ToHeapObject(); |
895 break; | 903 break; |
896 default: | 904 default: |
897 CHECK(false); | 905 CHECK(false); |
898 } | 906 } |
899 if (constant_object.is_identical_to(info()->closure())) { | 907 if (constant_object.is_identical_to(info()->closure())) { |
(...skipping 26 matching lines...) Expand all Loading... |
926 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { | 934 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { |
927 gen->ools_ = this; | 935 gen->ools_ = this; |
928 } | 936 } |
929 | 937 |
930 | 938 |
931 OutOfLineCode::~OutOfLineCode() {} | 939 OutOfLineCode::~OutOfLineCode() {} |
932 | 940 |
933 } // namespace compiler | 941 } // namespace compiler |
934 } // namespace internal | 942 } // namespace internal |
935 } // namespace v8 | 943 } // namespace v8 |
OLD | NEW |