Version 2.2.0.
Fixed a few minor bugs.
Performance improvements for string operations.
git-svn-id: http://v8.googlecode.com/svn/trunk@4302 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/objects-inl.h b/src/objects-inl.h
index a26da7d..6d7bad7 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -255,6 +255,16 @@
}
+bool String::IsExternalTwoByteStringWithAsciiChars() {
+ if (!IsExternalTwoByteString()) return false;
+ const uc16* data = ExternalTwoByteString::cast(this)->resource()->data();
+ for (int i = 0, len = length(); i < len; i++) {
+ if (data[i] > kMaxAsciiCharCode) return false;
+ }
+ return true;
+}
+
+
bool StringShape::IsCons() {
return (type_ & kStringRepresentationMask) == kConsStringTag;
}