Bug 1595690 - Change JSOp enum storage type to uint8_t. r=jwalden
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 14 Nov 2019 19:21:07 +0000
changeset 502122 58d5d2a329f5cdb6b7a4d2f866d142340b4e7686
parent 502121 1e1617c67238dfb685fb3d07bf1793232c4469fa
child 502123 58992c594ec72fb65591fe9088e207ef9e6e8cb1
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1595690
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1595690 - Change JSOp enum storage type to uint8_t. r=jwalden A bit more efficient when saving a JSOp in a data structure. It's also compatible with jsbytecode. Differential Revision: https://phabricator.services.mozilla.com/D52627
js/src/vm/BytecodeUtil.h
--- a/js/src/vm/BytecodeUtil.h
+++ b/js/src/vm/BytecodeUtil.h
@@ -23,23 +23,23 @@
 #include "js/TypeDecls.h"
 #include "js/UniquePtr.h"
 #include "vm/Opcodes.h"
 #include "vm/Printer.h"
 
 /*
  * JS operation bytecodes.
  */
-typedef enum JSOp {
+enum JSOp : uint8_t {
 #define ENUMERATE_OPCODE(op, val, ...) op = val,
   FOR_EACH_OPCODE(ENUMERATE_OPCODE)
 #undef ENUMERATE_OPCODE
 
       JSOP_LIMIT
-} JSOp;
+};
 
 /*
  * [SMDOC] Bytecode Format flags (JOF_*)
  */
 enum {
   JOF_BYTE = 0,         /* single bytecode, no immediates */
   JOF_UINT8 = 1,        /* unspecified uint8_t argument */
   JOF_UINT16 = 2,       /* unspecified uint16_t argument */