About LdaSmiExtraWideHandler

26 views
Skip to first unread message

yahan lu

unread,
May 30, 2025, 7:04:55 AM5/30/25
to v8-dev

Hi all~

I'm studying the builtin::LdaSmiExtraWideHandler and want to understand its implementation. However, I can only find source code for the standard LdaSmi handler:

// LdaSmi <imm> // // Load an integer literal into the accumulator as a Smi. IGNITION_HANDLER(LdaSmi, InterpreterAssembler) { TNode<Smi> smi_int = BytecodeOperandImmSmi(0); SetAccumulator(smi_int); Dispatch(); }

Where should I look for the LdaSmiExtraWideHandler implementation?

Marja Hölttä

unread,
May 30, 2025, 7:31:10 AM5/30/25
to v8-...@googlegroups.com
Some pointers:

By searching for "ExtraWide" in code search you can see e.g., this test code snippet:


which tells us how the ExtraWide is used.

The handler for ExtraWide is:


I hope this helps.



--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/v8-dev/27637c18-ef7f-46d5-8b21-229a15608c49n%40googlegroups.com.


--


Google Germany GmbH

Erika-Mann-Straße 33

80636 München


Geschäftsführer: Paul Manicle, Liana Sebastian.

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg


Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.

    

This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.

Leszek Swirski

unread,
May 30, 2025, 7:37:47 AM5/30/25
to v8-...@googlegroups.com
Exactly, as Marja said, "ExtraWide" is a separate bytecode that puts the interpreter into "ExtraWide" mode for the next dispatch (by changing the dispatch table). Then, each IGNITION_HANDLER defined bytecode has a Wide and ExtraWide equivalent, which are all generated from the same source; the LdaSmi you linked below is generated three times, with BytecodeOperandImmSmi behaving differently for each generation (as controlled by "operand_scale()" in https://source.chromium.org/chromium/chromium/src/+/main:v8/src/interpreter/interpreter-assembler.cc;l=593;drc=0dc30698370bcde67dda4f48b7ca19bf4c1dbc17)

Reply all
Reply to author
Forward
0 new messages