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

Unified Diff: src/api.cc

Issue 1269343002: Retire StringTracker. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 | « src/api.h ('k') | src/isolate.h » ('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 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();
}
« no previous file with comments | « src/api.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698