| 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 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 switch (constant.type()) { | 865 switch (constant.type()) { |
| 866 case Constant::kInt32: | 866 case Constant::kInt32: |
| 867 if (type.representation() == MachineRepresentation::kTagged || | 867 if (type.representation() == MachineRepresentation::kTagged || |
| 868 type.representation() == MachineRepresentation::kTaggedSigned) { | 868 type.representation() == MachineRepresentation::kTaggedSigned) { |
| 869 // When pointers are 4 bytes, we can use int32 constants to represent | 869 // When pointers are 4 bytes, we can use int32 constants to represent |
| 870 // Smis. | 870 // Smis. |
| 871 DCHECK_EQ(4, kPointerSize); | 871 DCHECK_EQ(4, kPointerSize); |
| 872 constant_object = | 872 constant_object = |
| 873 handle(reinterpret_cast<Smi*>(constant.ToInt32()), isolate()); | 873 handle(reinterpret_cast<Smi*>(constant.ToInt32()), isolate()); |
| 874 DCHECK(constant_object->IsSmi()); | 874 DCHECK(constant_object->IsSmi()); |
| 875 } else if (type.representation() == MachineRepresentation::kBit) { |
| 876 if (constant.ToInt32() == 0) { |
| 877 constant_object = isolate()->factory()->false_value(); |
| 878 } else { |
| 879 DCHECK_EQ(1, constant.ToInt32()); |
| 880 constant_object = isolate()->factory()->true_value(); |
| 881 } |
| 875 } else { | 882 } else { |
| 876 // TODO(jarin,bmeurer): We currently pass in raw pointers to the | 883 // TODO(jarin,bmeurer): We currently pass in raw pointers to the |
| 877 // JSFunction::entry here. We should really consider fixing this. | 884 // JSFunction::entry here. We should really consider fixing this. |
| 878 DCHECK(type == MachineType::Int32() || | 885 DCHECK(type == MachineType::Int32() || |
| 879 type == MachineType::Uint32() || | 886 type == MachineType::Uint32() || |
| 880 type.representation() == MachineRepresentation::kBit || | |
| 881 type.representation() == MachineRepresentation::kWord32 || | 887 type.representation() == MachineRepresentation::kWord32 || |
| 882 type.representation() == MachineRepresentation::kNone); | 888 type.representation() == MachineRepresentation::kNone); |
| 883 DCHECK(type.representation() != MachineRepresentation::kNone || | 889 DCHECK(type.representation() != MachineRepresentation::kNone || |
| 884 constant.ToInt32() == FrameStateDescriptor::kImpossibleValue); | 890 constant.ToInt32() == FrameStateDescriptor::kImpossibleValue); |
| 885 | 891 |
| 886 constant_object = | 892 constant_object = |
| 887 isolate()->factory()->NewNumberFromInt(constant.ToInt32()); | 893 isolate()->factory()->NewNumberFromInt(constant.ToInt32()); |
| 888 } | 894 } |
| 889 break; | 895 break; |
| 890 case Constant::kInt64: | 896 case Constant::kInt64: |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { | 961 : frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { |
| 956 gen->ools_ = this; | 962 gen->ools_ = this; |
| 957 } | 963 } |
| 958 | 964 |
| 959 | 965 |
| 960 OutOfLineCode::~OutOfLineCode() {} | 966 OutOfLineCode::~OutOfLineCode() {} |
| 961 | 967 |
| 962 } // namespace compiler | 968 } // namespace compiler |
| 963 } // namespace internal | 969 } // namespace internal |
| 964 } // namespace v8 | 970 } // namespace v8 |
| OLD | NEW |