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

Unified 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, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-native-context-specialization.cc
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc
index 750b75725903be87dfa754348928cbdfdfdd6305..3337d3a456c735894bfb0ea563efb53b2c118355 100644
--- a/src/compiler/js-native-context-specialization.cc
+++ b/src/compiler/js-native-context-specialization.cc
@@ -338,15 +338,17 @@ bool JSNativeContextSpecialization::ComputePropertyAccessInfo(
// elements, a smi in the range [0, FixedArray::kMaxLength]
// in case of other fast elements, and [0, kMaxUInt32-1] in
// case of other arrays.
+ Type* field_type_rep = Type::Tagged();
double field_type_upper = kMaxUInt32 - 1;
if (IsFastElementsKind(map->elements_kind())) {
+ field_type_rep = Type::TaggedSigned();
field_type_upper = IsFastDoubleElementsKind(map->elements_kind())
? FixedDoubleArray::kMaxLength
: FixedArray::kMaxLength;
}
field_type =
Type::Intersect(Type::Range(0.0, field_type_upper, graph()->zone()),
- Type::TaggedSigned(), graph()->zone());
+ field_type_rep, graph()->zone());
}
*access_info = PropertyAccessInfo::DataField(receiver_type, field_index,
field_type, holder);
« 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