| 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/safe_math.h" | 8 #include "src/base/safe_math.h" |
| 9 #include "src/crankshaft/hydrogen-infer-representation.h" | 9 #include "src/crankshaft/hydrogen-infer-representation.h" |
| 10 #include "src/double.h" | 10 #include "src/double.h" |
| (...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 os << NameOf(value()) << " == " << type_literal()->ToCString().get(); | 1196 os << NameOf(value()) << " == " << type_literal()->ToCString().get(); |
| 1197 return HControlInstruction::PrintDataTo(os); | 1197 return HControlInstruction::PrintDataTo(os); |
| 1198 } | 1198 } |
| 1199 | 1199 |
| 1200 | 1200 |
| 1201 namespace { | 1201 namespace { |
| 1202 | 1202 |
| 1203 String* TypeOfString(HConstant* constant, Isolate* isolate) { | 1203 String* TypeOfString(HConstant* constant, Isolate* isolate) { |
| 1204 Heap* heap = isolate->heap(); | 1204 Heap* heap = isolate->heap(); |
| 1205 if (constant->HasNumberValue()) return heap->number_string(); | 1205 if (constant->HasNumberValue()) return heap->number_string(); |
| 1206 if (constant->IsUndetectable()) return heap->undefined_string(); | |
| 1207 if (constant->HasStringValue()) return heap->string_string(); | 1206 if (constant->HasStringValue()) return heap->string_string(); |
| 1208 switch (constant->GetInstanceType()) { | 1207 switch (constant->GetInstanceType()) { |
| 1209 case ODDBALL_TYPE: { | 1208 case ODDBALL_TYPE: { |
| 1210 Unique<Object> unique = constant->GetUnique(); | 1209 Unique<Object> unique = constant->GetUnique(); |
| 1211 if (unique.IsKnownGlobal(heap->true_value()) || | 1210 if (unique.IsKnownGlobal(heap->true_value()) || |
| 1212 unique.IsKnownGlobal(heap->false_value())) { | 1211 unique.IsKnownGlobal(heap->false_value())) { |
| 1213 return heap->boolean_string(); | 1212 return heap->boolean_string(); |
| 1214 } | 1213 } |
| 1215 if (unique.IsKnownGlobal(heap->null_value())) { | 1214 if (unique.IsKnownGlobal(heap->null_value())) { |
| 1216 return heap->object_string(); | 1215 return heap->object_string(); |
| 1217 } | 1216 } |
| 1218 DCHECK(unique.IsKnownGlobal(heap->undefined_value())); | 1217 DCHECK(unique.IsKnownGlobal(heap->undefined_value())); |
| 1219 return heap->undefined_string(); | 1218 return heap->undefined_string(); |
| 1220 } | 1219 } |
| 1221 case SYMBOL_TYPE: | 1220 case SYMBOL_TYPE: |
| 1222 return heap->symbol_string(); | 1221 return heap->symbol_string(); |
| 1223 case SIMD128_VALUE_TYPE: { | 1222 case SIMD128_VALUE_TYPE: { |
| 1224 Unique<Map> map = constant->ObjectMap(); | 1223 Unique<Map> map = constant->ObjectMap(); |
| 1225 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | 1224 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ |
| 1226 if (map.IsKnownGlobal(heap->type##_map())) { \ | 1225 if (map.IsKnownGlobal(heap->type##_map())) { \ |
| 1227 return heap->type##_string(); \ | 1226 return heap->type##_string(); \ |
| 1228 } | 1227 } |
| 1229 SIMD128_TYPES(SIMD128_TYPE) | 1228 SIMD128_TYPES(SIMD128_TYPE) |
| 1230 #undef SIMD128_TYPE | 1229 #undef SIMD128_TYPE |
| 1231 UNREACHABLE(); | 1230 UNREACHABLE(); |
| 1232 return nullptr; | 1231 return nullptr; |
| 1233 } | 1232 } |
| 1234 default: | 1233 default: |
| 1234 if (constant->IsUndetectable()) return heap->undefined_string(); |
| 1235 if (constant->IsCallable()) return heap->function_string(); | 1235 if (constant->IsCallable()) return heap->function_string(); |
| 1236 return heap->object_string(); | 1236 return heap->object_string(); |
| 1237 } | 1237 } |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 } // namespace | 1240 } // namespace |
| 1241 | 1241 |
| 1242 | 1242 |
| 1243 bool HTypeofIsAndBranch::KnownSuccessorBlock(HBasicBlock** block) { | 1243 bool HTypeofIsAndBranch::KnownSuccessorBlock(HBasicBlock** block) { |
| 1244 if (FLAG_fold_constants && value()->IsConstant()) { | 1244 if (FLAG_fold_constants && value()->IsConstant()) { |
| (...skipping 2888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4133 case HObjectAccess::kExternalMemory: | 4133 case HObjectAccess::kExternalMemory: |
| 4134 os << "[external-memory]"; | 4134 os << "[external-memory]"; |
| 4135 break; | 4135 break; |
| 4136 } | 4136 } |
| 4137 | 4137 |
| 4138 return os << "@" << access.offset(); | 4138 return os << "@" << access.offset(); |
| 4139 } | 4139 } |
| 4140 | 4140 |
| 4141 } // namespace internal | 4141 } // namespace internal |
| 4142 } // namespace v8 | 4142 } // namespace v8 |
| OLD | NEW |