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

Unified Diff: src/compiler/change-lowering.cc

Issue 466673004: Use CommonNodeCache for heap constants in ChangeLowering. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Build fix Created 6 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 | « no previous file | src/compiler/common-node-cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/change-lowering.cc
diff --git a/src/compiler/change-lowering.cc b/src/compiler/change-lowering.cc
index 3f8e45b9e71d70b63cde34c37b986999486ab000..8f3be185935aa0953c9f4de2d6511de36840b8a1 100644
--- a/src/compiler/change-lowering.cc
+++ b/src/compiler/change-lowering.cc
@@ -34,8 +34,11 @@ Node* ChangeLoweringBase::ExternalConstant(ExternalReference reference) {
Node* ChangeLoweringBase::HeapConstant(PrintableUnique<HeapObject> value) {
- // TODO(bmeurer): Use common node cache.
- return graph()->NewNode(common()->HeapConstant(value));
+ Node** loc = cache()->FindHeapConstant(value);
+ if (*loc == NULL) {
+ *loc = graph()->NewNode(common()->HeapConstant(value));
+ }
+ return *loc;
}
« no previous file with comments | « no previous file | src/compiler/common-node-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698