Fix potential assertion failure.

R=mvstanton@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17621 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
yangguo@chromium.org 2013-11-11 15:28:47 +00:00
parent c304afe54d
commit 7fd7bbdcad
3 changed files with 1 additions and 8 deletions

View File

@ -310,8 +310,7 @@ Handle<String> ConcatStringContent(Handle<StringType> result,
Handle<String> Factory::NewFlatConcatString(Handle<String> first, Handle<String> Factory::NewFlatConcatString(Handle<String> first,
Handle<String> second) { Handle<String> second) {
int total_length = first->length() + second->length(); int total_length = first->length() + second->length();
if (first->IsOneByteRepresentationUnderneath() && if (first->IsOneByteRepresentation() && second->IsOneByteRepresentation()) {
second->IsOneByteRepresentationUnderneath()) {
return ConcatStringContent<uint8_t>( return ConcatStringContent<uint8_t>(
NewRawOneByteString(total_length), first, second); NewRawOneByteString(total_length), first, second);
} else { } else {

View File

@ -8339,11 +8339,6 @@ SmartArrayPointer<char> String::ToCString(AllowNullsFlag allow_nulls,
} }
const uc16* String::GetTwoByteData() {
return GetTwoByteData(0);
}
const uc16* String::GetTwoByteData(unsigned start) { const uc16* String::GetTwoByteData(unsigned start) {
ASSERT(!IsOneByteRepresentationUnderneath()); ASSERT(!IsOneByteRepresentationUnderneath());
switch (StringShape(this).representation_tag()) { switch (StringShape(this).representation_tag()) {

View File

@ -8611,7 +8611,6 @@ class String: public Name {
static const int kMaxShortPrintLength = 1024; static const int kMaxShortPrintLength = 1024;
// Support for regular expressions. // Support for regular expressions.
const uc16* GetTwoByteData();
const uc16* GetTwoByteData(unsigned start); const uc16* GetTwoByteData(unsigned start);
// Helper function for flattening strings. // Helper function for flattening strings.