forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vm: migrate ContextifyScript to cppgc
This patch migrates ContextifyScript to cppgc-based memory management using CppgcMixin. PR-URL: nodejs#52295 Refs: nodejs#40786 Refs: https://docs.google.com/document/d/1ny2Qz_EsUnXGKJRGxoA-FXIE2xpLgaMAN6jD7eAkqFQ/edit Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
- Loading branch information
1 parent
849db10
commit 3b0617d
Showing
5 changed files
with
60 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
require('../common'); | ||
const { findByRetainingPath } = require('../common/heap'); | ||
const source = 'const foo = 123'; | ||
const script = require('vm').createScript(source); | ||
|
||
findByRetainingPath('Node / ContextifyScript', [ | ||
{ node_name: '(shared function info)' }, // This is the UnboundScript referenced by ContextifyScript. | ||
{ edge_name: 'script' }, | ||
{ edge_name: 'source', node_type: 'string', node_name: source }, | ||
]); | ||
|
||
console.log(script); // Keep the script alive. |