Why keep embedded.S in v8_snapshot?

40 views
Skip to first unread message

Yahan Lu

unread,
Dec 19, 2023, 3:33:30 AM12/19/23
to v8-dev
V8 disable Embedded Builtins ( https://v8.dev/blog/short-builtin-calls) and load builtins from snapshot_blob.bin. I think v8 don't need to add embedded.S into source.


if (emit_builtins_as_inline_asm) {
deps += [ ":asm_to_inline_asm_default" ]
sources += [ "$target_gen_dir/embedded.cc" ]
} else {
sources += [ "$target_gen_dir/embedded.S" ]
}

Yahan Lu

unread,
Dec 19, 2023, 3:37:33 AM12/19/23
to v8-dev
I see only these builtins from embedded.S

extern "C" {
void Builtins_InterpreterEnterAtBytecode();
void Builtins_InterpreterEnterAtNextBytecode();
void Builtins_ContinueToCodeStubBuiltinWithResult();
void Builtins_ContinueToCodeStubBuiltin();
void Builtins_ContinueToJavaScriptBuiltinWithResult();
void Builtins_ContinueToJavaScriptBuiltin();
void construct_stub_create_deopt_addr();
void construct_stub_invoke_deopt_addr();
void Builtins_BaselineOrInterpreterEnterAtBytecode();
void Builtins_BaselineOrInterpreterEnterAtNextBytecode();
void Builtins_RestartFrameTrampoline();
typedef void (*function_ptr)();
}

Wenqin Yang

unread,
Dec 19, 2023, 9:15:11 PM12/19/23
to v8-dev
IIUC, the current builtins is embedded into d8 binary, at least x64 did.

Let's take `Builtins_LoadGlobalIC` as an example:
here are the contents for it in the `embedded.S`:
embed-s.jpg

here are contents from `objdump -d -C d8`:
objdump.jpg

We could see they're same code, and there is `Builtins_LoadGlobalIC` symbol in d8 binary, so we could say the builtins were embedded?

I suppose the second image you posted may just contains a part of builtins not all builtins, it may just use to verify the address of these builtins, is it correct?
Reply all
Reply to author
Forward
0 new messages