<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/node-new.git/src/node_contextify.cc, branch main</title>
<subtitle>github.com: nodejs/node.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/node-new.git/'/>
<entry>
<title>vm: fix crash when setting __proto__ on context's globalThis</title>
<updated>2023-05-15T09:24:15+00:00</updated>
<author>
<name>Feng Yu</name>
<email>F3n67u@outlook.com</email>
</author>
<published>2023-05-15T09:24:15+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/node-new.git/commit/?id=6bbf2a57fcf33266c5859497f8cc32e1389a358a'/>
<id>6bbf2a57fcf33266c5859497f8cc32e1389a358a</id>
<content type='text'>
PR-URL: https://github.com/nodejs/node/pull/47939
Reviewed-By: Zeyu "Alex" Yang &lt;himself65@outlook.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Darshan Sen &lt;raisinten@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/nodejs/node/pull/47939
Reviewed-By: Zeyu "Alex" Yang &lt;himself65@outlook.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Darshan Sen &lt;raisinten@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bootstrap: initialize per-isolate properties of bindings separately</title>
<updated>2023-05-03T13:15:10+00:00</updated>
<author>
<name>Joyee Cheung</name>
<email>joyeec9h3@gmail.com</email>
</author>
<published>2023-04-28T16:30:47+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/node-new.git/commit/?id=5466bec2c5d0366635c9bc4a89221bde27a7d44d'/>
<id>5466bec2c5d0366635c9bc4a89221bde27a7d44d</id>
<content type='text'>
This patch moves the initialization of per-isolate properties of
the bindings that are in the embedded snapshot separate from the
initialization of their per-context properties. This is necessary
for workers to share the isolate snapshot with the main thread
and deserialize these properties instead of creating them from
scratch.

PR-URL: https://github.com/nodejs/node/pull/47768
Reviewed-By: Yagiz Nizipli &lt;yagiz@nizipli.com&gt;
Reviewed-By: Chengzhong Wu &lt;legendecas@gmail.com&gt;
Reviewed-By: Minwoo Jung &lt;nodecorelab@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch moves the initialization of per-isolate properties of
the bindings that are in the embedded snapshot separate from the
initialization of their per-context properties. This is necessary
for workers to share the isolate snapshot with the main thread
and deserialize these properties instead of creating them from
scratch.

PR-URL: https://github.com/nodejs/node/pull/47768
Reviewed-By: Yagiz Nizipli &lt;yagiz@nizipli.com&gt;
Reviewed-By: Chengzhong Wu &lt;legendecas@gmail.com&gt;
Reviewed-By: Minwoo Jung &lt;nodecorelab@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vm: properly handle defining props on any value</title>
<updated>2023-03-18T09:19:19+00:00</updated>
<author>
<name>Nicolas DUBIEN</name>
<email>github@dubien.org</email>
</author>
<published>2023-03-18T09:19:19+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/node-new.git/commit/?id=aa6e9c80cf3f156bb38903936c5bf72c1cb0f9dc'/>
<id>aa6e9c80cf3f156bb38903936c5bf72c1cb0f9dc</id>
<content type='text'>
While it was supposed to fix most of the remaining issues,
https://github.com/nodejs/node/pull/46458 missed some in strict mode.

This PR adds some additional checks. It also clarifies what we are
really checking to execute or not the `GetReturnValue`.

PR-URL: https://github.com/nodejs/node/pull/46615
Reviewed-By: Vladimir de Turckheim &lt;vlad2t@hotmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While it was supposed to fix most of the remaining issues,
https://github.com/nodejs/node/pull/46458 missed some in strict mode.

This PR adds some additional checks. It also clarifies what we are
really checking to execute or not the `GetReturnValue`.

PR-URL: https://github.com/nodejs/node/pull/46615
Reviewed-By: Vladimir de Turckheim &lt;vlad2t@hotmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "vm: fix leak in vm.compileFunction when importModuleDynamically is used"</title>
<updated>2023-03-15T14:35:06+00:00</updated>
<author>
<name>Michaël Zasso</name>
<email>targos@protonmail.com</email>
</author>
<published>2023-03-15T14:35:06+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/node-new.git/commit/?id=d0153aee367422d0858105abec186da4dff0a0c5'/>
<id>d0153aee367422d0858105abec186da4dff0a0c5</id>
<content type='text'>
This reverts commit 986498b7b329f454507b3a47e9f20cbcdb029dc2.

