Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: src/api.cc

Issue 2046933002: [V8] Make String::CanMakeExternal ignore the length of new strings (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove check of length Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698