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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 switch (constant.type()) { | 851 switch (constant.type()) { |
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 if (type.representation() == MachineRepresentation::kBit) { | |
862 if (constant.ToInt32() == 0) { | |
863 constant_object = isolate()->factory()->false_value(); | |
864 } else { | |
865 DCHECK_EQ(1, constant.ToInt32()); | |
866 constant_object = isolate()->factory()->true_value(); | |
867 } | |
868 } else { | 861 } else { |
869 // TODO(jarin,bmeurer): We currently pass in raw pointers to the | 862 // TODO(jarin,bmeurer): We currently pass in raw pointers to the |
870 // JSFunction::entry here. We should really consider fixing this. | 863 // JSFunction::entry here. We should really consider fixing this. |
871 DCHECK(type == MachineType::Int32() || | 864 DCHECK(type == MachineType::Int32() || |
872 type == MachineType::Uint32() || | 865 type == MachineType::Uint32() || |
| 866 type.representation() == MachineRepresentation::kBit || |
873 type.representation() == MachineRepresentation::kWord32 || | 867 type.representation() == MachineRepresentation::kWord32 || |
874 type.representation() == MachineRepresentation::kNone); | 868 type.representation() == MachineRepresentation::kNone); |
875 DCHECK(type.representation() != MachineRepresentation::kNone || | 869 DCHECK(type.representation() != MachineRepresentation::kNone || |
876 constant.ToInt32() == FrameStateDescriptor::kImpossibleValue); | 870 constant.ToInt32() == FrameStateDescriptor::kImpossibleValue); |
877 | 871 |
878 constant_object = | 872 constant_object = |
879 isolate()->factory()->NewNumberFromInt(constant.ToInt32()); | 873 isolate()->factory()->NewNumberFromInt(constant.ToInt32()); |
880 } | 874 } |
881 break; | 875 break; |
882 case Constant::kInt64: | 876 case Constant::kInt64: |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { | 941 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { |
948 gen->ools_ = this; | 942 gen->ools_ = this; |
949 } | 943 } |
950 | 944 |
951 | 945 |
952 OutOfLineCode::~OutOfLineCode() {} | 946 OutOfLineCode::~OutOfLineCode() {} |
953 | 947 |
954 } // namespace compiler | 948 } // namespace compiler |
955 } // namespace internal | 949 } // namespace internal |
956 } // namespace v8 | 950 } // namespace v8 |
OLD | NEW |