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

Unified Diff: src/compiler/operator.cc

Issue 636893002: [turbofan] Drop broken StaticParameterTraits. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix typo... Created 6 years, 2 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/operator.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/operator.cc
diff --git a/src/compiler/operator.cc b/src/compiler/operator.cc
index 35f9c889be314d3f94f91ea5b9186bacacb9d8ff..59354246dfdd94c388a30cd7d4800905434367b8 100644
--- a/src/compiler/operator.cc
+++ b/src/compiler/operator.cc
@@ -4,6 +4,8 @@
#include "src/compiler/operator.h"
+#include <limits>
+
namespace v8 {
namespace internal {
namespace compiler {
@@ -11,16 +13,44 @@ namespace compiler {
Operator::~Operator() {}
+std::ostream& operator<<(std::ostream& os, const Operator& op) {
+ op.PrintTo(os);
+ return os;
+}
+
+
SimpleOperator::SimpleOperator(Opcode opcode, Properties properties,
- int input_count, int output_count,
+ size_t input_count, size_t output_count,
const char* mnemonic)
: Operator(opcode, properties, mnemonic),
- input_count_(input_count),
- output_count_(output_count) {}
+ input_count_(static_cast<uint8_t>(input_count)),
+ output_count_(static_cast<uint8_t>(output_count)) {
+ DCHECK(input_count <= std::numeric_limits<uint8_t>::max());
+ DCHECK(output_count <= std::numeric_limits<uint8_t>::max());
+}
SimpleOperator::~SimpleOperator() {}
+
+bool SimpleOperator::Equals(const Operator* that) const {
+ return opcode() == that->opcode();
+}
+
+
+size_t SimpleOperator::HashCode() const {
+ return base::hash<Opcode>()(opcode());
+}
+
+
+int SimpleOperator::InputCount() const { return input_count_; }
+
+
+int SimpleOperator::OutputCount() const { return output_count_; }
+
+
+void SimpleOperator::PrintTo(std::ostream& os) const { os << mnemonic(); }
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/operator.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698