Lines Matching full:delegate
96 // For each BLOCK|LOOP|TRY, the corresponding END_(BLOCK|LOOP|TRY) or DELEGATE
99 // For each END_(BLOCK|LOOP|TRY) or DELEGATE, the corresponding
120 // Before running rewriteDepthImmediates function, 'delegate' has a BB as its
122 // used for the operand when 'delegate' needs to rethrow to the caller. This
225 // When 'End' is not an 'end_try' but 'delegate, EHPad is nullptr.
712 // We started from an EH pad, so the end marker cannot be a delegate
713 assert(EndTry->getOpcode() != WebAssembly::DELEGATE);
759 if (EndTry->getOpcode() == WebAssembly::DELEGATE)
844 // Wrap the given range of instruction with try-delegate. RangeBegin and
876 // Create a BB to insert the 'delegate' instruction.
878 // If the destination of 'delegate' is not the caller, adds the destination to
886 // delegate BB after the current BB.
892 // put the 'delegate' BB in between. We normally create a split BB and make
911 // BB into two and insert the delegate BB in between.
921 // delegate
941 // delegate
960 // Add 'delegate' instruction in the delegate BB created above.
961 MachineInstr *Delegate = BuildMI(DelegateBB, RangeEnd->getDebugLoc(),
962 TII.get(WebAssembly::DELEGATE))
964 registerTryScope(Try, Delegate, nullptr);
971 // We use the 'delegate' instruction to fix the unwind mismatches. 'delegate'
973 // only 'catch' but all block-like structures including another 'delegate',
975 // 'catch', it will delegate the exception to that catch. It is being
976 // discussed how to define the semantics when 'delegate''s target is a non-try
979 // such code. The example below illustrates where the 'delegate' instruction
980 // in the middle will delegate the exception to, depending on the value of N.
987 // delegate N ;; Where will this delegate to?
991 // delegate ;; N == 2
1026 // call with an inner try-delegate that rethrows the exception to the right
1034 // delegate 1 (bb3) ;; (new)
1066 // case 'delegate's immediate argument is the number of block depths + 1,
1072 // delegate 1 (caller) ;; (new)
1077 // Before rewriteDepthImmediates, delegate's argument is a BB. In case of the
1082 // can be wrapped together in one nested try-delegate scope. (In 1, this
1233 // are going to wrap the invoke with try-delegate, making the 'delegate'
1278 // try-delegate, so we wrap the whole try-catch-end with a try-delegate and
1287 // delegate 1 (caller) ;; (new)
1303 else if (MI.getOpcode() == WebAssembly::DELEGATE)
1364 // Adding a try-delegate wrapping an existing try-catch-end can make existing
1381 // this with a try-delegate. Then this becomes:
1396 // delegate ;; (new instruction)
1403 // 'end_try' and 'end_block' and the BB is split to insert a 'delegate', we
1405 // 'end_try' BB but the new 'end_block' BB. There can be multiple 'delegate's
1451 case WebAssembly::DELEGATE:
1508 case WebAssembly::DELEGATE:
1581 // Delegate's destination is either a catch or a another delegate BB. When the
1582 // destination is another delegate, we can compute the argument in the same
1583 // way as branches, because the target delegate BB only contains the single
1584 // delegate instruction.
1585 if (!MBB->isEHPad()) // Target is a delegate BB
1588 // When the delegate's destination is a catch BB, we need to use its
1600 // fine, but delegate has to exactly target the correct try.
1608 assert(Depth < Stack.size() && "Delegate destination should be in scope");
1665 if (MI.getOpcode() == WebAssembly::DELEGATE)
1679 if (MI.getOpcode() == WebAssembly::DELEGATE)