Out of curiosity, I found that in v8 implementation JS Bytecode is executed by Interpreter-Assembler and then to CodeAssembly. Why there is an interpreter assembler between bytecode and machine code? Is there a way to translate Interpreter Assembler (I imagine it is a kind of IR) to LLVM ir so that it is a llvm ir representation that is closer to js bytecode.
There seems to be a misunderstanding: the InterpreterAssembler
is used for creating the bytecode handlers during V8's build process. It is not involved in execution of bytecode (and, in fact, isn't even shipped as part of the final V8 binary). Also, bytecode is not translated to machine code before being executed (that's why we call it an "interpreter"; if it generated machine code first, we'd call it a "compiler").
The InterpreterAssembler
produces a particular form of the IR that V8's "Turbofan" compiler uses. There is no existing way to convert it to LLVM IR.