Version 2.0.6
Added ES5 Object.getPrototypeOf, GetOwnPropertyDescriptor,
GetOwnProperty, FromPropertyDescriptor.
Fixed Mac x64 build errors.
Improved performance of some math and string operations.
Improved performance of some regexp operations.
Improved performance of context creation.
Improved performance of hash tables.
git-svn-id: http://v8.googlecode.com/svn/trunk@3608 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 4569038..3003342 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -150,8 +150,12 @@
bool Object::IsSymbol() {
if (!this->IsHeapObject()) return false;
uint32_t type = HeapObject::cast(this)->map()->instance_type();
- return (type & (kIsNotStringMask | kIsSymbolMask)) ==
- (kStringTag | kSymbolTag);
+ // Because the symbol tag is non-zero and no non-string types have the
+ // symbol bit set we can test for symbols with a very simple test
+ // operation.
+ ASSERT(kSymbolTag != 0);
+ ASSERT(kNotStringTag + kIsSymbolMask > LAST_TYPE);
+ return (type & kIsSymbolMask) != 0;
}
@@ -226,7 +230,8 @@
bool StringShape::IsSymbol() {
ASSERT(valid());
- return (type_ & kIsSymbolMask) == kSymbolTag;
+ ASSERT(kSymbolTag != 0);
+ return (type_ & kIsSymbolMask) != 0;
}
@@ -336,8 +341,8 @@
return false;
InstanceType instance_type =
HeapObject::cast(this)->map()->instance_type();
- return (instance_type >= EXTERNAL_BYTE_ARRAY_TYPE &&
- instance_type <= EXTERNAL_FLOAT_ARRAY_TYPE);
+ return (instance_type >= FIRST_EXTERNAL_ARRAY_TYPE &&
+ instance_type <= LAST_EXTERNAL_ARRAY_TYPE);
}