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

Unified Diff: src/heap.cc

Issue 2076010: Try flattening strings before comparing for equality. (Closed)
Patch Set: Created 10 years, 7 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 | src/objects.h » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index d33d91ab4ad8f8e85fca4609b69fa56b5b9f7097..d554a3ba684c10517bc6cbb2cd5620ebceef564c 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2080,7 +2080,7 @@ Object* Heap::AllocateSubString(String* buffer,
}
// Make an attempt to flatten the buffer to reduce access time.
- buffer->TryFlatten();
+ buffer = buffer->TryFlattenGetString();
Object* result = buffer->IsAsciiRepresentation()
? AllocateRawAsciiString(length, pretenure )
« no previous file with comments | « no previous file | src/objects.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698