Fixes: https://github.com/nodejs/node/issues/47096
PR-URL: https://github.com/nodejs/node/pull/47101
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Chengzhong Wu &lt;legendecas@gmail.com&gt;
Reviewed-By: Joyee Cheung &lt;joyeec9h3@gmail.com&gt;
Reviewed-By: Danielle Adams &lt;adamzdanielle@gmail.com&gt;
Reviewed-By: Richard Lau &lt;rlau@redhat.com&gt;
Reviewed-By: Debadree Chatterjee &lt;debadree333@gmail.com&gt;
Reviewed-By: Rafael Gonzaga &lt;rafael.nunu@hotmail.com&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: Darshan Sen &lt;raisinten@gmail.com&gt;
Reviewed-By: Tobias Nießen &lt;tniessen@tnie.de&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 986498b7b329f454507b3a47e9f20cbcdb029dc2.

Fixes: https://github.com/nodejs/node/issues/47096
PR-URL: https://github.com/nodejs/node/pull/47101
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Chengzhong Wu &lt;legendecas@gmail.com&gt;
Reviewed-By: Joyee Cheung &lt;joyeec9h3@gmail.com&gt;
Reviewed-By: Danielle Adams &lt;adamzdanielle@gmail.com&gt;
Reviewed-By: Richard Lau &lt;rlau@redhat.com&gt;
Reviewed-By: Debadree Chatterjee &lt;debadree333@gmail.com&gt;
Reviewed-By: Rafael Gonzaga &lt;rafael.nunu@hotmail.com&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: Darshan Sen &lt;raisinten@gmail.com&gt;
Reviewed-By: Tobias Nießen &lt;tniessen@tnie.de&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>vm: fix leak in vm.compileFunction when importModuleDynamically is used</title>
<updated>2023-03-01T08:18:53+00:00</updated>
<author>
<name>Joyee Cheung</name>
<email>joyeec9h3@gmail.com</email>
</author>
<published>2023-02-22T19:30:59+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/node-new.git/commit/?id=986498b7b329f454507b3a47e9f20cbcdb029dc2'/>
<id>986498b7b329f454507b3a47e9f20cbcdb029dc2</id>
<content type='text'>
Previously in the implementation there was a cycle that V8 could not
detect:

Strong global reference to CompiledFnEntry (JS wrapper)
    -&gt; strong reference to callback setting (through the
       callbackMap key-value pair)
    -&gt; importModuleDynamically (wrapper in internalCompileFunction())
    -&gt; Strong reference to the compiled function (through closure in
       internalCompileFunction())

The CompiledFnEntry only gets GC'ed when the compiled function is GC'ed.
Since the compiled function is always reachable as described above,
there is a leak.

We only needed the first strong global reference because we didn't want
the function to outlive the CompiledFnEntry. In this case it can be
solved by using a private symbol instead of going with the global
reference + destruction in the weak callback, which V8's GC is not
going to understand.

PR-URL: https://github.com/nodejs/node/pull/46785
Fixes: https://github.com/nodejs/node/issues/42080
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Chengzhong Wu &lt;legendecas@gmail.com&gt;
Reviewed-By: Benjamin Gruenbaum &lt;benjamingr@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously in the implementation there was a cycle that V8 could not
detect:

Strong global reference to CompiledFnEntry (JS wrapper)
    -&gt; strong reference to callback setting (through the
       callbackMap key-value pair)
    -&gt; importModuleDynamically (wrapper in internalCompileFunction())
    -&gt; Strong reference to the compiled function (through closure in
       internalCompileFunction())

The CompiledFnEntry only gets GC'ed when the compiled function is GC'ed.
Since the compiled function is always reachable as described above,
there is a leak.

We only needed the first strong global reference because we didn't want
the function to outlive the CompiledFnEntry. In this case it can be
solved by using a private symbol instead of going with the global
reference + destruction in the weak callback, which V8's GC is not
going to understand.

