Node: Migration of core modules to primordials

Created on 28 Nov 2019  路  2Comments  路  Source: nodejs/node

This is a tracking issue for the migration of core modules to use builtins from the primordials object.

At the moment, for performance-sensitive code, only static methods and global functions should be migrated. V8 8.0 might have the optimization that we need to migrate prototype methods.

meta

Most helpful comment

@aduh95
from my understanding it made in order to avoid user mutation in core libraries
https://github.com/nodejs/node/blob/141a6e34eed05577edf43ad085a74f330d0559cb/lib/internal/per_context/primordials.js#L5-L7

All 2 comments

Is there somewhere I can find out about primordials and why/how it is _better_ than using global builtins? Maybe a recording of the meeting when this decision was taken? Is the primordials object documented somewhere?

@aduh95
from my understanding it made in order to avoid user mutation in core libraries
https://github.com/nodejs/node/blob/141a6e34eed05577edf43ad085a74f330d0559cb/lib/internal/per_context/primordials.js#L5-L7

Was this page helpful?
0 / 5 - 0 ratings

Related issues

filipesilvaa picture filipesilvaa  路  3Comments

Icemic picture Icemic  路  3Comments

mcollina picture mcollina  路  3Comments

danielstaleiny picture danielstaleiny  路  3Comments

addaleax picture addaleax  路  3Comments