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

Unified Diff: src/compiler/common-operator.cc

Issue 1759383003: [compiler] Add relocatable pointer constants for wasm memory references. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix uninitialized variable causing msan failure Created 4 years, 8 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/common-operator.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/common-operator.cc
diff --git a/src/compiler/common-operator.cc b/src/compiler/common-operator.cc
index 3bb1b34495fbcef242e04a7257c9b579a7552de0..4b26102afe7977afbd360f10f62d0b20e17cc0c7 100644
--- a/src/compiler/common-operator.cc
+++ b/src/compiler/common-operator.cc
@@ -142,6 +142,25 @@ std::ostream& operator<<(std::ostream& os, ParameterInfo const& i) {
return os;
}
+bool operator==(RelocatablePtrConstantInfo const& lhs,
+ RelocatablePtrConstantInfo const& rhs) {
+ return lhs.rmode() == rhs.rmode() && lhs.value() == rhs.value();
+}
+
+bool operator!=(RelocatablePtrConstantInfo const& lhs,
+ RelocatablePtrConstantInfo const& rhs) {
+ return !(lhs == rhs);
+}
+
+size_t hash_value(RelocatablePtrConstantInfo const& p) {
+ return base::hash_combine(p.value(), p.rmode());
+}
+
+std::ostream& operator<<(std::ostream& os,
+ RelocatablePtrConstantInfo const& p) {
+ return os << p.value() << "|" << p.rmode();
+}
+
#define CACHED_OP_LIST(V) \
V(Dead, Operator::kFoldable, 0, 0, 0, 1, 1, 1) \
V(DeoptimizeIf, Operator::kFoldable, 2, 1, 1, 0, 0, 1) \
@@ -668,6 +687,23 @@ const Operator* CommonOperatorBuilder::HeapConstant(
value); // parameter
}
+const Operator* CommonOperatorBuilder::RelocatableInt32Constant(
+ int32_t value, RelocInfo::Mode rmode) {
+ return new (zone()) Operator1<RelocatablePtrConstantInfo>( // --
+ IrOpcode::kRelocatableInt32Constant, Operator::kPure, // opcode
+ "RelocatableInt32Constant", // name
+ 0, 0, 0, 1, 0, 0, // counts
+ RelocatablePtrConstantInfo(value, rmode)); // parameter
+}
+
+const Operator* CommonOperatorBuilder::RelocatableInt64Constant(
+ int64_t value, RelocInfo::Mode rmode) {
+ return new (zone()) Operator1<RelocatablePtrConstantInfo>( // --
+ IrOpcode::kRelocatableInt64Constant, Operator::kPure, // opcode
+ "RelocatableInt64Constant", // name
+ 0, 0, 0, 1, 0, 0, // counts
+ RelocatablePtrConstantInfo(value, rmode)); // parameter
+}
const Operator* CommonOperatorBuilder::Select(MachineRepresentation rep,
BranchHint hint) {
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698