Accessing V8 Builtins in JavaScript code

17 views
Skip to first unread message

Cyan

unread,
Jul 8, 2025, 3:44:38 AMJul 8
to v8-dev
When developing JavaScript runtime, to prevent users modifying prototype (of Promise, for example, Promise.prototype.then), traditionally, we needs to copy and freeze a copy of Promise.prototype at the runtime bootstrap. But what if we could directly use things in the following
Graph from v8 blogs:
Here, I see a `performPromiseThen`, which almost does exactly Promise.prototype.then, what if we could use native syntax like `performPromiseThen` in runtime internals, so we don't need a primordials anymore?

In WebKit (JavaScriptCore), you have things similar to `promise.@then`, `@isCallable`, `@argumentCount`, etc. That make life much easier, remove every needs of primordials.

I wonder if V8 have, or willing to have such feature?
Reply all
Reply to author
Forward
0 new messages