Index: src/compiler/js-graph.cc |
diff --git a/src/compiler/js-graph.cc b/src/compiler/js-graph.cc |
index 98ca7aa3c3f831dc36bb59e569ebc772447dedfc..b5e01cf966b4af80fab9d67e7c0b55f5b0f7f91d 100644 |
--- a/src/compiler/js-graph.cc |
+++ b/src/compiler/js-graph.cc |
@@ -139,6 +139,28 @@ Node* JSGraph::Int64Constant(int64_t value) { |
return *loc; |
} |
+Node* JSGraph::RelocatableInt32Constant(int32_t value, RelocInfo::Mode rmode) { |
+ Node** loc = cache_.FindRelocatableInt32Constant(value); |
+ if (*loc == nullptr) { |
+ *loc = graph()->NewNode(common()->RelocatableInt32Constant(value, rmode)); |
+ } |
+ return *loc; |
+} |
+ |
+Node* JSGraph::RelocatableInt64Constant(int64_t value, RelocInfo::Mode rmode) { |
+ Node** loc = cache_.FindRelocatableInt64Constant(value); |
+ if (*loc == nullptr) { |
+ *loc = graph()->NewNode(common()->RelocatableInt64Constant(value, rmode)); |
+ } |
+ return *loc; |
+} |
+ |
+Node* JSGraph::RelocatableIntPtrConstant(intptr_t value, |
+ RelocInfo::Mode rmode) { |
+ return kPointerSize == 8 |
+ ? RelocatableInt64Constant(value, rmode) |
+ : RelocatableInt32Constant(static_cast<int>(value), rmode); |
+} |
Node* JSGraph::NumberConstant(double value) { |
Node** loc = cache_.FindNumberConstant(value); |