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

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: Ignore the length of strings 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 42c59538337a39db3796c733a51dcd2c23a693b9..cb5811810f4e80ed48ef4e20185a4d69c93080f9 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6011,12 +6011,8 @@ bool v8::String::CanMakeExternal() {
i::Handle<i::String> obj = Utils::OpenHandle(this);
i::Isolate* isolate = obj->GetIsolate();
- // 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();
Yang 2016/06/09 05:45:05 Why drop this condition? If the string is already
peria 2016/06/09 06:51:59 I agree that externalized strings should not be ex
+ // Do not externalize new strings.
+ 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