Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 538071af1924a2dd24b627a6bcfb813a9bcfc2fc..abe50f69bca84e446d061f0e79daac199250c7f9 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -5545,6 +5545,11 @@ bool v8::String::CanMakeExternal() { |
i::Handle<i::String> obj = Utils::OpenHandle(this); |
i::Isolate* isolate = obj->GetIsolate(); |
+ // TODO(yangguo): Externalizing sliced/cons strings allocates. |
+ // This rule can be removed when all code that can |
+ // trigger an access check is handlified and therefore GC safe. |
+ if (isolate->heap()->old_pointer_space()->Contains(*obj)) return false; |
+ |
if (isolate->string_tracker()->IsFreshUnusedString(obj)) return false; |
int size = obj->Size(); // Byte size of the original string. |
if (size < i::ExternalString::kShortSize) return false; |