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

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

Issue 680313003: Move input/output counts directly into Operators, simplying OperatorProperties. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: yes 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/simplified-operator.h ('k') | src/compiler/verifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-operator.cc
diff --git a/src/compiler/simplified-operator.cc b/src/compiler/simplified-operator.cc
index fc8415ff54778ffc268d3d1ab847b2d002b33eb5..15b34f9b9be5b62b2a010f34583b52ec12b0af49 100644
--- a/src/compiler/simplified-operator.cc
+++ b/src/compiler/simplified-operator.cc
@@ -140,53 +140,55 @@ const ElementAccess& ElementAccessOf(const Operator* op) {
V(ObjectIsNonNegativeSmi, Operator::kNoProperties, 1)
-#define ACCESS_OP_LIST(V) \
- V(LoadField, FieldAccess, Operator::kNoWrite, 1, 1) \
- V(StoreField, FieldAccess, Operator::kNoRead, 2, 0) \
- V(LoadElement, ElementAccess, Operator::kNoWrite, 3, 1) \
- V(StoreElement, ElementAccess, Operator::kNoRead, 4, 0)
-
-
-struct SimplifiedOperatorBuilderImpl FINAL {
-#define PURE(Name, properties, input_count) \
- struct Name##Operator FINAL : public SimpleOperator { \
- Name##Operator() \
- : SimpleOperator(IrOpcode::k##Name, Operator::kPure | properties, \
- input_count, 1, #Name) {} \
- }; \
+struct SimplifiedOperatorGlobalCache FINAL {
+#define PURE(Name, properties, input_count) \
+ struct Name##Operator FINAL : public Operator { \
+ Name##Operator() \
+ : Operator(IrOpcode::k##Name, Operator::kPure | properties, #Name, \
+ input_count, 0, 0, 1, 0, 0) {} \
+ }; \
Name##Operator k##Name;
PURE_OP_LIST(PURE)
#undef PURE
};
-static base::LazyInstance<SimplifiedOperatorBuilderImpl>::type kImpl =
+static base::LazyInstance<SimplifiedOperatorGlobalCache>::type kCache =
LAZY_INSTANCE_INITIALIZER;
SimplifiedOperatorBuilder::SimplifiedOperatorBuilder(Zone* zone)
- : impl_(kImpl.Get()), zone_(zone) {}
+ : cache_(kCache.Get()), zone_(zone) {}
#define PURE(Name, properties, input_count) \
- const Operator* SimplifiedOperatorBuilder::Name() { return &impl_.k##Name; }
+ const Operator* SimplifiedOperatorBuilder::Name() { return &cache_.k##Name; }
PURE_OP_LIST(PURE)
#undef PURE
const Operator* SimplifiedOperatorBuilder::ReferenceEqual(Type* type) {
// TODO(titzer): What about the type parameter?
- return new (zone()) SimpleOperator(IrOpcode::kReferenceEqual,
- Operator::kCommutative | Operator::kPure,
- 2, 1, "ReferenceEqual");
+ return new (zone()) Operator(IrOpcode::kReferenceEqual,
+ Operator::kCommutative | Operator::kPure,
+ "ReferenceEqual", 2, 0, 0, 1, 0, 0);
}
-#define ACCESS(Name, Type, properties, input_count, output_count) \
- const Operator* SimplifiedOperatorBuilder::Name(const Type& access) { \
- return new (zone()) \
- Operator1<Type>(IrOpcode::k##Name, Operator::kNoThrow | properties, \
- input_count, output_count, #Name, access); \
+#define ACCESS_OP_LIST(V) \
+ V(LoadField, FieldAccess, Operator::kNoWrite, 1, 1, 1) \
+ V(StoreField, FieldAccess, Operator::kNoRead, 2, 1, 0) \
+ V(LoadElement, ElementAccess, Operator::kNoWrite, 3, 0, 1) \
+ V(StoreElement, ElementAccess, Operator::kNoRead, 4, 1, 0)
+
+
+#define ACCESS(Name, Type, properties, value_input_count, control_input_count, \
+ output_count) \
+ const Operator* SimplifiedOperatorBuilder::Name(const Type& access) { \
+ return new (zone()) \
+ Operator1<Type>(IrOpcode::k##Name, Operator::kNoThrow | properties, \
+ #Name, value_input_count, 1, control_input_count, \
+ output_count, 1, 0, access); \
}
ACCESS_OP_LIST(ACCESS)
#undef ACCESS
« no previous file with comments | « src/compiler/simplified-operator.h ('k') | src/compiler/verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698