Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/compiler/js-native-context-specialization.cc

Issue 1410393006: [turbofan] Fix representation type for JSArray::length. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 field_type = Type::Intersect( 331 field_type = Type::Intersect(
332 Type::Range(0.0, String::kMaxLength, graph()->zone()), 332 Type::Range(0.0, String::kMaxLength, graph()->zone()),
333 Type::TaggedSigned(), graph()->zone()); 333 Type::TaggedSigned(), graph()->zone());
334 } else if (map->IsJSArrayMap()) { 334 } else if (map->IsJSArrayMap()) {
335 DCHECK(Name::Equals(factory()->length_string(), name)); 335 DCHECK(Name::Equals(factory()->length_string(), name));
336 // The JSArray::length property is a smi in the range 336 // The JSArray::length property is a smi in the range
337 // [0, FixedDoubleArray::kMaxLength] in case of fast double 337 // [0, FixedDoubleArray::kMaxLength] in case of fast double
338 // elements, a smi in the range [0, FixedArray::kMaxLength] 338 // elements, a smi in the range [0, FixedArray::kMaxLength]
339 // in case of other fast elements, and [0, kMaxUInt32-1] in 339 // in case of other fast elements, and [0, kMaxUInt32-1] in
340 // case of other arrays. 340 // case of other arrays.
341 Type* field_type_rep = Type::Tagged();
341 double field_type_upper = kMaxUInt32 - 1; 342 double field_type_upper = kMaxUInt32 - 1;
342 if (IsFastElementsKind(map->elements_kind())) { 343 if (IsFastElementsKind(map->elements_kind())) {
344 field_type_rep = Type::TaggedSigned();
343 field_type_upper = IsFastDoubleElementsKind(map->elements_kind()) 345 field_type_upper = IsFastDoubleElementsKind(map->elements_kind())
344 ? FixedDoubleArray::kMaxLength 346 ? FixedDoubleArray::kMaxLength
345 : FixedArray::kMaxLength; 347 : FixedArray::kMaxLength;
346 } 348 }
347 field_type = 349 field_type =
348 Type::Intersect(Type::Range(0.0, field_type_upper, graph()->zone()), 350 Type::Intersect(Type::Range(0.0, field_type_upper, graph()->zone()),
349 Type::TaggedSigned(), graph()->zone()); 351 field_type_rep, graph()->zone());
350 } 352 }
351 *access_info = PropertyAccessInfo::DataField(receiver_type, field_index, 353 *access_info = PropertyAccessInfo::DataField(receiver_type, field_index,
352 field_type, holder); 354 field_type, holder);
353 return true; 355 return true;
354 } 356 }
355 357
356 // Lookup the named property on the {map}. 358 // Lookup the named property on the {map}.
357 Handle<DescriptorArray> descriptors(map->instance_descriptors(), isolate()); 359 Handle<DescriptorArray> descriptors(map->instance_descriptors(), isolate());
358 int const number = descriptors->SearchWithCache(*name, *map); 360 int const number = descriptors->SearchWithCache(*name, *map);
359 if (number != DescriptorArray::kNotFound) { 361 if (number != DescriptorArray::kNotFound) {
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 } 942 }
941 943
942 944
943 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { 945 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const {
944 return jsgraph()->simplified(); 946 return jsgraph()->simplified();
945 } 947 }
946 948
947 } // namespace compiler 949 } // namespace compiler
948 } // namespace internal 950 } // namespace internal
949 } // namespace v8 951 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698