| Index: src/types.h
|
| diff --git a/src/types.h b/src/types.h
|
| index 849f0f44b607411681342c33ca1b5cd02d3804e8..98b9e014c7988bb4c0f6f3db34d21fe4389698bc 100644
|
| --- a/src/types.h
|
| +++ b/src/types.h
|
| @@ -453,7 +453,7 @@ class TypeImpl : public Config::Base {
|
| bool IsUnion() { return Config::is_struct(this, StructuralType::kUnionTag); }
|
|
|
| int AsBitset() {
|
| - ASSERT(this->IsBitset());
|
| + DCHECK(this->IsBitset());
|
| return static_cast<BitsetType*>(this)->Bitset();
|
| }
|
| UnionType* AsUnion() { return UnionType::cast(this); }
|
| @@ -546,28 +546,28 @@ class TypeImpl<Config>::StructuralType : public TypeImpl<Config> {
|
| return Config::struct_length(Config::as_struct(this));
|
| }
|
| TypeHandle Get(int i) {
|
| - ASSERT(0 <= i && i < this->Length());
|
| + DCHECK(0 <= i && i < this->Length());
|
| return Config::struct_get(Config::as_struct(this), i);
|
| }
|
| void Set(int i, TypeHandle type) {
|
| - ASSERT(0 <= i && i < this->Length());
|
| + DCHECK(0 <= i && i < this->Length());
|
| Config::struct_set(Config::as_struct(this), i, type);
|
| }
|
| void Shrink(int length) {
|
| - ASSERT(2 <= length && length <= this->Length());
|
| + DCHECK(2 <= length && length <= this->Length());
|
| Config::struct_shrink(Config::as_struct(this), length);
|
| }
|
| template<class V> i::Handle<V> GetValue(int i) {
|
| - ASSERT(0 <= i && i < this->Length());
|
| + DCHECK(0 <= i && i < this->Length());
|
| return Config::template struct_get_value<V>(Config::as_struct(this), i);
|
| }
|
| template<class V> void SetValue(int i, i::Handle<V> x) {
|
| - ASSERT(0 <= i && i < this->Length());
|
| + DCHECK(0 <= i && i < this->Length());
|
| Config::struct_set_value(Config::as_struct(this), i, x);
|
| }
|
|
|
| static TypeHandle New(Tag tag, int length, Region* region) {
|
| - ASSERT(1 <= length);
|
| + DCHECK(1 <= length);
|
| return Config::from_struct(Config::struct_create(tag, length, region));
|
| }
|
| };
|
| @@ -589,7 +589,7 @@ class TypeImpl<Config>::UnionType : public StructuralType {
|
| }
|
|
|
| static UnionType* cast(TypeImpl* type) {
|
| - ASSERT(type->IsUnion());
|
| + DCHECK(type->IsUnion());
|
| return static_cast<UnionType*>(type);
|
| }
|
|
|
| @@ -616,7 +616,7 @@ class TypeImpl<Config>::ClassType : public StructuralType {
|
|
|
| static ClassHandle New(
|
| i::Handle<i::Map> map, TypeHandle bound, Region* region) {
|
| - ASSERT(BitsetType::Is(bound->AsBitset(), BitsetType::Lub(*map)));
|
| + DCHECK(BitsetType::Is(bound->AsBitset(), BitsetType::Lub(*map)));
|
| ClassHandle type = Config::template cast<ClassType>(
|
| StructuralType::New(StructuralType::kClassTag, 2, region));
|
| type->Set(0, bound);
|
| @@ -636,7 +636,7 @@ class TypeImpl<Config>::ClassType : public StructuralType {
|
| }
|
|
|
| static ClassType* cast(TypeImpl* type) {
|
| - ASSERT(type->IsClass());
|
| + DCHECK(type->IsClass());
|
| return static_cast<ClassType*>(type);
|
| }
|
| };
|
| @@ -653,7 +653,7 @@ class TypeImpl<Config>::ConstantType : public StructuralType {
|
|
|
| static ConstantHandle New(
|
| i::Handle<i::Object> value, TypeHandle bound, Region* region) {
|
| - ASSERT(BitsetType::Is(bound->AsBitset(), BitsetType::Lub(*value)));
|
| + DCHECK(BitsetType::Is(bound->AsBitset(), BitsetType::Lub(*value)));
|
| ConstantHandle type = Config::template cast<ConstantType>(
|
| StructuralType::New(StructuralType::kConstantTag, 2, region));
|
| type->Set(0, bound);
|
| @@ -667,7 +667,7 @@ class TypeImpl<Config>::ConstantType : public StructuralType {
|
| }
|
|
|
| static ConstantType* cast(TypeImpl* type) {
|
| - ASSERT(type->IsConstant());
|
| + DCHECK(type->IsConstant());
|
| return static_cast<ConstantType*>(type);
|
| }
|
| };
|
| @@ -685,8 +685,8 @@ class TypeImpl<Config>::RangeType : public StructuralType {
|
|
|
| static RangeHandle New(
|
| double min, double max, TypeHandle bound, Region* region) {
|
| - ASSERT(BitsetType::Is(bound->AsBitset(), BitsetType::kNumber));
|
| - ASSERT(!std::isnan(min) && !std::isnan(max) && min <= max);
|
| + DCHECK(BitsetType::Is(bound->AsBitset(), BitsetType::kNumber));
|
| + DCHECK(!std::isnan(min) && !std::isnan(max) && min <= max);
|
| RangeHandle type = Config::template cast<RangeType>(
|
| StructuralType::New(StructuralType::kRangeTag, 3, region));
|
| type->Set(0, bound);
|
| @@ -704,7 +704,7 @@ class TypeImpl<Config>::RangeType : public StructuralType {
|
| }
|
|
|
| static RangeType* cast(TypeImpl* type) {
|
| - ASSERT(type->IsRange());
|
| + DCHECK(type->IsRange());
|
| return static_cast<RangeType*>(type);
|
| }
|
| };
|
| @@ -720,7 +720,7 @@ class TypeImpl<Config>::ContextType : public StructuralType {
|
| TypeHandle Outer() { return this->Get(1); }
|
|
|
| static ContextHandle New(TypeHandle outer, TypeHandle bound, Region* region) {
|
| - ASSERT(BitsetType::Is(
|
| + DCHECK(BitsetType::Is(
|
| bound->AsBitset(), BitsetType::kInternal & BitsetType::kTaggedPtr));
|
| ContextHandle type = Config::template cast<ContextType>(
|
| StructuralType::New(StructuralType::kContextTag, 2, region));
|
| @@ -736,7 +736,7 @@ class TypeImpl<Config>::ContextType : public StructuralType {
|
| }
|
|
|
| static ContextType* cast(TypeImpl* type) {
|
| - ASSERT(type->IsContext());
|
| + DCHECK(type->IsContext());
|
| return static_cast<ContextType*>(type);
|
| }
|
| };
|
| @@ -752,7 +752,7 @@ class TypeImpl<Config>::ArrayType : public StructuralType {
|
| TypeHandle Element() { return this->Get(1); }
|
|
|
| static ArrayHandle New(TypeHandle element, TypeHandle bound, Region* region) {
|
| - ASSERT(BitsetType::Is(bound->AsBitset(), BitsetType::kArray));
|
| + DCHECK(BitsetType::Is(bound->AsBitset(), BitsetType::kArray));
|
| ArrayHandle type = Config::template cast<ArrayType>(
|
| StructuralType::New(StructuralType::kArrayTag, 2, region));
|
| type->Set(0, bound);
|
| @@ -766,7 +766,7 @@ class TypeImpl<Config>::ArrayType : public StructuralType {
|
| }
|
|
|
| static ArrayType* cast(TypeImpl* type) {
|
| - ASSERT(type->IsArray());
|
| + DCHECK(type->IsArray());
|
| return static_cast<ArrayType*>(type);
|
| }
|
| };
|
| @@ -789,7 +789,7 @@ class TypeImpl<Config>::FunctionType : public StructuralType {
|
| static FunctionHandle New(
|
| TypeHandle result, TypeHandle receiver, TypeHandle bound,
|
| int arity, Region* region) {
|
| - ASSERT(BitsetType::Is(bound->AsBitset(), BitsetType::kFunction));
|
| + DCHECK(BitsetType::Is(bound->AsBitset(), BitsetType::kFunction));
|
| FunctionHandle type = Config::template cast<FunctionType>(
|
| StructuralType::New(StructuralType::kFunctionTag, 3 + arity, region));
|
| type->Set(0, bound);
|
| @@ -805,7 +805,7 @@ class TypeImpl<Config>::FunctionType : public StructuralType {
|
| }
|
|
|
| static FunctionType* cast(TypeImpl* type) {
|
| - ASSERT(type->IsFunction());
|
| + DCHECK(type->IsFunction());
|
| return static_cast<FunctionType*>(type);
|
| }
|
| };
|
| @@ -951,7 +951,7 @@ struct BoundsImpl {
|
| BoundsImpl() {}
|
| explicit BoundsImpl(TypeHandle t) : lower(t), upper(t) {}
|
| BoundsImpl(TypeHandle l, TypeHandle u) : lower(l), upper(u) {
|
| - ASSERT(lower->Is(upper));
|
| + DCHECK(lower->Is(upper));
|
| }
|
|
|
| // Unrestricted bounds.
|
|
|