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

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

Issue 834003002: Version 3.31.74.1 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@3.31
Patch Set: Created 5 years, 12 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/compiler/js-context-specialization.cc ('k') | src/compiler/machine-operator.h » ('j') | 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 b8a7f976e82ce6e4a91726ea7faff57dc87a4b6b..7759ba14418c29c26aaa165d470958ba1abc0f93 100644
--- a/src/compiler/js-graph.cc
+++ b/src/compiler/js-graph.cc
@@ -174,8 +174,11 @@ Node* JSGraph::NumberConstant(double value) {
Node* JSGraph::Float32Constant(float value) {
- // TODO(turbofan): cache float32 constants.
- return graph()->NewNode(common()->Float32Constant(value));
+ Node** loc = cache_.FindFloat32Constant(value);
+ if (*loc == NULL) {
+ *loc = graph()->NewNode(common()->Float32Constant(value));
+ }
+ return *loc;
}
« no previous file with comments | « src/compiler/js-context-specialization.cc ('k') | src/compiler/machine-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698