Commit dbf7d852 authored by rossberg@chromium.org's avatar rossberg@chromium.org

Various extensions to types

R=bmeurer@chromium.org
BUG=

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21494 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6ed0102b
......@@ -163,6 +163,17 @@ static inline bool IsInt32Double(double value) {
}
// UInteger32 is an integer that can be represented as an unsigned 32-bit
// integer. It has to be in the range [0, 2^32 - 1].
// We also have to check for negative 0 as it is not a UInteger32.
static inline bool IsUint32Double(double value) {
return !IsMinusZero(value) &&
value >= 0 &&
value <= kMaxUInt32 &&
value == FastUI2D(FastD2UI(value));
}
// Convert from Number object to C integer.
inline int32_t NumberToInt32(Object* number) {
if (number->IsSmi()) return Smi::cast(number)->value();
......
......@@ -9503,7 +9503,7 @@ HValue* HGraphBuilder::TruncateToNumber(HValue* value, Type** expected) {
if (expected_obj->Is(Type::Undefined(zone()))) {
// This is already done by HChange.
*expected = Type::Union(expected_number, Type::Float(zone()), zone());
*expected = Type::Union(expected_number, Type::Number(zone()), zone());
return value;
}
......
......@@ -20,7 +20,7 @@ template<class Config>
TypeImpl<Config>* TypeImpl<Config>::cast(typename Config::Base* object) {
TypeImpl* t = static_cast<TypeImpl*>(object);
ASSERT(t->IsBitset() || t->IsClass() || t->IsConstant() ||
t->IsUnion() || t->IsArray() || t->IsFunction());
t->IsUnion() || t->IsArray() || t->IsFunction() || t->IsContext());
return t;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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