Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 2679a363f7fc0c0b8227348378e471cfbdd75f0f..824edf699c201745c38065190566c3ee1ab58d8a 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -5971,14 +5971,11 @@ bool v8::String::MakeExternal( |
bool v8::String::CanMakeExternal() { |
i::Handle<i::String> obj = Utils::OpenHandle(this); |
- i::Isolate* isolate = obj->GetIsolate(); |
+ if (obj->IsExternalString()) return false; |
// Old space strings should be externalized. |
- if (!isolate->heap()->new_space()->Contains(*obj)) return true; |
- int size = obj->Size(); // Byte size of the original string. |
- if (size <= i::ExternalString::kShortSize) return false; |
- i::StringShape shape(*obj); |
- return !shape.IsExternal(); |
+ i::Isolate* isolate = obj->GetIsolate(); |
+ return !isolate->heap()->new_space()->Contains(*obj); |
} |