arai-a / smoosh-sync

Automation to make jsparagus and SpiderMonkey bytecode in sync
2 stars 0 forks source link

/js/src/vm/Opcodes.h and 2 more files have been updated (d670b48b) #371

Open github-actions[bot] opened 1 month ago

github-actions[bot] commented 1 month ago

Files

Changesets

Diffs

/js/src/vm/Opcodes.h

--- b46a07d48e50c93bd53adb86f4bb9f95522eb226/js/src/vm/Opcodes.h
+++ d670b48b67d555cfa836a9487c1b3f30bc3e4259/js/src/vm/Opcodes.h
@@ -2634,16 +2634,30 @@
      *
      *   Category: Control flow
      *   Type: Exceptions
      *   Operands:
      *   Stack: exc, stack =>
      */ \
     MACRO(ThrowWithStack, throw_with_stack, NULL, 1, 2, 0, JOF_BYTE) \
     /*
+     * Throw `exc` without jumping to error handling code.
+     *
+     * This sets the pending exception to `exc`, the pending exception stack
+     * to `stack` but unlike ThrowWithStack it doesnt jump to error-handling
+     * code. This is used in Disposable Scopes to set the pending exception as the
+     * initial completion to be used while disposing resources.
+     *
+     *   Category: Control flow
+     *   Type: Exceptions
+     *   Operands:
+     *   Stack: exc, stack =>
+     */ \
+    IF_EXPLICIT_RESOURCE_MANAGEMENT(MACRO(ThrowWithStackWithoutJump, throw_with_stack_without_jump, NULL, 1, 2, 0, JOF_BYTE)) \
+    /*
      * Create and throw an Error object.
      *
      * Sometimes we know at emit time that an operation always throws. For
      * example, `delete super.prop;` is allowed in methods, but always throws a
      * ReferenceError.
      *
      * `msgNumber` determines the `.message` and [[Prototype]] of the new Error
      * object.  It must be an error number in js/public/friend/ErrorNumbers.msg.
@@ -2687,27 +2701,16 @@
      *
      *   Category: Control flow
      *   Type: Exceptions
      *   Operands:
      *   Stack: =>
      */ \
     MACRO(TryDestructuring, try_destructuring, NULL, 1, 0, 0, JOF_BYTE) \
     /*
-     * No-op instruction used by the exception unwinder to determine the
-     * correct environment to unwind to when an exception occurs in a
-     * environment with disposables.
-     *
-     *   Category: Control flow
-     *   Type: Exceptions
-     *   Operands:
-     *   Stack: =>
-     */ \
-    IF_EXPLICIT_RESOURCE_MANAGEMENT(MACRO(TryUsing, try_using, NULL, 1, 0, 0, JOF_BYTE)) \
-    /*
      * Push and clear the pending exception. ┬──┬◡ノ(° -°ノ)
      *
      * This must be used only in the fixed sequence of instructions following a
      * `JSTRY_CATCH` span (see "Bytecode Invariants" above), as that's the only
      * way instructions would run with an exception pending.
      *
      * Used to implement catch-blocks.
      *

/js/src/vm/SharedStencil.h

--- d61d3e8c62cd8299f4ee427b49f9bad5aaec41c4/js/src/vm/SharedStencil.h
+++ d670b48b67d555cfa836a9487c1b3f30bc3e4259/js/src/vm/SharedStencil.h
@@ -83,19 +83,16 @@ struct TryNote {
       case TryNoteKind::Loop:
       case TryNoteKind::ForIn:
       case TryNoteKind::ForOf:
         return true;
       case TryNoteKind::Catch:
       case TryNoteKind::Finally:
       case TryNoteKind::ForOfIterClose:
       case TryNoteKind::Destructuring:
-#ifdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT
-      case TryNoteKind::Using:
-#endif
         return false;
     }
     MOZ_CRASH("Unexpected try note kind");
   }
 };

 // A block scope has a range in bytecode: it is entered at some offset, and left
 // at some later offset.  Scopes can be nested.  Given an offset, the

/js/src/vm/StencilEnums.h

--- d61d3e8c62cd8299f4ee427b49f9bad5aaec41c4/js/src/vm/StencilEnums.h
+++ d670b48b67d555cfa836a9487c1b3f30bc3e4259/js/src/vm/StencilEnums.h
@@ -41,20 +41,16 @@ namespace js {
 enum class TryNoteKind : uint8_t {
   Catch,
   Finally,
   ForIn,
   Destructuring,
   ForOf,
   ForOfIterClose,
   Loop
-#ifdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT
-  ,
-  Using
-#endif
 };

 // [SMDOC] Script Flags
 //
 // Interpreted scripts represented by the BaseScript type use two flag words to
 // encode an assortment of conditions and attributes about the script.
 //
 // The "immutable" flags are a combination of input flags describing aspects of