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 one more file have been updated (d35fc9b3) #343

Open github-actions[bot] opened 1 year ago

github-actions[bot] commented 1 year ago

Files

Changesets

Diffs

/js/src/vm/BytecodeUtil.cpp

--- b713131d3c1f364c35447081832ef027a4d9642e/js/src/vm/BytecodeUtil.cpp
+++ d35fc9b3fd75c3cdfc0a3ed6616309c9121f02ec/js/src/vm/BytecodeUtil.cpp
@@ -2160,16 +2160,17 @@ bool ExpressionDecompiler::decompilePC(j
         MOZ_ASSERT(defIndex == 1);
         return write("MOREITER");

       case JSOp::NewInit:
       case JSOp::NewObject:
       case JSOp::ObjWithProto:
         return write("OBJ");

+      case JSOp::OptimizeGetIterator:
       case JSOp::OptimizeSpreadCall:
         return write("OPTIMIZED");

       case JSOp::Rest:
         return write("REST");

       case JSOp::Resume:
         return write("RVAL");

/js/src/vm/Opcodes.h

--- 80e6d5eca07bded1b32b69234a05a6ad3530b45d/js/src/vm/Opcodes.h
+++ d35fc9b3fd75c3cdfc0a3ed6616309c9121f02ec/js/src/vm/Opcodes.h
@@ -1406,16 +1406,28 @@
      * [2]: https://tc39.es/ecma262/#sec-iteratorclose
      *   Category: Objects
      *   Type: Iteration
      *   Operands: CompletionKind kind
      *   Stack: iter =>
      */ \
     MACRO(CloseIter, close_iter, NULL, 2, 1, 0, JOF_UINT8|JOF_IC) \
     /*
+     * If we can optimize iteration for `iterable`, meaning that it is a packed
+     * array and nothing important has been tampered with, then we replace it
+     * with `true`, otherwise we replace it with `false`. This is similar in
+     * operation to OptimizeSpreadCall.
+     *
+     *   Category: Objects
+     *   Type: Iteration
+     *   Operands:
+     *   Stack: iterable => is_optimizable
+     */ \
+    MACRO(OptimizeGetIterator, optimize_get_iterator, NULL, 1, 1, 1, JOF_BYTE|JOF_IC) \
+    /*
      * Check that the top value on the stack is an object, and throw a
      * TypeError if not. `kind` is used only to generate an appropriate error
      * message.
      *
      * Implements: [GetIterator][1] step 5, [IteratorNext][2] step 3. Both
      * operations call a JS method which scripts can define however they want,
      * so they check afterwards that the method returned an object.
      *
@@ -3568,24 +3580,23 @@

 // clang-format on

 /*
  * In certain circumstances it may be useful to "pad out" the opcode space to
  * a power of two.  Use this macro to do so.
  */
 #define FOR_EACH_TRAILING_UNUSED_OPCODE(MACRO) \
-  IF_RECORD_TUPLE(/* empty */, MACRO(231))     \
   IF_RECORD_TUPLE(/* empty */, MACRO(232))     \
   IF_RECORD_TUPLE(/* empty */, MACRO(233))     \
   IF_RECORD_TUPLE(/* empty */, MACRO(234))     \
   IF_RECORD_TUPLE(/* empty */, MACRO(235))     \
   IF_RECORD_TUPLE(/* empty */, MACRO(236))     \
   IF_RECORD_TUPLE(/* empty */, MACRO(237))     \
-  MACRO(238)                                   \
+  IF_RECORD_TUPLE(/* empty */, MACRO(238))     \
   MACRO(239)                                   \
   MACRO(240)                                   \
   MACRO(241)                                   \
   MACRO(242)                                   \
   MACRO(243)                                   \
   MACRO(244)                                   \
   MACRO(245)                                   \
   MACRO(246)                                   \