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

Unified Diff: src/compiler/access-builder.cc

Issue 1162163003: [turbofan] Specify better type for FixedArray::length field. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/access-builder.cc
diff --git a/src/compiler/access-builder.cc b/src/compiler/access-builder.cc
index c728154d7f4e2bb263f6bdf3d9fc64ae55f97bfe..b9986f28fc3ef015b11bce76f9a2cc925fecb200 100644
--- a/src/compiler/access-builder.cc
+++ b/src/compiler/access-builder.cc
@@ -46,8 +46,13 @@ FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() {
// static
FieldAccess AccessBuilder::ForFixedArrayLength() {
+ // TODO(turbofan): 2^30 is a valid upper limit for the FixedArray::length
+ // field, although it's not the best. If we had a Zone we could create an
+ // appropriate range type instead.
+ STATIC_ASSERT(FixedArray::kMaxLength <= 1 << 30);
return {kTaggedBase, FixedArray::kLengthOffset, MaybeHandle<Name>(),
- Type::TaggedSigned(), kMachAnyTagged};
+ Type::Intersect(Type::Unsigned30(), Type::TaggedSigned()),
+ kMachAnyTagged};
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698