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

Unified Diff: src/compiler/js-graph.cc

Issue 1529053003: [turbofan] Flatten cons strings before embedding them into optimized code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@HeapConstants
Patch Set: Created 5 years 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/compiler/js-frame-specialization.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-graph.cc
diff --git a/src/compiler/js-graph.cc b/src/compiler/js-graph.cc
index 9c1baa00e644f9c5d2091a1f4c7c55909dfa1ac2..594cb6445bac0ff397b0f4bc88a11a432ffac98a 100644
--- a/src/compiler/js-graph.cc
+++ b/src/compiler/js-graph.cc
@@ -72,7 +72,9 @@ Node* JSGraph::NaNConstant() {
Node* JSGraph::HeapConstant(Handle<HeapObject> value) {
- // TODO(bmeurer): Flatten cons strings here before we canonicalize them?
+ if (value->IsConsString()) {
Yang 2015/12/16 06:24:16 String::Flatten already checks for cons string. No
Benedikt Meurer 2015/12/16 06:26:02 That doesn't really help, since we'd have to test
+ value = String::Flatten(Handle<String>::cast(value), TENURED);
+ }
Node** loc = cache_.FindHeapConstant(value);
if (*loc == nullptr) {
*loc = graph()->NewNode(common()->HeapConstant(value));
« no previous file with comments | « src/compiler/js-frame-specialization.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698