Commit 025d6a2d authored by neis's avatar neis Committed by Commit bot

Remove no-zone versions of intersection and union.

BUG=

Review URL: https://codereview.chromium.org/1312893010

Cr-Commit-Position: refs/heads/master@{#30559}
parent 1ec92070
......@@ -67,14 +67,12 @@ FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) {
// 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.
FieldAccess AccessBuilder::ForFixedArrayLength(Zone* zone) {
STATIC_ASSERT(FixedArray::kMaxLength <= 1 << 30);
FieldAccess access = {
kTaggedBase, FixedArray::kLengthOffset, MaybeHandle<Name>(),
Type::Intersect(Type::Unsigned30(), Type::TaggedSigned()),
Type::Intersect(Type::Range(0, FixedArray::kMaxLength, zone),
Type::TaggedSigned(), zone),
kMachAnyTagged};
return access;
}
......
......@@ -41,7 +41,7 @@ class AccessBuilder final : public AllStatic {
static FieldAccess ForJSDateField(JSDate::FieldIndex index);
// Provides access to FixedArray::length() field.
static FieldAccess ForFixedArrayLength();
static FieldAccess ForFixedArrayLength(Zone* zone);
// Provides access to DescriptorArray::enum_cache() field.
static FieldAccess ForDescriptorArrayEnumCache();
......
......@@ -61,7 +61,8 @@ class AllocationBuilder final {
void AllocateArray(int length, Handle<Map> map) {
Allocate(FixedArray::SizeFor(length));
Store(AccessBuilder::ForMap(), map);
Store(AccessBuilder::ForFixedArrayLength(), jsgraph()->Constant(length));
Store(AccessBuilder::ForFixedArrayLength(graph()->zone()),
jsgraph()->Constant(length));
}
// Compound store of a constant into a field.
......@@ -1409,7 +1410,8 @@ Reduction JSTypedLowering::ReduceJSForInPrepare(Node* node) {
cache_array_false0 = cache_type;
cache_length_false0 = efalse0 = graph()->NewNode(
simplified()->LoadField(AccessBuilder::ForFixedArrayLength()),
simplified()->LoadField(
AccessBuilder::ForFixedArrayLength(graph()->zone())),
cache_array_false0, efalse0, if_false0);
}
......
......@@ -259,7 +259,6 @@ class Typer::Visitor : public Reducer {
current.lower = Weaken(node, current.lower, previous.lower);
}
// Types should not get less precise.
DCHECK(previous.lower->Is(current.lower));
DCHECK(previous.upper->Is(current.upper));
......@@ -1124,7 +1123,8 @@ Type* Typer::Visitor::JSTypeOfTyper(Type* type, Typer* t) {
return Type::Constant(f->number_string(), t->zone());
} else if (type->Is(Type::Symbol())) {
return Type::Constant(f->symbol_string(), t->zone());
} else if (type->Is(Type::Union(Type::Undefined(), Type::Undetectable()))) {
} else if (type->Is(Type::Union(Type::Undefined(), Type::Undetectable(),
t->zone()))) {
return Type::Constant(f->undefined_string(), t->zone());
} else if (type->Is(Type::Null())) {
return Type::Constant(f->object_string(), t->zone());
......
......@@ -591,7 +591,7 @@ void Verifier::Visitor::Check(Node* node) {
break;
}
case IrOpcode::kJSForInNext: {
CheckUpperIs(node, Type::Union(Type::Name(), Type::Undefined()));
CheckUpperIs(node, Type::Union(Type::Name(), Type::Undefined(), zone));
break;
}
case IrOpcode::kJSForInStep: {
......
This diff is collapsed.
......@@ -431,12 +431,6 @@ class TypeImpl : public Config::Base {
static TypeHandle Union(TypeHandle type1, TypeHandle type2, Region* reg);
static TypeHandle Intersect(TypeHandle type1, TypeHandle type2, Region* reg);
static TypeImpl* Union(TypeImpl* type1, TypeImpl* type2) {
return BitsetType::New(type1->AsBitset() | type2->AsBitset());
}
static TypeImpl* Intersect(TypeImpl* type1, TypeImpl* type2) {
return BitsetType::New(type1->AsBitset() & type2->AsBitset());
}
static TypeHandle Of(double value, Region* region) {
return Config::from_bitset(BitsetType::Lub(value), region);
......
......@@ -1452,8 +1452,10 @@ TEST(LowerStoreField_to_store) {
}
}
{
TestingGraph t(Type::Any(),
Type::Intersect(Type::SignedSmall(), Type::TaggedSigned()));
HandleAndZoneScope scope;
Zone* z = scope.main_zone();
TestingGraph t(Type::Any(), Type::Intersect(Type::SignedSmall(),
Type::TaggedSigned(), z));
FieldAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize,
Handle<Name>::null(), Type::Any(), kMachAnyTagged};
Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0,
......@@ -1515,8 +1517,11 @@ TEST(LowerStoreElement_to_store) {
}
}
{
TestingGraph t(Type::Any(), Type::Signed32(),
Type::Intersect(Type::SignedSmall(), Type::TaggedSigned()));
HandleAndZoneScope scope;
Zone* z = scope.main_zone();
TestingGraph t(
Type::Any(), Type::Signed32(),
Type::Intersect(Type::SignedSmall(), Type::TaggedSigned(), z));
ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize,
Type::Any(), kMachAnyTagged};
Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access), t.p0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment