| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/crankshaft/hydrogen-instructions.h" | 5 #include "src/crankshaft/hydrogen-instructions.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/ieee754.h" | 8 #include "src/base/ieee754.h" |
| 9 #include "src/base/safe_math.h" | 9 #include "src/base/safe_math.h" |
| 10 #include "src/codegen.h" |
| 10 #include "src/crankshaft/hydrogen-infer-representation.h" | 11 #include "src/crankshaft/hydrogen-infer-representation.h" |
| 11 #include "src/double.h" | 12 #include "src/double.h" |
| 12 #include "src/elements.h" | 13 #include "src/elements.h" |
| 13 #include "src/factory.h" | 14 #include "src/factory.h" |
| 14 | 15 |
| 15 #if V8_TARGET_ARCH_IA32 | 16 #if V8_TARGET_ARCH_IA32 |
| 16 #include "src/crankshaft/ia32/lithium-ia32.h" // NOLINT | 17 #include "src/crankshaft/ia32/lithium-ia32.h" // NOLINT |
| 17 #elif V8_TARGET_ARCH_X64 | 18 #elif V8_TARGET_ARCH_X64 |
| 18 #include "src/crankshaft/x64/lithium-x64.h" // NOLINT | 19 #include "src/crankshaft/x64/lithium-x64.h" // NOLINT |
| 19 #elif V8_TARGET_ARCH_ARM64 | 20 #elif V8_TARGET_ARCH_ARM64 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 37 namespace v8 { | 38 namespace v8 { |
| 38 namespace internal { | 39 namespace internal { |
| 39 | 40 |
| 40 #define DEFINE_COMPILE(type) \ | 41 #define DEFINE_COMPILE(type) \ |
| 41 LInstruction* H##type::CompileToLithium(LChunkBuilder* builder) { \ | 42 LInstruction* H##type::CompileToLithium(LChunkBuilder* builder) { \ |
| 42 return builder->Do##type(this); \ | 43 return builder->Do##type(this); \ |
| 43 } | 44 } |
| 44 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE) | 45 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE) |
| 45 #undef DEFINE_COMPILE | 46 #undef DEFINE_COMPILE |
| 46 | 47 |
| 48 Representation RepresentationFromMachineType(MachineType type) { |
| 49 if (type == MachineType::Int32()) { |
| 50 return Representation::Integer32(); |
| 51 } |
| 52 |
| 53 if (type == MachineType::TaggedSigned()) { |
| 54 return Representation::Smi(); |
| 55 } |
| 56 |
| 57 if (type == MachineType::Pointer()) { |
| 58 return Representation::External(); |
| 59 } |
| 60 |
| 61 return Representation::Tagged(); |
| 62 } |
| 47 | 63 |
| 48 Isolate* HValue::isolate() const { | 64 Isolate* HValue::isolate() const { |
| 49 DCHECK(block() != NULL); | 65 DCHECK(block() != NULL); |
| 50 return block()->isolate(); | 66 return block()->isolate(); |
| 51 } | 67 } |
| 52 | 68 |
| 53 | 69 |
| 54 void HValue::AssumeRepresentation(Representation r) { | 70 void HValue::AssumeRepresentation(Representation r) { |
| 55 if (CheckFlag(kFlexibleRepresentation)) { | 71 if (CheckFlag(kFlexibleRepresentation)) { |
| 56 ChangeRepresentation(r); | 72 ChangeRepresentation(r); |
| (...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 } | 1065 } |
| 1050 | 1066 |
| 1051 | 1067 |
| 1052 std::ostream& HReturn::PrintDataTo(std::ostream& os) const { // NOLINT | 1068 std::ostream& HReturn::PrintDataTo(std::ostream& os) const { // NOLINT |
| 1053 return os << NameOf(value()) << " (pop " << NameOf(parameter_count()) | 1069 return os << NameOf(value()) << " (pop " << NameOf(parameter_count()) |
| 1054 << " values)"; | 1070 << " values)"; |
| 1055 } | 1071 } |
| 1056 | 1072 |
| 1057 | 1073 |
| 1058 Representation HBranch::observed_input_representation(int index) { | 1074 Representation HBranch::observed_input_representation(int index) { |
| 1059 if (expected_input_types_.Contains(ToBooleanICStub::NULL_TYPE) || | 1075 if (expected_input_types_ & (ToBooleanHint::kNull | ToBooleanHint::kReceiver | |
| 1060 expected_input_types_.Contains(ToBooleanICStub::SPEC_OBJECT) || | 1076 ToBooleanHint::kString | ToBooleanHint::kSymbol | |
| 1061 expected_input_types_.Contains(ToBooleanICStub::STRING) || | 1077 ToBooleanHint::kSimdValue)) { |
| 1062 expected_input_types_.Contains(ToBooleanICStub::SYMBOL) || | |
| 1063 expected_input_types_.Contains(ToBooleanICStub::SIMD_VALUE)) { | |
| 1064 return Representation::Tagged(); | 1078 return Representation::Tagged(); |
| 1065 } | 1079 } |
| 1066 if (expected_input_types_.Contains(ToBooleanICStub::UNDEFINED)) { | 1080 if (expected_input_types_ & ToBooleanHint::kUndefined) { |
| 1067 if (expected_input_types_.Contains(ToBooleanICStub::HEAP_NUMBER)) { | 1081 if (expected_input_types_ & ToBooleanHint::kHeapNumber) { |
| 1068 return Representation::Double(); | 1082 return Representation::Double(); |
| 1069 } | 1083 } |
| 1070 return Representation::Tagged(); | 1084 return Representation::Tagged(); |
| 1071 } | 1085 } |
| 1072 if (expected_input_types_.Contains(ToBooleanICStub::HEAP_NUMBER)) { | 1086 if (expected_input_types_ & ToBooleanHint::kHeapNumber) { |
| 1073 return Representation::Double(); | 1087 return Representation::Double(); |
| 1074 } | 1088 } |
| 1075 if (expected_input_types_.Contains(ToBooleanICStub::SMI)) { | 1089 if (expected_input_types_ & ToBooleanHint::kSmallInteger) { |
| 1076 return Representation::Smi(); | 1090 return Representation::Smi(); |
| 1077 } | 1091 } |
| 1078 return Representation::None(); | 1092 return Representation::None(); |
| 1079 } | 1093 } |
| 1080 | 1094 |
| 1081 | 1095 |
| 1082 bool HBranch::KnownSuccessorBlock(HBasicBlock** block) { | 1096 bool HBranch::KnownSuccessorBlock(HBasicBlock** block) { |
| 1083 HValue* value = this->value(); | 1097 HValue* value = this->value(); |
| 1084 if (value->EmitAtUses()) { | 1098 if (value->EmitAtUses()) { |
| 1085 DCHECK(value->IsConstant()); | 1099 DCHECK(value->IsConstant()); |
| (...skipping 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4032 case HObjectAccess::kExternalMemory: | 4046 case HObjectAccess::kExternalMemory: |
| 4033 os << "[external-memory]"; | 4047 os << "[external-memory]"; |
| 4034 break; | 4048 break; |
| 4035 } | 4049 } |
| 4036 | 4050 |
| 4037 return os << "@" << access.offset(); | 4051 return os << "@" << access.offset(); |
| 4038 } | 4052 } |
| 4039 | 4053 |
| 4040 } // namespace internal | 4054 } // namespace internal |
| 4041 } // namespace v8 | 4055 } // namespace v8 |
| OLD | NEW |