@@ -547,6 +547,7 @@ struct InstrAttrs {
547
547
M(Call1ArgStub, _) \
548
548
M(CoroutineInitializeStub, _) \
549
549
M(CoroutineTransferStub, _) \
550
+ M(CoroutineForkStub, _) \
550
551
M(LoadThread, kNoGC) \
551
552
M(Deoptimize, kNoGC) \
552
553
M(SimdOp, kNoGC) \
@@ -11477,16 +11478,13 @@ class Call1ArgStubInstr : public TemplateDefinition<1, Throws> {
11477
11478
11478
11479
class CoroutineInitializeStubInstr : public TemplateDefinition<1, NoThrow> {
11479
11480
public:
11480
- CoroutineInitializeStubInstr(const InstructionSource& source,
11481
- Value* root,
11482
- intptr_t deopt_id)
11483
- : TemplateDefinition(source, deopt_id), token_pos_(source.token_pos) {
11481
+ CoroutineInitializeStubInstr(Value* root, intptr_t deopt_id)
11482
+ : TemplateDefinition(InstructionSource(TokenPosition::kNoSource),
11483
+ deopt_id) {
11484
11484
SetInputAt(0, root);
11485
11485
}
11486
11486
11487
11487
Value* root() const { return inputs_[0]; }
11488
- virtual TokenPosition token_pos() const { return token_pos_; }
11489
-
11490
11488
virtual bool CanCallDart() const { return true; }
11491
11489
virtual bool ComputeCanDeoptimize() const { return false; }
11492
11490
virtual bool ComputeCanDeoptimizeAfterCall() const { return true; }
@@ -11497,32 +11495,23 @@ class CoroutineInitializeStubInstr : public TemplateDefinition<1, NoThrow> {
11497
11495
11498
11496
DECLARE_INSTRUCTION(CoroutineInitializeStub);
11499
11497
PRINT_OPERANDS_TO_SUPPORT
11500
-
11501
- #define FIELD_LIST(F) F(const TokenPosition, token_pos_)
11502
-
11503
- DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS(CoroutineInitializeStubInstr,
11504
- TemplateDefinition,
11505
- FIELD_LIST)
11506
- #undef FIELD_LIST
11498
+ DECLARE_EMPTY_SERIALIZATION(CoroutineInitializeStubInstr, TemplateDefinition)
11507
11499
11508
11500
private:
11509
11501
DISALLOW_COPY_AND_ASSIGN(CoroutineInitializeStubInstr);
11510
11502
};
11511
11503
11512
11504
class CoroutineTransferStubInstr : public TemplateDefinition<2, NoThrow> {
11513
11505
public:
11514
- CoroutineTransferStubInstr(const InstructionSource& source,
11515
- Value* from,
11516
- Value* to,
11517
- intptr_t deopt_id)
11518
- : TemplateDefinition(source, deopt_id), token_pos_(source.token_pos) {
11506
+ CoroutineTransferStubInstr(Value* from, Value* to, intptr_t deopt_id)
11507
+ : TemplateDefinition(InstructionSource(TokenPosition::kNoSource),
11508
+ deopt_id) {
11519
11509
SetInputAt(0, from);
11520
11510
SetInputAt(1, to);
11521
11511
}
11522
11512
11523
11513
Value* from() const { return inputs_[0]; }
11524
11514
Value* to() const { return inputs_[1]; }
11525
- virtual TokenPosition token_pos() const { return token_pos_; }
11526
11515
11527
11516
virtual bool CanCallDart() const { return true; }
11528
11517
virtual bool ComputeCanDeoptimize() const { return false; }
@@ -11534,16 +11523,39 @@ class CoroutineTransferStubInstr : public TemplateDefinition<2, NoThrow> {
11534
11523
11535
11524
DECLARE_INSTRUCTION(CoroutineTransferStub);
11536
11525
PRINT_OPERANDS_TO_SUPPORT
11526
+ DECLARE_EMPTY_SERIALIZATION(CoroutineTransferStubInstr, TemplateDefinition)
11537
11527
11538
- #define FIELD_LIST(F) F(const TokenPosition, token_pos_)
11528
+ private:
11529
+ DISALLOW_COPY_AND_ASSIGN(CoroutineTransferStubInstr);
11530
+ };
11539
11531
11540
- DECLARE_INSTRUCTION_SERIALIZABLE_FIELDS(CoroutineTransferStubInstr,
11541
- TemplateDefinition,
11542
- FIELD_LIST)
11543
- #undef FIELD_LIST
11532
+ class CoroutineForkStubInstr : public TemplateDefinition<2, NoThrow> {
11533
+ public:
11534
+ CoroutineForkStubInstr(Value* from, Value* to, intptr_t deopt_id)
11535
+ : TemplateDefinition(InstructionSource(TokenPosition::kNoSource),
11536
+ deopt_id) {
11537
+ SetInputAt(0, from);
11538
+ SetInputAt(1, to);
11539
+ }
11540
+
11541
+ Value* from() const { return inputs_[0]; }
11542
+ Value* to() const { return inputs_[1]; }
11543
+
11544
+ virtual bool CanCallDart() const { return true; }
11545
+ virtual bool ComputeCanDeoptimize() const { return false; }
11546
+ virtual bool ComputeCanDeoptimizeAfterCall() const { return true; }
11547
+ virtual bool HasUnknownSideEffects() const { return true; }
11548
+ virtual intptr_t NumberOfInputsConsumedBeforeCall() const {
11549
+ return InputCount();
11550
+ }
11551
+
11552
+ DECLARE_INSTRUCTION(CoroutineForkStub);
11553
+ PRINT_OPERANDS_TO_SUPPORT
11554
+
11555
+ DECLARE_EMPTY_SERIALIZATION(CoroutineForkStubInstr, TemplateDefinition)
11544
11556
11545
11557
private:
11546
- DISALLOW_COPY_AND_ASSIGN(CoroutineTransferStubInstr );
11558
+ DISALLOW_COPY_AND_ASSIGN(CoroutineForkStubInstr );
11547
11559
};
11548
11560
11549
11561
// Suspends execution using the suspend stub specified using [StubId].
0 commit comments