@@ -4421,17 +4421,16 @@ PBIResult PortableBaselineInterpret(JSContext* cx_, State& state, Stack& stack,
4421
4421
}
4422
4422
4423
4423
CASE (AsyncResolve) {
4424
- // valueOrReason, gen => promise
4425
- auto resolveKind = AsyncFunctionResolveKind (GET_UINT8 (pc));
4424
+ // value, gen => promise
4426
4425
JSObject* promise;
4427
4426
{
4428
4427
ReservedRooted<JSObject*> obj0 (&state.obj0 ,
4429
4428
&POP ().asValue ().toObject ()); // gen
4430
4429
ReservedRooted<Value> value0 (&state.value0 ,
4431
- POP ().asValue ()); // valueOrReason
4430
+ POP ().asValue ()); // value
4432
4431
PUSH_EXIT_FRAME ();
4433
4432
promise = AsyncFunctionResolve (
4434
- cx, obj0.as <AsyncFunctionGeneratorObject>(), value0, resolveKind );
4433
+ cx, obj0.as <AsyncFunctionGeneratorObject>(), value0);
4435
4434
if (!promise) {
4436
4435
goto error;
4437
4436
}
@@ -4440,6 +4439,27 @@ PBIResult PortableBaselineInterpret(JSContext* cx_, State& state, Stack& stack,
4440
4439
END_OP (AsyncResolve);
4441
4440
}
4442
4441
4442
+ CASE (AsyncReject) {
4443
+ // reason, gen => promise
4444
+ JSObject* promise;
4445
+ {
4446
+ ReservedRooted<JSObject*> obj0 (&state.obj0 ,
4447
+ &POP ().asValue ().toObject ()); // gen
4448
+ ReservedRooted<Value> value0 (&state.value0 ,
4449
+ POP ().asValue ()); // stack
4450
+ ReservedRooted<Value> value1 (&state.value1 ,
4451
+ POP ().asValue ()); // reason
4452
+ PUSH_EXIT_FRAME ();
4453
+ promise = AsyncFunctionReject (
4454
+ cx, obj0.as <AsyncFunctionGeneratorObject>(), value1, value0);
4455
+ if (!promise) {
4456
+ goto error;
4457
+ }
4458
+ }
4459
+ PUSH (StackVal (ObjectValue (*promise)));
4460
+ END_OP (AsyncReject);
4461
+ }
4462
+
4443
4463
CASE (CanSkipAwait) {
4444
4464
// value => value, can_skip
4445
4465
bool result = false ;
@@ -4724,6 +4744,17 @@ PBIResult PortableBaselineInterpret(JSContext* cx_, State& state, Stack& stack,
4724
4744
END_OP (Throw);
4725
4745
}
4726
4746
4747
+ CASE (ThrowWithStack) {
4748
+ {
4749
+ ReservedRooted<Value> value0 (&state.value0 , POP ().asValue ());
4750
+ ReservedRooted<Value> value1 (&state.value1 , POP ().asValue ());
4751
+ PUSH_EXIT_FRAME ();
4752
+ MOZ_ALWAYS_FALSE (ThrowWithStackOperation (cx, value1, value0));
4753
+ goto error;
4754
+ }
4755
+ END_OP (ThrowWithStack);
4756
+ }
4757
+
4727
4758
CASE (ThrowMsg) {
4728
4759
{
4729
4760
PUSH_EXIT_FRAME ();
@@ -4760,6 +4791,25 @@ PBIResult PortableBaselineInterpret(JSContext* cx_, State& state, Stack& stack,
4760
4791
END_OP (Exception);
4761
4792
}
4762
4793
4794
+ CASE (ExceptionAndStack) {
4795
+ {
4796
+ ReservedRooted<Value> value0 (&state.value0 );
4797
+ {
4798
+ PUSH_EXIT_FRAME ();
4799
+ if (!cx.getCx ()->getPendingExceptionStack (&value0)) {
4800
+ goto error;
4801
+ }
4802
+ if (!GetAndClearException (cx, &state.res )) {
4803
+ goto error;
4804
+ }
4805
+ }
4806
+ PUSH (StackVal (state.res ));
4807
+ PUSH (StackVal (value0));
4808
+ state.res .setUndefined ();
4809
+ }
4810
+ END_OP (ExceptionAndStack);
4811
+ }
4812
+
4763
4813
CASE (Finally) {
4764
4814
#ifndef __wasi__
4765
4815
if (frameMgr.cxForLocalUseOnly ()->hasAnyPendingInterrupt ()) {
@@ -5256,6 +5306,7 @@ PBIResult PortableBaselineInterpret(JSContext* cx_, State& state, Stack& stack,
5256
5306
sp = reinterpret_cast <StackVal*>(rfe.stackPointer );
5257
5307
TRACE_PRINTF (" -> finally to pc %p\n " , pc);
5258
5308
PUSH (StackVal (rfe.exception ));
5309
+ PUSH (StackVal (rfe.exceptionStack ));
5259
5310
PUSH (StackVal (BooleanValue (true )));
5260
5311
stack.unwindingSP = sp;
5261
5312
goto unwind;
0 commit comments