PR-URL: https://github.com/nodejs/node/pull/46785
Fixes: https://github.com/nodejs/node/issues/42080
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Chengzhong Wu &lt;legendecas@gmail.com&gt;
Reviewed-By: Benjamin Gruenbaum &lt;benjamingr@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib,src: fix a few typos in comments</title>
<updated>2023-02-25T20:29:59+00:00</updated>
<author>
<name>Tobias Nießen</name>
<email>tniessen@tnie.de</email>
</author>
<published>2023-02-25T20:29:59+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/node-new.git/commit/?id=0f10c879574e9b9a3868c8233d3612465405b521'/>
<id>0f10c879574e9b9a3868c8233d3612465405b521</id>
<content type='text'>
PR-URL: https://github.com/nodejs/node/pull/46835
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Moshe Atlow &lt;moshe@atlow.co.il&gt;
Reviewed-By: Marco Ippolito &lt;marcoippolito54@gmail.com&gt;
Reviewed-By: Richard Lau &lt;rlau@redhat.com&gt;
Reviewed-By: Mohammed Keyvanzadeh &lt;mohammadkeyvanzade94@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/nodejs/node/pull/46835
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Moshe Atlow &lt;moshe@atlow.co.il&gt;
Reviewed-By: Marco Ippolito &lt;marcoippolito54@gmail.com&gt;
Reviewed-By: Richard Lau &lt;rlau@redhat.com&gt;
Reviewed-By: Mohammed Keyvanzadeh &lt;mohammadkeyvanzade94@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>vm: properly support symbols on globals</title>
<updated>2023-02-04T10:32:31+00:00</updated>
<author>
<name>Nicolas DUBIEN</name>
<email>github@dubien.org</email>
</author>
<published>2023-02-04T10:32:31+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/node-new.git/commit/?id=6bbc2fbd67e5e64f375e101152921ee952943800'/>
<id>6bbc2fbd67e5e64f375e101152921ee952943800</id>
<content type='text'>
A regression has been introduced in node 18.2.0,
it makes the following snippet fails while it used to work in the past:

```
const assert = require('assert');
const vm = require('vm');
const global = vm.runInContext('this', vm.createContext());
const totoSymbol = Symbol.for('toto');
Object.defineProperty(global, totoSymbol, {
  enumerable: true,
  writable: true,
  value: 4,
  configurable: true,
});
assert(Object.getOwnPropertySymbols(global).includes(totoSymbol));
```

Regression introduced by: https://github.com/nodejs/node/pull/42963.
So I basically attempted to start understanding what it changed to make
it fix the initial issue while not breaking the symbol related one.

Fixes: https://github.com/nodejs/node/issues/45983
PR-URL: https://github.com/nodejs/node/pull/46458
Reviewed-By: Antoine du Hamel &lt;duhamelantoine1995@gmail.com&gt;
Reviewed-By: Michaël Zasso &lt;targos@protonmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A regression has been introduced in node 18.2.0,
it makes the following snippet fails while it used to work in the past:

```
const assert = require('assert');
const vm = require('vm');
const global = vm.runInContext('this', vm.createContext());
const totoSymbol = Symbol.for('toto');
Object.defineProperty(global, totoSymbol, {
  enumerable: true,
  writable: true,
  value: 4,
  configurable: true,
});
assert(Object.getOwnPropertySymbols(global).includes(totoSymbol));
```

Regression introduced by: https://github.com/nodejs/node/pull/42963.
So I basically attempted to start understanding what it changed to make
it fix the initial issue while not breaking the symbol related one.

Fixes: https://github.com/nodejs/node/issues/45983
PR-URL: https://github.com/nodejs/node/pull/46458
Reviewed-By: Antoine du Hamel &lt;duhamelantoine1995@gmail.com&gt;
Reviewed-By: Michaël Zasso &lt;targos@protonmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>src: add snapshot support for embedder API</title>
<updated>2023-02-03T20:48:22+00:00</updated>
<author>
<name>Anna Henningsen</name>
<email>anna.henningsen@mongodb.com</email>
</author>
<published>2022-12-12T17:18:37+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/node-new.git/commit/?id=06bb6b42b3e76dc14898a093e02381712b5f52c1'/>
<id>06bb6b42b3e76dc14898a093e02381712b5f52c1</id>
<content type='text'>
Add experimental support for loading snapshots in the embedder API
by adding a public opaque wrapper for our `SnapshotData` struct and
allowing embedders to pass it to the relevant setup functions.
Where applicable, use these helpers to deduplicate existing code
in Node.js’s startup path.

This has shown a 40 % startup performance increase for a real-world
application, even with the somewhat limited current support for
built-in modules.

