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

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

Issue 639123009: Classes: Add basic support for properties (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: git rebase 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/common-operator.h ('k') | src/compiler/control-reducer.h » ('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 5d42d7e84b3ed5413a5d81b955827d41f12bd0cf..c9dea87acca2a6a0706a5904801606f6de49afe9 100644
--- a/src/compiler/common-operator.cc
+++ b/src/compiler/common-operator.cc
@@ -30,6 +30,26 @@ class ControlOperator : public Operator1<int> {
} // namespace
+std::ostream& operator<<(std::ostream& os, BranchHint hint) {
+ switch (hint) {
+ case BranchHint::kNone:
+ return os << "None";
+ case BranchHint::kTrue:
+ return os << "True";
+ case BranchHint::kFalse:
+ return os << "False";
+ }
+ UNREACHABLE();
+ return os;
+}
+
+
+BranchHint BranchHintOf(const Operator* const op) {
+ DCHECK_EQ(IrOpcode::kBranch, op->opcode());
+ return OpParameter<BranchHint>(op);
+}
+
+
size_t hash_value(OutputFrameStateCombine const& sc) {
return base::hash_combine(sc.kind_, sc.parameter_);
}
@@ -74,7 +94,6 @@ std::ostream& operator<<(std::ostream& os, FrameStateCallInfo const& info) {
#define SHARED_OP_LIST(V) \
V(Dead, Operator::kFoldable, 0, 0) \
V(End, Operator::kFoldable, 0, 1) \
- V(Branch, Operator::kFoldable, 1, 1) \
V(IfTrue, Operator::kFoldable, 0, 1) \
V(IfFalse, Operator::kFoldable, 0, 1) \
V(Throw, Operator::kFoldable, 1, 1) \
@@ -110,6 +129,12 @@ SHARED_OP_LIST(SHARED)
#undef SHARED
+const Operator* CommonOperatorBuilder::Branch(BranchHint hint) {
+ return new (zone()) Operator1<BranchHint>(
+ IrOpcode::kBranch, Operator::kFoldable, 1, 0, "Branch", hint);
+}
+
+
const Operator* CommonOperatorBuilder::Start(int num_formal_parameters) {
// Outputs are formal parameters, plus context, receiver, and JSFunction.
const int value_output_count = num_formal_parameters + 3;
@@ -130,6 +155,13 @@ const Operator* CommonOperatorBuilder::Loop(int controls) {
}
+const Operator* CommonOperatorBuilder::Terminate(int effects) {
+ return new (zone()) Operator1<int>(IrOpcode::kTerminate,
+ Operator::kNoRead | Operator::kNoWrite, 0,
+ 0, "Terminate", effects);
+}
+
+
const Operator* CommonOperatorBuilder::Parameter(int index) {
return new (zone()) Operator1<int>(IrOpcode::kParameter, Operator::kPure, 1,
1, "Parameter", index);
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/control-reducer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698