Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 5ec33895e44d50f568edeff1b0c944fd4eff5b53..3bae87d5a4f8427431ded12014bab11b667a85b0 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -5186,11 +5186,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_URIEscape) { |
ASSERT(args.length() == 1); |
CONVERT_ARG_HANDLE_CHECKED(String, source, 0); |
Handle<String> string = FlattenGetString(source); |
- String::FlatContent content = string->GetFlatContent(); |
- ASSERT(content.IsFlat()); |
- Handle<String> result = |
- content.IsAscii() ? URIEscape::Escape<uint8_t>(isolate, source) |
- : URIEscape::Escape<uc16>(isolate, source); |
+ ASSERT(string->IsFlat()); |
+ Handle<String> result = string->IsOneByteRepresentationUnderneath() |
+ ? URIEscape::Escape<uint8_t>(isolate, source) |
+ : URIEscape::Escape<uc16>(isolate, source); |
if (result.is_null()) return Failure::OutOfMemoryException(0x12); |
return *result; |
} |
@@ -5201,10 +5200,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_URIUnescape) { |
ASSERT(args.length() == 1); |
CONVERT_ARG_HANDLE_CHECKED(String, source, 0); |
Handle<String> string = FlattenGetString(source); |
- String::FlatContent content = string->GetFlatContent(); |
- ASSERT(content.IsFlat()); |
- return content.IsAscii() ? *URIUnescape::Unescape<uint8_t>(isolate, source) |
- : *URIUnescape::Unescape<uc16>(isolate, source); |
+ ASSERT(string->IsFlat()); |
+ return string->IsOneByteRepresentationUnderneath() |
+ ? *URIUnescape::Unescape<uint8_t>(isolate, source) |
+ : *URIUnescape::Unescape<uc16>(isolate, source); |
} |
@@ -5733,6 +5732,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringToArray) { |
if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
} |
elements = Handle<FixedArray>(FixedArray::cast(obj), isolate); |
+ AssertNoAllocation no_gc; |
String::FlatContent content = s->GetFlatContent(); |
if (content.IsAscii()) { |
Vector<const uint8_t> chars = content.ToOneByteVector(); |
@@ -6588,6 +6588,7 @@ static Object* FlatStringCompare(String* x, String* y) { |
equal_prefix_result = Smi::FromInt(LESS); |
} |
int r; |
+ AssertNoAllocation no_gc; |
String::FlatContent x_content = x->GetFlatContent(); |
String::FlatContent y_content = y->GetFlatContent(); |
if (x_content.IsAscii()) { |
@@ -12835,6 +12836,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Log) { |
ASSERT(args.length() == 2); |
CONVERT_ARG_CHECKED(String, format, 0); |
CONVERT_ARG_CHECKED(JSArray, elms, 1); |
+ AssertNoAllocation no_gc; |
String::FlatContent format_content = format->GetFlatContent(); |
RUNTIME_ASSERT(format_content.IsAscii()); |
Vector<const uint8_t> chars = format_content.ToOneByteVector(); |