| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index 2b874ac4885e2c84c61e0d6cf88556c120435f0c..6bc7f5f15ab6e30e76cc6a2ddebe94a50456c348 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -5132,7 +5132,6 @@ static inline int WriteHelper(const String* string,
|
| ENTER_V8(isolate);
|
| DCHECK(start >= 0 && length >= -1);
|
| i::Handle<i::String> str = Utils::OpenHandle(string);
|
| - isolate->string_tracker()->RecordWrite(str);
|
| if (options & String::HINT_MANY_WRITES_EXPECTED) {
|
| // Flatten the string for efficiency. This applies whether we are
|
| // using StringCharacterStream or Get(i) to access the characters.
|
| @@ -5838,9 +5837,6 @@ bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) {
|
| return false; // Already an external string.
|
| }
|
| ENTER_V8(isolate);
|
| - if (isolate->string_tracker()->IsFreshUnusedString(obj)) {
|
| - return false;
|
| - }
|
| if (isolate->heap()->IsInGCPostProcessing()) {
|
| return false;
|
| }
|
| @@ -5865,9 +5861,6 @@ bool v8::String::MakeExternal(
|
| return false; // Already an external string.
|
| }
|
| ENTER_V8(isolate);
|
| - if (isolate->string_tracker()->IsFreshUnusedString(obj)) {
|
| - return false;
|
| - }
|
| if (isolate->heap()->IsInGCPostProcessing()) {
|
| return false;
|
| }
|
| @@ -5888,9 +5881,10 @@ bool v8::String::CanMakeExternal() {
|
| i::Handle<i::String> obj = Utils::OpenHandle(this);
|
| i::Isolate* isolate = obj->GetIsolate();
|
|
|
| - if (isolate->string_tracker()->IsFreshUnusedString(obj)) 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;
|
| + if (size <= i::ExternalString::kShortSize) return false;
|
| i::StringShape shape(*obj);
|
| return !shape.IsExternal();
|
| }
|
|
|