Seeking Guidance on V8 and C/C++ Contributions for beginners

59 views
Skip to first unread message

Maroyi Bisoka

unread,
Dec 5, 2024, 12:35:04 PM12/5/24
to v8-dev
Hello! I'm an undergraduate student in computer engineering, and I have a strong interest in understanding how things work at a fundamental level, particularly the V8 JavaScript engine. However, I find it challenging to locate beginner-friendly resources that explain V8's inner workings. I am reaching out in hopes of receiving guidance on where to start.

I learned C/C++ during my second or third semester and developed a keen interest in these languages. I would love to engage in a project or contribute to an existing one in C/C++. Unfortunately, most of the resources I find online focus on basic programming tasks, which makes me feel like C/C++ is not as valuable as it truly is. Deep down, I know that C/C++ are powerful and important languages.

If you have any suggestions on how to better understand V8 or if you know of any C/C++ projects where I could contribute, I would greatly appreciate your help!

Ben Noordhuis

unread,
Dec 5, 2024, 1:29:19 PM12/5/24
to v8-...@googlegroups.com
I'm not aware of anything comprehensive that is also recent.
https://jayconrod.com/tags/v8 was great but is pretty outdated by now.

https://wingolog.org/tags/v8 has some great and fairly up-to-date
posts, although they're more about specific parts of V8, no big
picture design studies.

Yehoshua Segal

unread,
Dec 5, 2024, 2:36:40 PM12/5/24
to v8-...@googlegroups.com
You might find the v8 docs themselves valuable, I certainly have.


You might be able to get some value from the following post, although it focuses on security (I've found it a nice overview in general)


Good luck!

--
--
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/CAHQurc-XQNOr-tjTsYou%2BseEceWEU7m93%2BLbrcoe9VWjaeVdKw%40mail.gmail.com.


--
Yehoshua Segal
(+1) 718-415-2830 (no extension)

Marja Hölttä

unread,
Dec 6, 2024, 7:59:09 AM12/6/24
to v8-...@googlegroups.com
I'd suggest inspecting what the various compiler tiers do by running d8 with the following command line flags:

--print-bytecode
--print-maglev-code (you might also want to pass --no-debug-code to make it less cluttered)
--print-maglev-graph

And then you can use code search ( cs.chromium.org ) with the things you see (e.g., bytecode names) to find out what is happening under the hood. Oldschool printf debugging works really well in V8, we have Print() functions for a bunch of things (especially V8 objects).

You can also insert a breakpoint in the generated machine code in gdb and inspect what it does. There the V8 gdb macros ( v8/tools/gdbinit ) are helpful, esp. the "job" macro enables you to print out V8 objects.

You can also look at what V8 mjsunit tests do. There you can find a bunch of helpers (%PrepareFunctionForOptimization , %DebugPrint, %SystemBreak etc) which are also very useful.

Good luck!





Marja Hölttä

unread,
Dec 6, 2024, 2:53:23 PM12/6/24
to v8-...@googlegroups.com
Here's a slide deck which covers [some] V8 basics. I hope this helps:


--


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.

Reply all
Reply to author
Forward
0 new messages