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

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

Issue 2622833002: WIP [esnext] implement async iteration proposal (Closed)
Patch Set: simplify AsyncIteratorValueUnwrap Created 3 years, 11 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/js-operator.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-operator.cc
diff --git a/src/compiler/js-operator.cc b/src/compiler/js-operator.cc
index e4b4fea4ceca75152316add415a05954de729a98..44759b0a947872a93dd7a5e091345070704ef678 100644
--- a/src/compiler/js-operator.cc
+++ b/src/compiler/js-operator.cc
@@ -490,6 +490,32 @@ const CreateLiteralParameters& CreateLiteralParametersOf(const Operator* op) {
return OpParameter<CreateLiteralParameters>(op);
}
+bool operator==(GeneratorStoreParameters const& lhs,
+ GeneratorStoreParameters const& rhs) {
+ return lhs.register_count() == rhs.register_count() &&
+ lhs.suspend_type() == rhs.suspend_type();
+}
+bool operator!=(GeneratorStoreParameters const& lhs,
+ GeneratorStoreParameters const& rhs) {
+ return !(lhs == rhs);
+}
+
+size_t hash_value(GeneratorStoreParameters const& p) {
+ return base::hash_combine(p.register_count(),
+ static_cast<int>(p.suspend_type()));
+}
+
+std::ostream& operator<<(std::ostream& os, GeneratorStoreParameters const& p) {
+ const char* suspend_type =
+ p.suspend_type() == SuspendType::kYield ? "yield" : "await";
+ return os << p.register_count() << " (" << suspend_type << ")";
+}
+
+const GeneratorStoreParameters& GeneratorStoreParametersOf(const Operator* op) {
+ DCHECK_EQ(op->opcode(), IrOpcode::kJSGeneratorStore);
+ return OpParameter<GeneratorStoreParameters>(op);
+}
+
BinaryOperationHint BinaryOperationHintOf(const Operator* op) {
DCHECK(op->opcode() == IrOpcode::kJSBitwiseOr ||
op->opcode() == IrOpcode::kJSBitwiseXor ||
@@ -781,12 +807,14 @@ const Operator* JSOperatorBuilder::LoadProperty(
access); // parameter
}
-const Operator* JSOperatorBuilder::GeneratorStore(int register_count) {
- return new (zone()) Operator1<int>( // --
- IrOpcode::kJSGeneratorStore, Operator::kNoThrow, // opcode
- "JSGeneratorStore", // name
- 3 + register_count, 1, 1, 0, 1, 0, // counts
- register_count); // parameter
+const Operator* JSOperatorBuilder::GeneratorStore(int register_count,
+ SuspendType suspend_type) {
+ GeneratorStoreParameters parameters(register_count, suspend_type);
+ return new (zone()) Operator1<GeneratorStoreParameters>( // --
+ IrOpcode::kJSGeneratorStore, Operator::kNoThrow, // opcode
+ "JSGeneratorStore", // name
+ 3 + register_count, 1, 1, 0, 1, 0, // counts
+ parameters); // parameter
}
const Operator* JSOperatorBuilder::GeneratorRestoreRegister(int index) {
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698