The documentation includes a note about no guarantees for API or
ABI stability for this feature while it is experimental.

PR-URL: https://github.com/nodejs/node/pull/45888
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Joyee Cheung &lt;joyeec9h3@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add experimental support for loading snapshots in the embedder API
by adding a public opaque wrapper for our `SnapshotData` struct and
allowing embedders to pass it to the relevant setup functions.
Where applicable, use these helpers to deduplicate existing code
in Node.js’s startup path.

This has shown a 40 % startup performance increase for a real-world
application, even with the somewhat limited current support for
built-in modules.

The documentation includes a note about no guarantees for API or
ABI stability for this feature while it is experimental.

PR-URL: https://github.com/nodejs/node/pull/45888
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Joyee Cheung &lt;joyeec9h3@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vm: expose cachedDataRejected for vm.compileFunction</title>
<updated>2023-01-25T20:06:55+00:00</updated>
<author>
<name>Anna Henningsen</name>
<email>anna.henningsen@mongodb.com</email>
</author>
<published>2023-01-25T20:06:55+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/node-new.git/commit/?id=f4706251981fb6321a0a760d12523791a26b5867'/>
<id>f4706251981fb6321a0a760d12523791a26b5867</id>
<content type='text'>
Having this information available is useful for functions just as
it is for scripts. Therefore, expose it in the same way that other
information related to code caching is reported.

As part of this, de-duplify the code for setting the properties on
the C++ side and add proper exception handling to it.

PR-URL: https://github.com/nodejs/node/pull/46320
Reviewed-By: Gus Caplan &lt;me@gus.host&gt;
Reviewed-By: Chengzhong Wu &lt;legendecas@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Having this information available is useful for functions just as
it is for scripts. Therefore, expose it in the same way that other
information related to code caching is reported.

As part of this, de-duplify the code for setting the properties on
the C++ side and add proper exception handling to it.

PR-URL: https://github.com/nodejs/node/pull/46320
Reviewed-By: Gus Caplan &lt;me@gus.host&gt;
Reviewed-By: Chengzhong Wu &lt;legendecas@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>src: rename internal module declaration as internal bindings</title>
<updated>2022-11-28T16:23:08+00:00</updated>
<author>
<name>legendecas</name>
<email>legendecas@gmail.com</email>
</author>
<published>2022-11-20T17:37:56+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/node-new.git/commit/?id=71ff89f9299d1d10a4c424da23d827e5458dadff'/>
<id>71ff89f9299d1d10a4c424da23d827e5458dadff</id>
<content type='text'>
This is a continuation of the name reification on the internal bindings.

Renames NODE_MODULE_CONTEXT_AWARE_INTERNAL and
NODE_MODULE_EXTERNAL_REFERENCE to NODE_BINDING_CONTEXT_AWARE_INTERNAL
and NODE_BINDING_EXTERNAL_REFERENCE respectively.

PR-URL: https://github.com/nodejs/node/pull/45551
Refs: https://github.com/nodejs/node/issues/44036
Reviewed-By: Joyee Cheung &lt;joyeec9h3@gmail.com&gt;
Reviewed-By: Rafael Gonzaga &lt;rafael.nunu@hotmail.com&gt;
Reviewed-By: Daeyeon Jeong &lt;daeyeon.dev@gmail.com&gt;
Reviewed-By: Jacob Smith &lt;jacob@frende.me&gt;
Reviewed-By: Yagiz Nizipli &lt;yagiz@nizipli.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a continuation of the name reification on the internal bindings.

Renames NODE_MODULE_CONTEXT_AWARE_INTERNAL and
NODE_MODULE_EXTERNAL_REFERENCE to NODE_BINDING_CONTEXT_AWARE_INTERNAL
and NODE_BINDING_EXTERNAL_REFERENCE respectively.

PR-URL: https://github.com/nodejs/node/pull/45551
Refs: https://github.com/nodejs/node/issues/44036
Reviewed-By: Joyee Cheung &lt;joyeec9h3@gmail.com&gt;
Reviewed-By: Rafael Gonzaga &lt;rafael.nunu@hotmail.com&gt;
Reviewed-By: Daeyeon Jeong &lt;daeyeon.dev@gmail.com&gt;
Reviewed-By: Jacob Smith &lt;jacob@frende.me&gt;
Reviewed-By: Yagiz Nizipli &lt;yagiz@nizipli.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
