2014-04-01 11:07:09 +00:00
|
|
|
// Copyright 2014 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2013-06-05 15:43:53 +00:00
|
|
|
|
2014-06-03 08:12:43 +00:00
|
|
|
#include "src/types.h"
|
2014-04-01 11:07:09 +00:00
|
|
|
|
2014-06-03 08:12:43 +00:00
|
|
|
#include "src/string-stream.h"
|
|
|
|
#include "src/types-inl.h"
|
2013-06-05 15:43:53 +00:00
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Glb and lub computation.
|
2013-06-12 17:20:37 +00:00
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
// The largest bitset subsumed by this type.
|
2014-01-10 12:19:01 +00:00
|
|
|
template<class Config>
|
2014-05-27 13:52:31 +00:00
|
|
|
int TypeImpl<Config>::BitsetType::Glb(TypeImpl* type) {
|
2014-04-16 16:16:37 +00:00
|
|
|
DisallowHeapAllocation no_allocation;
|
2014-05-27 13:52:31 +00:00
|
|
|
if (type->IsBitset()) {
|
|
|
|
return type->AsBitset();
|
|
|
|
} else if (type->IsUnion()) {
|
|
|
|
UnionHandle unioned = handle(type->AsUnion());
|
|
|
|
int bitset = kNone;
|
2014-04-16 16:16:37 +00:00
|
|
|
for (int i = 0; i < unioned->Length(); ++i) {
|
2014-05-27 13:52:31 +00:00
|
|
|
bitset |= unioned->Get(i)->BitsetGlb();
|
2013-06-12 17:20:37 +00:00
|
|
|
}
|
2014-05-27 13:52:31 +00:00
|
|
|
return bitset;
|
|
|
|
} else if (type->IsClass()) {
|
|
|
|
// Little hack to avoid the need for a region for handlification here...
|
|
|
|
return REPRESENTATION(Config::is_class(type)
|
|
|
|
? Lub(*Config::as_class(type))
|
|
|
|
: type->AsClass()->Bound(NULL)->AsBitset());
|
|
|
|
} else if (type->IsConstant()) {
|
|
|
|
return REPRESENTATION(type->AsConstant()->Bound()->AsBitset());
|
|
|
|
} else if (type->IsContext()) {
|
|
|
|
return REPRESENTATION(type->AsContext()->Bound()->AsBitset());
|
|
|
|
} else if (type->IsArray()) {
|
|
|
|
return REPRESENTATION(type->AsArray()->Bound()->AsBitset());
|
|
|
|
} else if (type->IsFunction()) {
|
|
|
|
return REPRESENTATION(type->AsFunction()->Bound()->AsBitset());
|
2013-06-12 17:20:37 +00:00
|
|
|
} else {
|
2014-05-27 13:52:31 +00:00
|
|
|
UNREACHABLE();
|
|
|
|
return kNone;
|
2013-06-12 17:20:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
// The smallest bitset subsuming this type.
|
2014-04-16 16:16:37 +00:00
|
|
|
template<class Config>
|
2014-05-27 13:52:31 +00:00
|
|
|
int TypeImpl<Config>::BitsetType::Lub(TypeImpl* type) {
|
2014-04-16 16:16:37 +00:00
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
if (type->IsBitset()) {
|
|
|
|
return type->AsBitset();
|
|
|
|
} else if (type->IsUnion()) {
|
2014-05-27 13:52:31 +00:00
|
|
|
UnionHandle unioned = handle(type->AsUnion());
|
|
|
|
int bitset = kNone;
|
|
|
|
for (int i = 0; i < unioned->Length(); ++i) {
|
|
|
|
bitset |= unioned->Get(i)->BitsetLub();
|
|
|
|
}
|
|
|
|
return bitset;
|
|
|
|
} else if (type->IsClass()) {
|
|
|
|
// Little hack to avoid the need for a region for handlification here...
|
|
|
|
return Config::is_class(type) ? Lub(*Config::as_class(type)) :
|
|
|
|
type->AsClass()->Bound(NULL)->AsBitset();
|
|
|
|
} else if (type->IsConstant()) {
|
|
|
|
return type->AsConstant()->Bound()->AsBitset();
|
|
|
|
} else if (type->IsContext()) {
|
|
|
|
return type->AsContext()->Bound()->AsBitset();
|
|
|
|
} else if (type->IsArray()) {
|
|
|
|
return type->AsArray()->Bound()->AsBitset();
|
|
|
|
} else if (type->IsFunction()) {
|
|
|
|
return type->AsFunction()->Bound()->AsBitset();
|
2014-04-16 16:16:37 +00:00
|
|
|
} else {
|
2014-05-27 13:52:31 +00:00
|
|
|
UNREACHABLE();
|
2014-04-16 16:16:37 +00:00
|
|
|
return kNone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
// The smallest bitset subsuming this type, ignoring explicit bounds.
|
2014-01-10 12:19:01 +00:00
|
|
|
template<class Config>
|
2014-05-27 13:52:31 +00:00
|
|
|
int TypeImpl<Config>::BitsetType::InherentLub(TypeImpl* type) {
|
2014-04-16 16:16:37 +00:00
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
if (type->IsBitset()) {
|
|
|
|
return type->AsBitset();
|
|
|
|
} else if (type->IsUnion()) {
|
|
|
|
UnionHandle unioned = handle(type->AsUnion());
|
2013-06-05 15:43:53 +00:00
|
|
|
int bitset = kNone;
|
2014-04-16 16:16:37 +00:00
|
|
|
for (int i = 0; i < unioned->Length(); ++i) {
|
2014-05-27 13:52:31 +00:00
|
|
|
bitset |= unioned->Get(i)->InherentBitsetLub();
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
return bitset;
|
2014-04-16 16:16:37 +00:00
|
|
|
} else if (type->IsClass()) {
|
2014-05-27 13:52:31 +00:00
|
|
|
return Lub(*type->AsClass()->Map());
|
2014-04-16 16:16:37 +00:00
|
|
|
} else if (type->IsConstant()) {
|
2014-05-27 13:52:31 +00:00
|
|
|
return Lub(*type->AsConstant()->Value());
|
|
|
|
} else if (type->IsContext()) {
|
|
|
|
return kInternal & kTaggedPtr;
|
2014-04-16 16:16:37 +00:00
|
|
|
} else if (type->IsArray()) {
|
|
|
|
return kArray;
|
|
|
|
} else if (type->IsFunction()) {
|
|
|
|
return kFunction;
|
2013-06-05 15:43:53 +00:00
|
|
|
} else {
|
2014-04-16 16:16:37 +00:00
|
|
|
UNREACHABLE();
|
|
|
|
return kNone;
|
2013-11-15 15:14:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-01-10 12:19:01 +00:00
|
|
|
template<class Config>
|
2014-04-16 16:16:37 +00:00
|
|
|
int TypeImpl<Config>::BitsetType::Lub(i::Object* value) {
|
|
|
|
DisallowHeapAllocation no_allocation;
|
2014-05-26 13:10:52 +00:00
|
|
|
if (value->IsNumber()) {
|
|
|
|
return Lub(value->Number()) & (value->IsSmi() ? kTaggedInt : kTaggedPtr);
|
|
|
|
}
|
|
|
|
return Lub(i::HeapObject::cast(value)->map());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template<class Config>
|
|
|
|
int TypeImpl<Config>::BitsetType::Lub(double value) {
|
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
if (i::IsMinusZero(value)) return kMinusZero;
|
|
|
|
if (std::isnan(value)) return kNaN;
|
|
|
|
if (IsUint32Double(value)) return Lub(FastD2UI(value));
|
|
|
|
if (IsInt32Double(value)) return Lub(FastD2I(value));
|
|
|
|
return kOtherNumber;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template<class Config>
|
|
|
|
int TypeImpl<Config>::BitsetType::Lub(int32_t value) {
|
|
|
|
if (value >= 0x40000000) {
|
|
|
|
return i::SmiValuesAre31Bits() ? kOtherUnsigned31 : kUnsignedSmall;
|
|
|
|
}
|
|
|
|
if (value >= 0) return kUnsignedSmall;
|
|
|
|
if (value >= -0x40000000) return kOtherSignedSmall;
|
|
|
|
return i::SmiValuesAre31Bits() ? kOtherSigned32 : kOtherSignedSmall;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template<class Config>
|
|
|
|
int TypeImpl<Config>::BitsetType::Lub(uint32_t value) {
|
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
if (value >= 0x80000000u) return kOtherUnsigned32;
|
|
|
|
if (value >= 0x40000000u) {
|
|
|
|
return i::SmiValuesAre31Bits() ? kOtherUnsigned31 : kUnsignedSmall;
|
|
|
|
}
|
|
|
|
return kUnsignedSmall;
|
2013-11-15 15:14:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-01-10 12:19:01 +00:00
|
|
|
template<class Config>
|
2014-04-16 16:16:37 +00:00
|
|
|
int TypeImpl<Config>::BitsetType::Lub(i::Map* map) {
|
|
|
|
DisallowHeapAllocation no_allocation;
|
2013-11-15 15:14:09 +00:00
|
|
|
switch (map->instance_type()) {
|
|
|
|
case STRING_TYPE:
|
|
|
|
case ASCII_STRING_TYPE:
|
|
|
|
case CONS_STRING_TYPE:
|
|
|
|
case CONS_ASCII_STRING_TYPE:
|
|
|
|
case SLICED_STRING_TYPE:
|
|
|
|
case SLICED_ASCII_STRING_TYPE:
|
|
|
|
case EXTERNAL_STRING_TYPE:
|
|
|
|
case EXTERNAL_ASCII_STRING_TYPE:
|
|
|
|
case EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE:
|
|
|
|
case SHORT_EXTERNAL_STRING_TYPE:
|
|
|
|
case SHORT_EXTERNAL_ASCII_STRING_TYPE:
|
|
|
|
case SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE:
|
|
|
|
case INTERNALIZED_STRING_TYPE:
|
|
|
|
case ASCII_INTERNALIZED_STRING_TYPE:
|
|
|
|
case EXTERNAL_INTERNALIZED_STRING_TYPE:
|
|
|
|
case EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE:
|
|
|
|
case EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE:
|
|
|
|
case SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE:
|
|
|
|
case SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE:
|
|
|
|
case SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE:
|
|
|
|
return kString;
|
|
|
|
case SYMBOL_TYPE:
|
|
|
|
return kSymbol;
|
2014-04-07 09:41:13 +00:00
|
|
|
case ODDBALL_TYPE: {
|
|
|
|
Heap* heap = map->GetHeap();
|
|
|
|
if (map == heap->undefined_map()) return kUndefined;
|
|
|
|
if (map == heap->null_map()) return kNull;
|
|
|
|
if (map == heap->boolean_map()) return kBoolean;
|
2014-07-10 12:37:08 +00:00
|
|
|
ASSERT(map == heap->the_hole_map() ||
|
|
|
|
map == heap->uninitialized_map() ||
|
2014-04-10 11:51:03 +00:00
|
|
|
map == heap->no_interceptor_result_sentinel_map() ||
|
2014-04-07 09:41:13 +00:00
|
|
|
map == heap->termination_exception_map() ||
|
|
|
|
map == heap->arguments_marker_map());
|
|
|
|
return kInternal & kTaggedPtr;
|
|
|
|
}
|
2013-11-15 15:14:09 +00:00
|
|
|
case HEAP_NUMBER_TYPE:
|
2014-05-26 13:10:52 +00:00
|
|
|
return kNumber & kTaggedPtr;
|
2013-11-15 15:14:09 +00:00
|
|
|
case JS_VALUE_TYPE:
|
|
|
|
case JS_DATE_TYPE:
|
|
|
|
case JS_OBJECT_TYPE:
|
|
|
|
case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
|
|
|
|
case JS_GENERATOR_OBJECT_TYPE:
|
|
|
|
case JS_MODULE_TYPE:
|
|
|
|
case JS_GLOBAL_OBJECT_TYPE:
|
|
|
|
case JS_BUILTINS_OBJECT_TYPE:
|
|
|
|
case JS_GLOBAL_PROXY_TYPE:
|
|
|
|
case JS_ARRAY_BUFFER_TYPE:
|
|
|
|
case JS_TYPED_ARRAY_TYPE:
|
|
|
|
case JS_DATA_VIEW_TYPE:
|
|
|
|
case JS_SET_TYPE:
|
|
|
|
case JS_MAP_TYPE:
|
2014-04-22 18:14:46 +00:00
|
|
|
case JS_SET_ITERATOR_TYPE:
|
|
|
|
case JS_MAP_ITERATOR_TYPE:
|
2013-11-15 15:14:09 +00:00
|
|
|
case JS_WEAK_MAP_TYPE:
|
|
|
|
case JS_WEAK_SET_TYPE:
|
|
|
|
if (map->is_undetectable()) return kUndetectable;
|
|
|
|
return kOtherObject;
|
|
|
|
case JS_ARRAY_TYPE:
|
|
|
|
return kArray;
|
|
|
|
case JS_FUNCTION_TYPE:
|
|
|
|
return kFunction;
|
|
|
|
case JS_REGEXP_TYPE:
|
|
|
|
return kRegExp;
|
|
|
|
case JS_PROXY_TYPE:
|
|
|
|
case JS_FUNCTION_PROXY_TYPE:
|
|
|
|
return kProxy;
|
|
|
|
case MAP_TYPE:
|
|
|
|
// When compiling stub templates, the meta map is used as a place holder
|
|
|
|
// for the actual map with which the template is later instantiated.
|
|
|
|
// We treat it as a kind of type variable whose upper bound is Any.
|
|
|
|
// TODO(rossberg): for caching of CompareNilIC stubs to work correctly,
|
|
|
|
// we must exclude Undetectable here. This makes no sense, really,
|
|
|
|
// because it means that the template isn't actually parametric.
|
|
|
|
// Also, it doesn't apply elsewhere. 8-(
|
|
|
|
// We ought to find a cleaner solution for compiling stubs parameterised
|
|
|
|
// over type or class variables, esp ones with bounds...
|
|
|
|
return kDetectable;
|
|
|
|
case DECLARED_ACCESSOR_INFO_TYPE:
|
|
|
|
case EXECUTABLE_ACCESSOR_INFO_TYPE:
|
2014-05-26 13:10:52 +00:00
|
|
|
case SHARED_FUNCTION_INFO_TYPE:
|
2013-11-15 15:14:09 +00:00
|
|
|
case ACCESSOR_PAIR_TYPE:
|
|
|
|
case FIXED_ARRAY_TYPE:
|
2014-04-24 07:16:10 +00:00
|
|
|
case FOREIGN_TYPE:
|
2014-03-18 11:50:18 +00:00
|
|
|
return kInternal & kTaggedPtr;
|
2013-11-15 15:14:09 +00:00
|
|
|
default:
|
|
|
|
UNREACHABLE();
|
|
|
|
return kNone;
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Predicates.
|
2013-11-15 15:14:09 +00:00
|
|
|
|
2013-06-05 15:43:53 +00:00
|
|
|
// Check this <= that.
|
2014-01-10 12:19:01 +00:00
|
|
|
template<class Config>
|
|
|
|
bool TypeImpl<Config>::SlowIs(TypeImpl* that) {
|
2014-04-16 16:16:37 +00:00
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
|
2013-06-05 15:43:53 +00:00
|
|
|
// Fast path for bitsets.
|
2014-01-10 12:19:01 +00:00
|
|
|
if (this->IsNone()) return true;
|
|
|
|
if (that->IsBitset()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
return (BitsetType::Lub(this) | that->AsBitset()) == that->AsBitset();
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
2014-05-27 13:52:31 +00:00
|
|
|
if (this->IsBitset() && SEMANTIC(this->AsBitset()) == BitsetType::kNone) {
|
|
|
|
// Bitsets only have non-bitset supertypes along the representation axis.
|
|
|
|
int that_bitset = that->BitsetGlb();
|
|
|
|
return (this->AsBitset() | that_bitset) == that_bitset;
|
|
|
|
}
|
2013-06-05 15:43:53 +00:00
|
|
|
|
2014-01-10 12:19:01 +00:00
|
|
|
if (that->IsClass()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
return this->IsClass()
|
2014-05-27 13:52:31 +00:00
|
|
|
&& *this->AsClass()->Map() == *that->AsClass()->Map()
|
|
|
|
&& ((Config::is_class(that) && Config::is_class(this)) ||
|
|
|
|
BitsetType::New(this->BitsetLub())->Is(
|
|
|
|
BitsetType::New(that->BitsetLub())));
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
2014-01-10 12:19:01 +00:00
|
|
|
if (that->IsConstant()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
return this->IsConstant()
|
2014-05-27 13:52:31 +00:00
|
|
|
&& *this->AsConstant()->Value() == *that->AsConstant()->Value()
|
|
|
|
&& this->AsConstant()->Bound()->Is(that->AsConstant()->Bound());
|
2014-04-16 16:16:37 +00:00
|
|
|
}
|
2014-05-26 13:10:52 +00:00
|
|
|
if (that->IsContext()) {
|
|
|
|
return this->IsContext()
|
|
|
|
&& this->AsContext()->Outer()->Equals(that->AsContext()->Outer());
|
|
|
|
}
|
2014-04-16 16:16:37 +00:00
|
|
|
if (that->IsArray()) {
|
|
|
|
return this->IsArray()
|
|
|
|
&& this->AsArray()->Element()->Equals(that->AsArray()->Element());
|
|
|
|
}
|
|
|
|
if (that->IsFunction()) {
|
|
|
|
// We currently do not allow for any variance here, in order to keep
|
|
|
|
// Union and Intersect operations simple.
|
|
|
|
if (!this->IsFunction()) return false;
|
|
|
|
FunctionType* this_fun = this->AsFunction();
|
|
|
|
FunctionType* that_fun = that->AsFunction();
|
|
|
|
if (this_fun->Arity() != that_fun->Arity() ||
|
|
|
|
!this_fun->Result()->Equals(that_fun->Result()) ||
|
|
|
|
!that_fun->Receiver()->Equals(this_fun->Receiver())) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
for (int i = 0; i < this_fun->Arity(); ++i) {
|
|
|
|
if (!that_fun->Parameter(i)->Equals(this_fun->Parameter(i))) return false;
|
|
|
|
}
|
|
|
|
return true;
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// (T1 \/ ... \/ Tn) <= T <=> (T1 <= T) /\ ... /\ (Tn <= T)
|
2014-01-10 12:19:01 +00:00
|
|
|
if (this->IsUnion()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
UnionHandle unioned = handle(this->AsUnion());
|
|
|
|
for (int i = 0; i < unioned->Length(); ++i) {
|
|
|
|
if (!unioned->Get(i)->Is(that)) return false;
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// T <= (T1 \/ ... \/ Tn) <=> (T <= T1) \/ ... \/ (T <= Tn)
|
|
|
|
// (iff T is not a union)
|
2014-01-10 12:19:01 +00:00
|
|
|
ASSERT(!this->IsUnion());
|
|
|
|
if (that->IsUnion()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
UnionHandle unioned = handle(that->AsUnion());
|
|
|
|
for (int i = 0; i < unioned->Length(); ++i) {
|
|
|
|
if (this->Is(unioned->Get(i))) return true;
|
2014-01-10 12:19:01 +00:00
|
|
|
if (this->IsBitset()) break; // Fast fail, only first field is a bitset.
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-01-10 12:19:01 +00:00
|
|
|
template<class Config>
|
2014-04-01 13:11:12 +00:00
|
|
|
bool TypeImpl<Config>::NowIs(TypeImpl* that) {
|
2014-04-16 16:16:37 +00:00
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
|
2014-04-14 15:35:36 +00:00
|
|
|
// TODO(rossberg): this is incorrect for
|
|
|
|
// Union(Constant(V), T)->NowIs(Class(M))
|
|
|
|
// but fuzzing does not cover that!
|
2014-04-10 08:04:50 +00:00
|
|
|
if (this->IsConstant()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
i::Object* object = *this->AsConstant()->Value();
|
2014-04-10 08:04:50 +00:00
|
|
|
if (object->IsHeapObject()) {
|
|
|
|
i::Map* map = i::HeapObject::cast(object)->map();
|
|
|
|
for (Iterator<i::Map> it = that->Classes(); !it.Done(); it.Advance()) {
|
|
|
|
if (*it.Current() == map) return true;
|
|
|
|
}
|
2014-04-09 11:12:15 +00:00
|
|
|
}
|
|
|
|
}
|
2014-04-10 08:04:50 +00:00
|
|
|
return this->Is(that);
|
2013-11-22 13:16:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-04-17 08:22:22 +00:00
|
|
|
// Check if this contains only (currently) stable classes.
|
|
|
|
template<class Config>
|
|
|
|
bool TypeImpl<Config>::NowStable() {
|
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
for (Iterator<i::Map> it = this->Classes(); !it.Done(); it.Advance()) {
|
|
|
|
if (!it.Current()->is_stable()) return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-06-05 15:43:53 +00:00
|
|
|
// Check this overlaps that.
|
2014-01-10 12:19:01 +00:00
|
|
|
template<class Config>
|
|
|
|
bool TypeImpl<Config>::Maybe(TypeImpl* that) {
|
2014-04-16 16:16:37 +00:00
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
|
2013-06-05 15:43:53 +00:00
|
|
|
// (T1 \/ ... \/ Tn) overlaps T <=> (T1 overlaps T) \/ ... \/ (Tn overlaps T)
|
2014-01-10 12:19:01 +00:00
|
|
|
if (this->IsUnion()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
UnionHandle unioned = handle(this->AsUnion());
|
|
|
|
for (int i = 0; i < unioned->Length(); ++i) {
|
|
|
|
if (unioned->Get(i)->Maybe(that)) return true;
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// T overlaps (T1 \/ ... \/ Tn) <=> (T overlaps T1) \/ ... \/ (T overlaps Tn)
|
2014-01-10 12:19:01 +00:00
|
|
|
if (that->IsUnion()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
UnionHandle unioned = handle(that->AsUnion());
|
|
|
|
for (int i = 0; i < unioned->Length(); ++i) {
|
|
|
|
if (this->Maybe(unioned->Get(i))) return true;
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-01-10 12:19:01 +00:00
|
|
|
ASSERT(!this->IsUnion() && !that->IsUnion());
|
2014-04-10 08:04:50 +00:00
|
|
|
if (this->IsBitset()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
return BitsetType::IsInhabited(this->AsBitset() & that->BitsetLub());
|
2014-04-10 08:04:50 +00:00
|
|
|
}
|
|
|
|
if (that->IsBitset()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
return BitsetType::IsInhabited(this->BitsetLub() & that->AsBitset());
|
2014-04-10 08:04:50 +00:00
|
|
|
}
|
2014-01-10 12:19:01 +00:00
|
|
|
if (this->IsClass()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
return that->IsClass()
|
|
|
|
&& *this->AsClass()->Map() == *that->AsClass()->Map();
|
2013-06-20 09:10:10 +00:00
|
|
|
}
|
2014-01-10 12:19:01 +00:00
|
|
|
if (this->IsConstant()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
return that->IsConstant()
|
|
|
|
&& *this->AsConstant()->Value() == *that->AsConstant()->Value();
|
|
|
|
}
|
2014-05-26 13:10:52 +00:00
|
|
|
if (this->IsContext()) {
|
|
|
|
return this->Equals(that);
|
|
|
|
}
|
2014-04-16 16:16:37 +00:00
|
|
|
if (this->IsArray()) {
|
|
|
|
// There is no variance!
|
|
|
|
return this->Equals(that);
|
|
|
|
}
|
|
|
|
if (this->IsFunction()) {
|
|
|
|
// There is no variance!
|
|
|
|
return this->Equals(that);
|
2013-06-20 09:10:10 +00:00
|
|
|
}
|
|
|
|
|
2013-06-05 15:43:53 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
// Check if value is contained in (inhabits) type.
|
2014-04-01 13:11:12 +00:00
|
|
|
template<class Config>
|
|
|
|
bool TypeImpl<Config>::Contains(i::Object* value) {
|
2014-04-16 16:16:37 +00:00
|
|
|
DisallowHeapAllocation no_allocation;
|
2014-04-09 11:12:15 +00:00
|
|
|
for (Iterator<i::Object> it = this->Constants(); !it.Done(); it.Advance()) {
|
|
|
|
if (*it.Current() == value) return true;
|
2014-04-01 13:11:12 +00:00
|
|
|
}
|
2014-04-16 16:16:37 +00:00
|
|
|
return BitsetType::New(BitsetType::Lub(value))->Is(this);
|
2014-04-01 13:11:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-01-10 12:19:01 +00:00
|
|
|
template<class Config>
|
2014-05-27 13:52:31 +00:00
|
|
|
bool TypeImpl<Config>::UnionType::Wellformed() {
|
|
|
|
ASSERT(this->Length() >= 2);
|
|
|
|
for (int i = 0; i < this->Length(); ++i) {
|
|
|
|
ASSERT(!this->Get(i)->IsUnion());
|
|
|
|
if (i > 0) ASSERT(!this->Get(i)->IsBitset());
|
|
|
|
for (int j = 0; j < this->Length(); ++j) {
|
|
|
|
if (i != j) ASSERT(!this->Get(i)->Is(this->Get(j)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Union and intersection
|
|
|
|
|
|
|
|
template<class Config>
|
|
|
|
typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::Narrow(
|
|
|
|
int bitset, Region* region) {
|
|
|
|
TypeHandle bound = BitsetType::New(bitset, region);
|
|
|
|
if (this->IsClass()) {
|
|
|
|
return ClassType::New(this->AsClass()->Map(), bound, region);
|
|
|
|
} else if (this->IsConstant()) {
|
|
|
|
return ConstantType::New(this->AsConstant()->Value(), bound, region);
|
|
|
|
} else if (this->IsContext()) {
|
|
|
|
return ContextType::New(this->AsContext()->Outer(), bound, region);
|
|
|
|
} else if (this->IsArray()) {
|
|
|
|
return ArrayType::New(this->AsArray()->Element(), bound, region);
|
|
|
|
} else if (this->IsFunction()) {
|
|
|
|
FunctionType* function = this->AsFunction();
|
|
|
|
int arity = function->Arity();
|
|
|
|
FunctionHandle type = FunctionType::New(
|
|
|
|
function->Result(), function->Receiver(), bound, arity, region);
|
|
|
|
for (int i = 0; i < arity; ++i) {
|
|
|
|
type->InitParameter(i, function->Parameter(i));
|
|
|
|
}
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
UNREACHABLE();
|
|
|
|
return TypeHandle();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template<class Config>
|
|
|
|
int TypeImpl<Config>::BoundBy(TypeImpl* that) {
|
|
|
|
ASSERT(!this->IsUnion());
|
|
|
|
if (that->IsUnion()) {
|
|
|
|
UnionType* unioned = that->AsUnion();
|
|
|
|
int length = unioned->Length();
|
|
|
|
int bitset = BitsetType::kNone;
|
|
|
|
for (int i = 0; i < length; ++i) {
|
|
|
|
bitset |= BoundBy(unioned->Get(i)->unhandle());
|
|
|
|
}
|
|
|
|
return bitset;
|
|
|
|
} else if (that->IsClass() && this->IsClass() &&
|
|
|
|
*this->AsClass()->Map() == *that->AsClass()->Map()) {
|
|
|
|
return that->BitsetLub();
|
|
|
|
} else if (that->IsConstant() && this->IsConstant() &&
|
|
|
|
*this->AsConstant()->Value() == *that->AsConstant()->Value()) {
|
|
|
|
return that->AsConstant()->Bound()->AsBitset();
|
|
|
|
} else if (that->IsContext() && this->IsContext() && this->Is(that)) {
|
|
|
|
return that->AsContext()->Bound()->AsBitset();
|
|
|
|
} else if (that->IsArray() && this->IsArray() && this->Is(that)) {
|
|
|
|
return that->AsArray()->Bound()->AsBitset();
|
|
|
|
} else if (that->IsFunction() && this->IsFunction() && this->Is(that)) {
|
|
|
|
return that->AsFunction()->Bound()->AsBitset();
|
|
|
|
}
|
|
|
|
return that->BitsetGlb();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template<class Config>
|
|
|
|
int TypeImpl<Config>::IndexInUnion(
|
|
|
|
int bound, UnionHandle unioned, int current_size) {
|
2014-01-10 12:19:01 +00:00
|
|
|
ASSERT(!this->IsUnion());
|
2013-06-05 15:43:53 +00:00
|
|
|
for (int i = 0; i < current_size; ++i) {
|
2014-05-27 13:52:31 +00:00
|
|
|
TypeHandle that = unioned->Get(i);
|
|
|
|
if (that->IsBitset()) {
|
|
|
|
if ((bound | that->AsBitset()) == that->AsBitset()) return i;
|
|
|
|
} else if (that->IsClass() && this->IsClass()) {
|
|
|
|
if (*this->AsClass()->Map() == *that->AsClass()->Map()) return i;
|
|
|
|
} else if (that->IsConstant() && this->IsConstant()) {
|
|
|
|
if (*this->AsConstant()->Value() == *that->AsConstant()->Value())
|
|
|
|
return i;
|
|
|
|
} else if (that->IsContext() && this->IsContext()) {
|
|
|
|
if (this->Is(that)) return i;
|
|
|
|
} else if (that->IsArray() && this->IsArray()) {
|
|
|
|
if (this->Is(that)) return i;
|
|
|
|
} else if (that->IsFunction() && this->IsFunction()) {
|
|
|
|
if (this->Is(that)) return i;
|
|
|
|
}
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
2014-05-27 13:52:31 +00:00
|
|
|
return -1;
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
|
2013-07-05 09:52:11 +00:00
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
// Get non-bitsets from type, bounded by upper.
|
|
|
|
// Store at result starting at index. Returns updated index.
|
2014-01-10 12:19:01 +00:00
|
|
|
template<class Config>
|
Retry landing "Implement zone-allocated types"
Works around apparent scoping bug in VS, the only change to before being a method rename in the test suite:
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -153,7 +153,7 @@ struct ZoneRep {
return reinterpret_cast<ZoneList<ZoneType*>*>(AsTagged(t));
}
- static Zone* Region(Zone* zone, Isolate* isolate) { return zone; }
+ static Zone* ToRegion(Zone* zone, Isolate* isolate) { return zone; }
};
@@ -168,7 +168,7 @@ struct HeapRep {
static Object* AsConstant(Handle<Type> t) { return Box::cast(*t)->value(); }
static FixedArray* AsUnion(Handle<Type> t) { return FixedArray::cast(*t); }
- static Isolate* Region(Zone* zone, Isolate* isolate) { return isolate; }
+ static Isolate* ToRegion(Zone* zone, Isolate* isolate) { return isolate; }
};
@@ -183,7 +183,7 @@ struct Tests : Rep {
isolate(CcTest::i_isolate()),
scope(isolate),
zone(isolate),
- T(Rep::Region(&zone, isolate), isolate) {
+ T(Rep::ToRegion(&zone, isolate), isolate) {
}
static void CheckEqual(TypeHandle type1, TypeHandle type2) {
R=titzer@chromium.org
BUG=
Review URL: https://codereview.chromium.org/143693003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18711 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-21 14:14:12 +00:00
|
|
|
int TypeImpl<Config>::ExtendUnion(
|
2014-05-27 13:52:31 +00:00
|
|
|
UnionHandle result, int size, TypeHandle type,
|
|
|
|
TypeHandle other, bool is_intersect, Region* region) {
|
|
|
|
int old_size = size;
|
2014-04-16 16:16:37 +00:00
|
|
|
if (type->IsUnion()) {
|
|
|
|
UnionHandle unioned = handle(type->AsUnion());
|
|
|
|
for (int i = 0; i < unioned->Length(); ++i) {
|
2014-05-27 13:52:31 +00:00
|
|
|
TypeHandle type_i = unioned->Get(i);
|
|
|
|
ASSERT(i == 0 || !(type_i->IsBitset() || type_i->Is(unioned->Get(0))));
|
|
|
|
if (!type_i->IsBitset()) {
|
|
|
|
size = ExtendUnion(result, size, type_i, other, is_intersect, region);
|
2014-01-10 12:19:01 +00:00
|
|
|
}
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
2014-04-16 16:16:37 +00:00
|
|
|
} else if (!type->IsBitset()) {
|
|
|
|
ASSERT(type->IsClass() || type->IsConstant() ||
|
2014-05-27 13:52:31 +00:00
|
|
|
type->IsArray() || type->IsFunction() || type->IsContext());
|
|
|
|
int inherent_bound = type->InherentBitsetLub();
|
|
|
|
int old_bound = type->BitsetLub();
|
|
|
|
int other_bound = type->BoundBy(other->unhandle()) & inherent_bound;
|
|
|
|
int new_bound =
|
|
|
|
is_intersect ? (old_bound & other_bound) : (old_bound | other_bound);
|
|
|
|
if (new_bound != BitsetType::kNone) {
|
|
|
|
int i = type->IndexInUnion(new_bound, result, old_size);
|
|
|
|
if (i == -1) {
|
|
|
|
i = size++;
|
|
|
|
} else if (result->Get(i)->IsBitset()) {
|
|
|
|
return size; // Already fully subsumed.
|
|
|
|
} else {
|
|
|
|
int type_i_bound = result->Get(i)->BitsetLub();
|
|
|
|
new_bound |= type_i_bound;
|
|
|
|
if (new_bound == type_i_bound) return size;
|
|
|
|
}
|
|
|
|
if (new_bound != old_bound) type = type->Narrow(new_bound, region);
|
|
|
|
result->Set(i, type);
|
2014-04-16 16:16:37 +00:00
|
|
|
}
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
2014-05-27 13:52:31 +00:00
|
|
|
return size;
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
// If bitset is subsumed by another entry in the result, remove it.
|
|
|
|
// (Only bitsets with empty semantic axis can be subtypes of non-bitsets.)
|
|
|
|
template<class Config>
|
|
|
|
int TypeImpl<Config>::NormalizeUnion(UnionHandle result, int size, int bitset) {
|
|
|
|
if (bitset != BitsetType::kNone && SEMANTIC(bitset) == BitsetType::kNone) {
|
|
|
|
for (int i = 1; i < size; ++i) {
|
|
|
|
int glb = result->Get(i)->BitsetGlb();
|
|
|
|
if ((bitset | glb) == glb) {
|
|
|
|
for (int j = 1; j < size; ++j) {
|
|
|
|
result->Set(j - 1, result->Get(j));
|
|
|
|
}
|
|
|
|
--size;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Union is O(1) on simple bitsets, but O(n*m) on structured unions.
|
2014-01-10 12:19:01 +00:00
|
|
|
template<class Config>
|
|
|
|
typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::Union(
|
|
|
|
TypeHandle type1, TypeHandle type2, Region* region) {
|
2013-06-05 15:43:53 +00:00
|
|
|
// Fast case: bit sets.
|
2014-01-10 12:19:01 +00:00
|
|
|
if (type1->IsBitset() && type2->IsBitset()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
return BitsetType::New(type1->AsBitset() | type2->AsBitset(), region);
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
|
2013-06-21 11:10:06 +00:00
|
|
|
// Fast case: top or bottom types.
|
2014-03-31 15:53:21 +00:00
|
|
|
if (type1->IsAny() || type2->IsNone()) return type1;
|
|
|
|
if (type2->IsAny() || type1->IsNone()) return type2;
|
2013-06-21 11:10:06 +00:00
|
|
|
|
2013-06-05 15:43:53 +00:00
|
|
|
// Semi-fast case: Unioned objects are neither involved nor produced.
|
2014-01-10 12:19:01 +00:00
|
|
|
if (!(type1->IsUnion() || type2->IsUnion())) {
|
|
|
|
if (type1->Is(type2)) return type2;
|
|
|
|
if (type2->Is(type1)) return type1;
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Slow case: may need to produce a Unioned object.
|
2014-03-31 15:53:21 +00:00
|
|
|
int size = 0;
|
2014-01-10 12:19:01 +00:00
|
|
|
if (!type1->IsBitset()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
size += (type1->IsUnion() ? type1->AsUnion()->Length() : 1);
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
2014-01-10 12:19:01 +00:00
|
|
|
if (!type2->IsBitset()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
size += (type2->IsUnion() ? type2->AsUnion()->Length() : 1);
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
2014-04-16 16:16:37 +00:00
|
|
|
int bitset = type1->BitsetGlb() | type2->BitsetGlb();
|
|
|
|
if (bitset != BitsetType::kNone) ++size;
|
2014-03-31 15:53:21 +00:00
|
|
|
ASSERT(size >= 1);
|
2013-06-05 15:43:53 +00:00
|
|
|
|
2014-04-16 16:16:37 +00:00
|
|
|
UnionHandle unioned = UnionType::New(size, region);
|
2014-03-31 15:53:21 +00:00
|
|
|
size = 0;
|
2014-04-16 16:16:37 +00:00
|
|
|
if (bitset != BitsetType::kNone) {
|
|
|
|
unioned->Set(size++, BitsetType::New(bitset, region));
|
Retry landing "Implement zone-allocated types"
Works around apparent scoping bug in VS, the only change to before being a method rename in the test suite:
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -153,7 +153,7 @@ struct ZoneRep {
return reinterpret_cast<ZoneList<ZoneType*>*>(AsTagged(t));
}
- static Zone* Region(Zone* zone, Isolate* isolate) { return zone; }
+ static Zone* ToRegion(Zone* zone, Isolate* isolate) { return zone; }
};
@@ -168,7 +168,7 @@ struct HeapRep {
static Object* AsConstant(Handle<Type> t) { return Box::cast(*t)->value(); }
static FixedArray* AsUnion(Handle<Type> t) { return FixedArray::cast(*t); }
- static Isolate* Region(Zone* zone, Isolate* isolate) { return isolate; }
+ static Isolate* ToRegion(Zone* zone, Isolate* isolate) { return isolate; }
};
@@ -183,7 +183,7 @@ struct Tests : Rep {
isolate(CcTest::i_isolate()),
scope(isolate),
zone(isolate),
- T(Rep::Region(&zone, isolate), isolate) {
+ T(Rep::ToRegion(&zone, isolate), isolate) {
}
static void CheckEqual(TypeHandle type1, TypeHandle type2) {
R=titzer@chromium.org
BUG=
Review URL: https://codereview.chromium.org/143693003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18711 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-21 14:14:12 +00:00
|
|
|
}
|
2014-05-27 13:52:31 +00:00
|
|
|
size = ExtendUnion(unioned, size, type1, type2, false, region);
|
|
|
|
size = ExtendUnion(unioned, size, type2, type1, false, region);
|
|
|
|
size = NormalizeUnion(unioned, size, bitset);
|
2013-06-05 15:43:53 +00:00
|
|
|
|
|
|
|
if (size == 1) {
|
2014-04-16 16:16:37 +00:00
|
|
|
return unioned->Get(0);
|
Retry landing "Implement zone-allocated types"
Works around apparent scoping bug in VS, the only change to before being a method rename in the test suite:
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -153,7 +153,7 @@ struct ZoneRep {
return reinterpret_cast<ZoneList<ZoneType*>*>(AsTagged(t));
}
- static Zone* Region(Zone* zone, Isolate* isolate) { return zone; }
+ static Zone* ToRegion(Zone* zone, Isolate* isolate) { return zone; }
};
@@ -168,7 +168,7 @@ struct HeapRep {
static Object* AsConstant(Handle<Type> t) { return Box::cast(*t)->value(); }
static FixedArray* AsUnion(Handle<Type> t) { return FixedArray::cast(*t); }
- static Isolate* Region(Zone* zone, Isolate* isolate) { return isolate; }
+ static Isolate* ToRegion(Zone* zone, Isolate* isolate) { return isolate; }
};
@@ -183,7 +183,7 @@ struct Tests : Rep {
isolate(CcTest::i_isolate()),
scope(isolate),
zone(isolate),
- T(Rep::Region(&zone, isolate), isolate) {
+ T(Rep::ToRegion(&zone, isolate), isolate) {
}
static void CheckEqual(TypeHandle type1, TypeHandle type2) {
R=titzer@chromium.org
BUG=
Review URL: https://codereview.chromium.org/143693003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18711 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-21 14:14:12 +00:00
|
|
|
} else {
|
2014-04-16 16:16:37 +00:00
|
|
|
unioned->Shrink(size);
|
2014-05-27 13:52:31 +00:00
|
|
|
ASSERT(unioned->Wellformed());
|
2014-04-16 16:16:37 +00:00
|
|
|
return unioned;
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
// Intersection is O(1) on simple bitsets, but O(n*m) on structured unions.
|
2014-01-10 12:19:01 +00:00
|
|
|
template<class Config>
|
|
|
|
typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::Intersect(
|
|
|
|
TypeHandle type1, TypeHandle type2, Region* region) {
|
2013-06-20 09:10:10 +00:00
|
|
|
// Fast case: bit sets.
|
2014-01-10 12:19:01 +00:00
|
|
|
if (type1->IsBitset() && type2->IsBitset()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
return BitsetType::New(type1->AsBitset() & type2->AsBitset(), region);
|
2013-06-20 09:10:10 +00:00
|
|
|
}
|
|
|
|
|
2013-06-21 11:10:06 +00:00
|
|
|
// Fast case: top or bottom types.
|
2014-03-31 15:53:21 +00:00
|
|
|
if (type1->IsNone() || type2->IsAny()) return type1;
|
|
|
|
if (type2->IsNone() || type1->IsAny()) return type2;
|
2013-06-21 11:10:06 +00:00
|
|
|
|
2013-06-20 09:10:10 +00:00
|
|
|
// Semi-fast case: Unioned objects are neither involved nor produced.
|
2014-01-10 12:19:01 +00:00
|
|
|
if (!(type1->IsUnion() || type2->IsUnion())) {
|
|
|
|
if (type1->Is(type2)) return type1;
|
|
|
|
if (type2->Is(type1)) return type2;
|
2013-06-20 09:10:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Slow case: may need to produce a Unioned object.
|
2014-04-14 15:35:36 +00:00
|
|
|
int size = 0;
|
2014-01-10 12:19:01 +00:00
|
|
|
if (!type1->IsBitset()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
size += (type1->IsUnion() ? type1->AsUnion()->Length() : 1);
|
2013-06-20 09:10:10 +00:00
|
|
|
}
|
2014-01-10 12:19:01 +00:00
|
|
|
if (!type2->IsBitset()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
size += (type2->IsUnion() ? type2->AsUnion()->Length() : 1);
|
2013-06-20 09:10:10 +00:00
|
|
|
}
|
2014-04-16 16:16:37 +00:00
|
|
|
int bitset = type1->BitsetGlb() & type2->BitsetGlb();
|
|
|
|
if (bitset != BitsetType::kNone) ++size;
|
2014-03-31 15:53:21 +00:00
|
|
|
ASSERT(size >= 1);
|
2013-06-20 09:10:10 +00:00
|
|
|
|
2014-04-16 16:16:37 +00:00
|
|
|
UnionHandle unioned = UnionType::New(size, region);
|
2014-03-31 15:53:21 +00:00
|
|
|
size = 0;
|
2014-04-16 16:16:37 +00:00
|
|
|
if (bitset != BitsetType::kNone) {
|
|
|
|
unioned->Set(size++, BitsetType::New(bitset, region));
|
Retry landing "Implement zone-allocated types"
Works around apparent scoping bug in VS, the only change to before being a method rename in the test suite:
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -153,7 +153,7 @@ struct ZoneRep {
return reinterpret_cast<ZoneList<ZoneType*>*>(AsTagged(t));
}
- static Zone* Region(Zone* zone, Isolate* isolate) { return zone; }
+ static Zone* ToRegion(Zone* zone, Isolate* isolate) { return zone; }
};
@@ -168,7 +168,7 @@ struct HeapRep {
static Object* AsConstant(Handle<Type> t) { return Box::cast(*t)->value(); }
static FixedArray* AsUnion(Handle<Type> t) { return FixedArray::cast(*t); }
- static Isolate* Region(Zone* zone, Isolate* isolate) { return isolate; }
+ static Isolate* ToRegion(Zone* zone, Isolate* isolate) { return isolate; }
};
@@ -183,7 +183,7 @@ struct Tests : Rep {
isolate(CcTest::i_isolate()),
scope(isolate),
zone(isolate),
- T(Rep::Region(&zone, isolate), isolate) {
+ T(Rep::ToRegion(&zone, isolate), isolate) {
}
static void CheckEqual(TypeHandle type1, TypeHandle type2) {
R=titzer@chromium.org
BUG=
Review URL: https://codereview.chromium.org/143693003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18711 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-21 14:14:12 +00:00
|
|
|
}
|
2014-05-27 13:52:31 +00:00
|
|
|
size = ExtendUnion(unioned, size, type1, type2, true, region);
|
|
|
|
size = ExtendUnion(unioned, size, type2, type1, true, region);
|
|
|
|
size = NormalizeUnion(unioned, size, bitset);
|
2013-06-20 09:10:10 +00:00
|
|
|
|
|
|
|
if (size == 0) {
|
2014-01-10 12:19:01 +00:00
|
|
|
return None(region);
|
2013-06-20 09:10:10 +00:00
|
|
|
} else if (size == 1) {
|
2014-04-16 16:16:37 +00:00
|
|
|
return unioned->Get(0);
|
Retry landing "Implement zone-allocated types"
Works around apparent scoping bug in VS, the only change to before being a method rename in the test suite:
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -153,7 +153,7 @@ struct ZoneRep {
return reinterpret_cast<ZoneList<ZoneType*>*>(AsTagged(t));
}
- static Zone* Region(Zone* zone, Isolate* isolate) { return zone; }
+ static Zone* ToRegion(Zone* zone, Isolate* isolate) { return zone; }
};
@@ -168,7 +168,7 @@ struct HeapRep {
static Object* AsConstant(Handle<Type> t) { return Box::cast(*t)->value(); }
static FixedArray* AsUnion(Handle<Type> t) { return FixedArray::cast(*t); }
- static Isolate* Region(Zone* zone, Isolate* isolate) { return isolate; }
+ static Isolate* ToRegion(Zone* zone, Isolate* isolate) { return isolate; }
};
@@ -183,7 +183,7 @@ struct Tests : Rep {
isolate(CcTest::i_isolate()),
scope(isolate),
zone(isolate),
- T(Rep::Region(&zone, isolate), isolate) {
+ T(Rep::ToRegion(&zone, isolate), isolate) {
}
static void CheckEqual(TypeHandle type1, TypeHandle type2) {
R=titzer@chromium.org
BUG=
Review URL: https://codereview.chromium.org/143693003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18711 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-21 14:14:12 +00:00
|
|
|
} else {
|
2014-04-16 16:16:37 +00:00
|
|
|
unioned->Shrink(size);
|
2014-05-27 13:52:31 +00:00
|
|
|
ASSERT(unioned->Wellformed());
|
2014-04-16 16:16:37 +00:00
|
|
|
return unioned;
|
2013-06-20 09:10:10 +00:00
|
|
|
}
|
2013-06-05 15:43:53 +00:00
|
|
|
}
|
|
|
|
|
2013-07-05 09:26:22 +00:00
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Iteration.
|
|
|
|
|
|
|
|
template<class Config>
|
|
|
|
int TypeImpl<Config>::NumClasses() {
|
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
if (this->IsClass()) {
|
|
|
|
return 1;
|
|
|
|
} else if (this->IsUnion()) {
|
|
|
|
UnionHandle unioned = handle(this->AsUnion());
|
|
|
|
int result = 0;
|
|
|
|
for (int i = 0; i < unioned->Length(); ++i) {
|
|
|
|
if (unioned->Get(i)->IsClass()) ++result;
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template<class Config>
|
|
|
|
int TypeImpl<Config>::NumConstants() {
|
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
if (this->IsConstant()) {
|
|
|
|
return 1;
|
|
|
|
} else if (this->IsUnion()) {
|
|
|
|
UnionHandle unioned = handle(this->AsUnion());
|
|
|
|
int result = 0;
|
|
|
|
for (int i = 0; i < unioned->Length(); ++i) {
|
|
|
|
if (unioned->Get(i)->IsConstant()) ++result;
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template<class Config> template<class T>
|
|
|
|
typename TypeImpl<Config>::TypeHandle
|
|
|
|
TypeImpl<Config>::Iterator<T>::get_type() {
|
|
|
|
ASSERT(!Done());
|
|
|
|
return type_->IsUnion() ? type_->AsUnion()->Get(index_) : type_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// C++ cannot specialise nested templates, so we have to go through this
|
|
|
|
// contortion with an auxiliary template to simulate it.
|
|
|
|
template<class Config, class T>
|
|
|
|
struct TypeImplIteratorAux {
|
|
|
|
static bool matches(typename TypeImpl<Config>::TypeHandle type);
|
|
|
|
static i::Handle<T> current(typename TypeImpl<Config>::TypeHandle type);
|
|
|
|
};
|
|
|
|
|
|
|
|
template<class Config>
|
|
|
|
struct TypeImplIteratorAux<Config, i::Map> {
|
|
|
|
static bool matches(typename TypeImpl<Config>::TypeHandle type) {
|
|
|
|
return type->IsClass();
|
|
|
|
}
|
|
|
|
static i::Handle<i::Map> current(typename TypeImpl<Config>::TypeHandle type) {
|
|
|
|
return type->AsClass()->Map();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template<class Config>
|
|
|
|
struct TypeImplIteratorAux<Config, i::Object> {
|
|
|
|
static bool matches(typename TypeImpl<Config>::TypeHandle type) {
|
|
|
|
return type->IsConstant();
|
|
|
|
}
|
|
|
|
static i::Handle<i::Object> current(
|
|
|
|
typename TypeImpl<Config>::TypeHandle type) {
|
|
|
|
return type->AsConstant()->Value();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template<class Config> template<class T>
|
|
|
|
bool TypeImpl<Config>::Iterator<T>::matches(TypeHandle type) {
|
|
|
|
return TypeImplIteratorAux<Config, T>::matches(type);
|
|
|
|
}
|
|
|
|
|
|
|
|
template<class Config> template<class T>
|
|
|
|
i::Handle<T> TypeImpl<Config>::Iterator<T>::Current() {
|
|
|
|
return TypeImplIteratorAux<Config, T>::current(get_type());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template<class Config> template<class T>
|
|
|
|
void TypeImpl<Config>::Iterator<T>::Advance() {
|
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
++index_;
|
|
|
|
if (type_->IsUnion()) {
|
|
|
|
UnionHandle unioned = handle(type_->AsUnion());
|
|
|
|
for (; index_ < unioned->Length(); ++index_) {
|
|
|
|
if (matches(unioned->Get(index_))) return;
|
|
|
|
}
|
|
|
|
} else if (index_ == 0 && matches(type_)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
index_ = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Conversion between low-level representations.
|
|
|
|
|
2014-01-24 11:47:47 +00:00
|
|
|
template<class Config>
|
|
|
|
template<class OtherType>
|
|
|
|
typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::Convert(
|
|
|
|
typename OtherType::TypeHandle type, Region* region) {
|
|
|
|
if (type->IsBitset()) {
|
2014-04-16 16:16:37 +00:00
|
|
|
return BitsetType::New(type->AsBitset(), region);
|
2014-01-24 11:47:47 +00:00
|
|
|
} else if (type->IsClass()) {
|
2014-05-27 13:52:31 +00:00
|
|
|
return ClassType::New(
|
|
|
|
type->AsClass()->Map(),
|
|
|
|
BitsetType::New(type->BitsetLub(), region), region);
|
2014-01-24 11:47:47 +00:00
|
|
|
} else if (type->IsConstant()) {
|
2014-05-27 13:52:31 +00:00
|
|
|
return ConstantType::New(
|
|
|
|
type->AsConstant()->Value(),
|
|
|
|
Convert<OtherType>(type->AsConstant()->Bound(), region), region);
|
2014-05-26 13:10:52 +00:00
|
|
|
} else if (type->IsContext()) {
|
|
|
|
TypeHandle outer = Convert<OtherType>(type->AsContext()->Outer(), region);
|
|
|
|
return ContextType::New(outer, region);
|
2014-04-16 16:16:37 +00:00
|
|
|
} else if (type->IsUnion()) {
|
|
|
|
int length = type->AsUnion()->Length();
|
|
|
|
UnionHandle unioned = UnionType::New(length, region);
|
2014-01-24 11:47:47 +00:00
|
|
|
for (int i = 0; i < length; ++i) {
|
2014-04-16 16:16:37 +00:00
|
|
|
unioned->Set(i, Convert<OtherType>(type->AsUnion()->Get(i), region));
|
|
|
|
}
|
|
|
|
return unioned;
|
|
|
|
} else if (type->IsArray()) {
|
|
|
|
return ArrayType::New(
|
2014-05-27 13:52:31 +00:00
|
|
|
Convert<OtherType>(type->AsArray()->Element(), region),
|
|
|
|
Convert<OtherType>(type->AsArray()->Bound(), region), region);
|
2014-04-16 16:16:37 +00:00
|
|
|
} else if (type->IsFunction()) {
|
|
|
|
FunctionHandle function = FunctionType::New(
|
|
|
|
Convert<OtherType>(type->AsFunction()->Result(), region),
|
|
|
|
Convert<OtherType>(type->AsFunction()->Receiver(), region),
|
2014-05-27 13:52:31 +00:00
|
|
|
Convert<OtherType>(type->AsFunction()->Bound(), region),
|
2014-04-16 16:16:37 +00:00
|
|
|
type->AsFunction()->Arity(), region);
|
|
|
|
for (int i = 0; i < function->Arity(); ++i) {
|
|
|
|
function->InitParameter(i,
|
|
|
|
Convert<OtherType>(type->AsFunction()->Parameter(i), region));
|
2014-01-24 11:47:47 +00:00
|
|
|
}
|
2014-04-16 16:16:37 +00:00
|
|
|
return function;
|
|
|
|
} else {
|
|
|
|
UNREACHABLE();
|
|
|
|
return None(region);
|
2014-01-24 11:47:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Printing.
|
2013-07-05 09:26:22 +00:00
|
|
|
|
2014-01-10 12:19:01 +00:00
|
|
|
template<class Config>
|
2014-04-16 16:16:37 +00:00
|
|
|
const char* TypeImpl<Config>::BitsetType::Name(int bitset) {
|
2013-11-22 12:38:49 +00:00
|
|
|
switch (bitset) {
|
2014-05-26 13:10:52 +00:00
|
|
|
case REPRESENTATION(kAny): return "Any";
|
|
|
|
#define RETURN_NAMED_REPRESENTATION_TYPE(type, value) \
|
|
|
|
case REPRESENTATION(k##type): return #type;
|
|
|
|
REPRESENTATION_BITSET_TYPE_LIST(RETURN_NAMED_REPRESENTATION_TYPE)
|
|
|
|
#undef RETURN_NAMED_REPRESENTATION_TYPE
|
2014-03-18 11:50:18 +00:00
|
|
|
|
2014-05-26 13:10:52 +00:00
|
|
|
#define RETURN_NAMED_SEMANTIC_TYPE(type, value) \
|
|
|
|
case SEMANTIC(k##type): return #type;
|
|
|
|
SEMANTIC_BITSET_TYPE_LIST(RETURN_NAMED_SEMANTIC_TYPE)
|
|
|
|
#undef RETURN_NAMED_SEMANTIC_TYPE
|
2014-03-18 11:50:18 +00:00
|
|
|
|
2013-11-22 12:38:49 +00:00
|
|
|
default:
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-03 07:18:30 +00:00
|
|
|
template <class Config>
|
|
|
|
void TypeImpl<Config>::BitsetType::Print(OStream& os, // NOLINT
|
|
|
|
int bitset) {
|
2014-04-16 16:16:37 +00:00
|
|
|
DisallowHeapAllocation no_allocation;
|
|
|
|
const char* name = Name(bitset);
|
2014-03-18 11:50:18 +00:00
|
|
|
if (name != NULL) {
|
2014-07-03 07:18:30 +00:00
|
|
|
os << name;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const int named_bitsets[] = {
|
|
|
|
#define BITSET_CONSTANT(type, value) REPRESENTATION(k##type),
|
2014-03-18 11:50:18 +00:00
|
|
|
REPRESENTATION_BITSET_TYPE_LIST(BITSET_CONSTANT)
|
2014-07-03 07:18:30 +00:00
|
|
|
#undef BITSET_CONSTANT
|
2014-03-18 11:50:18 +00:00
|
|
|
|
2014-07-03 07:18:30 +00:00
|
|
|
#define BITSET_CONSTANT(type, value) SEMANTIC(k##type),
|
2014-03-18 11:50:18 +00:00
|
|
|
SEMANTIC_BITSET_TYPE_LIST(BITSET_CONSTANT)
|
2014-07-03 07:18:30 +00:00
|
|
|
#undef BITSET_CONSTANT
|
|
|
|
};
|
|
|
|
|
|
|
|
bool is_first = true;
|
|
|
|
os << "(";
|
|
|
|
for (int i(ARRAY_SIZE(named_bitsets) - 1); bitset != 0 && i >= 0; --i) {
|
|
|
|
int subset = named_bitsets[i];
|
|
|
|
if ((bitset & subset) == subset) {
|
|
|
|
if (!is_first) os << " | ";
|
|
|
|
is_first = false;
|
|
|
|
os << Name(subset);
|
|
|
|
bitset -= subset;
|
2014-03-18 11:50:18 +00:00
|
|
|
}
|
|
|
|
}
|
2014-07-03 07:18:30 +00:00
|
|
|
ASSERT(bitset == 0);
|
|
|
|
os << ")";
|
2014-03-18 11:50:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-03 07:18:30 +00:00
|
|
|
template <class Config>
|
|
|
|
void TypeImpl<Config>::PrintTo(OStream& os, PrintDimension dim) { // NOLINT
|
2014-04-16 16:16:37 +00:00
|
|
|
DisallowHeapAllocation no_allocation;
|
2014-05-27 13:52:31 +00:00
|
|
|
if (dim != REPRESENTATION_DIM) {
|
|
|
|
if (this->IsBitset()) {
|
2014-07-03 07:18:30 +00:00
|
|
|
BitsetType::Print(os, SEMANTIC(this->AsBitset()));
|
2014-05-27 13:52:31 +00:00
|
|
|
} else if (this->IsClass()) {
|
2014-07-03 07:18:30 +00:00
|
|
|
os << "Class(" << static_cast<void*>(*this->AsClass()->Map()) << " < ";
|
|
|
|
return BitsetType::New(BitsetType::Lub(this))->PrintTo(os, dim);
|
|
|
|
os << ")";
|
2014-05-27 13:52:31 +00:00
|
|
|
} else if (this->IsConstant()) {
|
2014-07-03 07:18:30 +00:00
|
|
|
os << "Constant(" << static_cast<void*>(*this->AsConstant()->Value())
|
|
|
|
<< " : ";
|
|
|
|
BitsetType::New(BitsetType::Lub(this))->PrintTo(os, dim);
|
|
|
|
os << ")";
|
2014-05-27 13:52:31 +00:00
|
|
|
} else if (this->IsContext()) {
|
2014-07-03 07:18:30 +00:00
|
|
|
os << "Context(";
|
|
|
|
this->AsContext()->Outer()->PrintTo(os, dim);
|
|
|
|
os << ")";
|
2014-05-27 13:52:31 +00:00
|
|
|
} else if (this->IsUnion()) {
|
2014-07-03 07:18:30 +00:00
|
|
|
os << "(";
|
2014-05-27 13:52:31 +00:00
|
|
|
UnionHandle unioned = handle(this->AsUnion());
|
|
|
|
for (int i = 0; i < unioned->Length(); ++i) {
|
|
|
|
TypeHandle type_i = unioned->Get(i);
|
2014-07-03 07:18:30 +00:00
|
|
|
if (i > 0) os << " | ";
|
|
|
|
type_i->PrintTo(os, dim);
|
2014-05-27 13:52:31 +00:00
|
|
|
}
|
2014-07-03 07:18:30 +00:00
|
|
|
os << ")";
|
2014-05-27 13:52:31 +00:00
|
|
|
} else if (this->IsArray()) {
|
2014-07-03 07:18:30 +00:00
|
|
|
os << "Array(";
|
|
|
|
AsArray()->Element()->PrintTo(os, dim);
|
|
|
|
os << ")";
|
2014-05-27 13:52:31 +00:00
|
|
|
} else if (this->IsFunction()) {
|
|
|
|
if (!this->AsFunction()->Receiver()->IsAny()) {
|
2014-07-03 07:18:30 +00:00
|
|
|
this->AsFunction()->Receiver()->PrintTo(os, dim);
|
|
|
|
os << ".";
|
2014-05-27 13:52:31 +00:00
|
|
|
}
|
2014-07-03 07:18:30 +00:00
|
|
|
os << "(";
|
2014-05-27 13:52:31 +00:00
|
|
|
for (int i = 0; i < this->AsFunction()->Arity(); ++i) {
|
2014-07-03 07:18:30 +00:00
|
|
|
if (i > 0) os << ", ";
|
|
|
|
this->AsFunction()->Parameter(i)->PrintTo(os, dim);
|
2014-05-27 13:52:31 +00:00
|
|
|
}
|
2014-07-03 07:18:30 +00:00
|
|
|
os << ")->";
|
|
|
|
this->AsFunction()->Result()->PrintTo(os, dim);
|
2014-05-27 13:52:31 +00:00
|
|
|
} else {
|
|
|
|
UNREACHABLE();
|
2014-04-16 16:16:37 +00:00
|
|
|
}
|
2014-05-27 13:52:31 +00:00
|
|
|
}
|
2014-07-03 07:18:30 +00:00
|
|
|
if (dim == BOTH_DIMS) os << "/";
|
2014-05-27 13:52:31 +00:00
|
|
|
if (dim != SEMANTIC_DIM) {
|
2014-07-03 07:18:30 +00:00
|
|
|
BitsetType::Print(os, REPRESENTATION(this->BitsetLub()));
|
2013-07-10 11:20:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-27 13:52:31 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Instantiations.
|
|
|
|
|
Retry landing "Implement zone-allocated types"
Works around apparent scoping bug in VS, the only change to before being a method rename in the test suite:
--- a/test/cctest/test-types.cc
+++ b/test/cctest/test-types.cc
@@ -153,7 +153,7 @@ struct ZoneRep {
return reinterpret_cast<ZoneList<ZoneType*>*>(AsTagged(t));
}
- static Zone* Region(Zone* zone, Isolate* isolate) { return zone; }
+ static Zone* ToRegion(Zone* zone, Isolate* isolate) { return zone; }
};
@@ -168,7 +168,7 @@ struct HeapRep {
static Object* AsConstant(Handle<Type> t) { return Box::cast(*t)->value(); }
static FixedArray* AsUnion(Handle<Type> t) { return FixedArray::cast(*t); }
- static Isolate* Region(Zone* zone, Isolate* isolate) { return isolate; }
+ static Isolate* ToRegion(Zone* zone, Isolate* isolate) { return isolate; }
};
@@ -183,7 +183,7 @@ struct Tests : Rep {
isolate(CcTest::i_isolate()),
scope(isolate),
zone(isolate),
- T(Rep::Region(&zone, isolate), isolate) {
+ T(Rep::ToRegion(&zone, isolate), isolate) {
}
static void CheckEqual(TypeHandle type1, TypeHandle type2) {
R=titzer@chromium.org
BUG=
Review URL: https://codereview.chromium.org/143693003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18711 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-01-21 14:14:12 +00:00
|
|
|
template class TypeImpl<ZoneTypeConfig>;
|
|
|
|
template class TypeImpl<ZoneTypeConfig>::Iterator<i::Map>;
|
|
|
|
template class TypeImpl<ZoneTypeConfig>::Iterator<i::Object>;
|
|
|
|
|
2014-01-10 12:19:01 +00:00
|
|
|
template class TypeImpl<HeapTypeConfig>;
|
|
|
|
template class TypeImpl<HeapTypeConfig>::Iterator<i::Map>;
|
|
|
|
template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>;
|
|
|
|
|
2014-01-24 11:47:47 +00:00
|
|
|
template TypeImpl<ZoneTypeConfig>::TypeHandle
|
|
|
|
TypeImpl<ZoneTypeConfig>::Convert<HeapType>(
|
|
|
|
TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*);
|
|
|
|
template TypeImpl<HeapTypeConfig>::TypeHandle
|
|
|
|
TypeImpl<HeapTypeConfig>::Convert<Type>(
|
|
|
|
TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*);
|
|
|
|
|
2013-06-05 15:43:53 +00:00
|
|
|
} } // namespace v8::internal
|