| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/js-native-context-specialization.h" | 5 #include "src/compiler/js-native-context-specialization.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/compilation-dependencies.h" | 8 #include "src/compilation-dependencies.h" |
| 9 #include "src/compiler/access-builder.h" | 9 #include "src/compiler/access-builder.h" |
| 10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 // The String::length property is always a smi in the range | 332 // The String::length property is always a smi in the range |
| 333 // [0, String::kMaxLength]. | 333 // [0, String::kMaxLength]. |
| 334 field_type = Type::Intersect( | 334 field_type = Type::Intersect( |
| 335 Type::Range(0.0, String::kMaxLength, graph()->zone()), | 335 Type::Range(0.0, String::kMaxLength, graph()->zone()), |
| 336 Type::TaggedSigned(), graph()->zone()); | 336 Type::TaggedSigned(), graph()->zone()); |
| 337 } else if (map->IsJSArrayMap()) { | 337 } else if (map->IsJSArrayMap()) { |
| 338 DCHECK(Name::Equals(factory()->length_string(), name)); | 338 DCHECK(Name::Equals(factory()->length_string(), name)); |
| 339 // The JSArray::length property is a smi in the range | 339 // The JSArray::length property is a smi in the range |
| 340 // [0, FixedDoubleArray::kMaxLength] in case of fast double | 340 // [0, FixedDoubleArray::kMaxLength] in case of fast double |
| 341 // elements, a smi in the range [0, FixedArray::kMaxLength] | 341 // elements, a smi in the range [0, FixedArray::kMaxLength] |
| 342 // in case of other fast elements, and [0, kMaxUInt32-1] in | 342 // in case of other fast elements, and [0, kMaxUInt32] in |
| 343 // case of other arrays. | 343 // case of other arrays. |
| 344 Type* field_type_rep = Type::Tagged(); | 344 Type* field_type_rep = Type::Tagged(); |
| 345 double field_type_upper = kMaxUInt32 - 1; | 345 double field_type_upper = kMaxUInt32; |
| 346 if (IsFastElementsKind(map->elements_kind())) { | 346 if (IsFastElementsKind(map->elements_kind())) { |
| 347 field_type_rep = Type::TaggedSigned(); | 347 field_type_rep = Type::TaggedSigned(); |
| 348 field_type_upper = IsFastDoubleElementsKind(map->elements_kind()) | 348 field_type_upper = IsFastDoubleElementsKind(map->elements_kind()) |
| 349 ? FixedDoubleArray::kMaxLength | 349 ? FixedDoubleArray::kMaxLength |
| 350 : FixedArray::kMaxLength; | 350 : FixedArray::kMaxLength; |
| 351 } | 351 } |
| 352 field_type = | 352 field_type = |
| 353 Type::Intersect(Type::Range(0.0, field_type_upper, graph()->zone()), | 353 Type::Intersect(Type::Range(0.0, field_type_upper, graph()->zone()), |
| 354 field_type_rep, graph()->zone()); | 354 field_type_rep, graph()->zone()); |
| 355 } | 355 } |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 } | 836 } |
| 837 | 837 |
| 838 | 838 |
| 839 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 839 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
| 840 return jsgraph()->simplified(); | 840 return jsgraph()->simplified(); |
| 841 } | 841 } |
| 842 | 842 |
| 843 } // namespace compiler | 843 } // namespace compiler |
| 844 } // namespace internal | 844 } // namespace internal |
| 845 } // namespace v8 | 845 } // namespace v8 |
| OLD | NEW |