A list of optcodes for each bytecode

15 views
Skip to first unread message

TL

unread,
Aug 17, 2020, 11:02:54 AM8/17/20
to v8-users
Hi everyone,

I hope all our group members are safe and healthy.

I'm doing a research on JS engines and I would like to into v8 as it is the engine for the largest web browser in the market.

As a beginning, I would like to understand the bytecode of it, and I want is the opcodes for every bytecode. For example, opcode for Mov is 27 and opcode for LdaConstant is 12, etc.

I was searching through the source code especially the interpreter files, such as bytecodes.h, to see whether such information is available, but I can find the list of bytecodes, but not the corresponding opcodes.

Is there any where that I can retrieve this data? The opcodes.

If anyone can direct me to the place, that would be very much appreciated.

Thank you and I hope you all for the well-being.

Thank you.

Jakob Kummerow

unread,
Aug 17, 2020, 1:26:30 PM8/17/20
to v8-users
bytecodes.h is the right place; the list of bytecodes is generated by the following macro:

// Enumeration of interpreter bytecodes.
enum class Bytecode : uint8_t {
#define DECLARE_BYTECODE(Name, ...) k##Name,
  BYTECODE_LIST(DECLARE_BYTECODE)
#undef DECLARE_BYTECODE



--
--
Reply all
Reply to author
Forward
0 new messages