Version 3.16.3
Improved GC performance when moving parts of a FixedArray (issue 2452).
Enabled readline on d8 while building a shared lib (issue 1781).
Fixed missing exception check in typed array constructor (Chromium issue 168545).
Check for read-only-ness when preparing for array sort (issue 2419).
Performance and stability improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@13346 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/heap-inl.h b/src/heap-inl.h
index deb767e..6f4b69c 100644
--- a/src/heap-inl.h
+++ b/src/heap-inl.h
@@ -112,10 +112,12 @@
}
-MaybeObject* Heap::AllocateSymbol(Vector<const char> str,
- int chars,
- uint32_t hash_field) {
- if (IsOneByte(str, chars)) return AllocateAsciiSymbol(str, hash_field);
+MaybeObject* Heap::AllocateSymbolFromUtf8(Vector<const char> str,
+ int chars,
+ uint32_t hash_field) {
+ if (IsOneByte(str, chars)) {
+ return AllocateOneByteSymbol(Vector<const uint8_t>::cast(str), hash_field);
+ }
return AllocateInternalSymbol<false>(str, chars, hash_field);
}
@@ -129,10 +131,10 @@
}
-MaybeObject* Heap::AllocateAsciiSymbol(Vector<const char> str,
+MaybeObject* Heap::AllocateOneByteSymbol(Vector<const uint8_t> str,
uint32_t hash_field) {
if (str.length() > SeqOneByteString::kMaxLength) {
- return Failure::OutOfMemoryException();
+ return Failure::OutOfMemoryException(0x2);
}
// Compute map and object size.
Map* map = ascii_symbol_map();
@@ -166,7 +168,7 @@
MaybeObject* Heap::AllocateTwoByteSymbol(Vector<const uc16> str,
uint32_t hash_field) {
if (str.length() > SeqTwoByteString::kMaxLength) {
- return Failure::OutOfMemoryException();
+ return Failure::OutOfMemoryException(0x3);
}
// Compute map and object size.
Map* map = symbol_map();
@@ -261,8 +263,9 @@
MaybeObject* Heap::NumberFromUint32(
uint32_t value, PretenureFlag pretenure) {
- if ((int32_t)value >= 0 && Smi::IsValid((int32_t)value)) {
- return Smi::FromInt((int32_t)value);
+ if (static_cast<int32_t>(value) >= 0 &&
+ Smi::IsValid(static_cast<int32_t>(value))) {
+ return Smi::FromInt(static_cast<int32_t>(value));
}
// Bypass NumberFromDouble to avoid various redundant checks.
return AllocateHeapNumber(FastUI2D(value), pretenure);