diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2024-01-11 07:37:25 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-10 15:37:25 -0700 |
commit | 515a34b4de222e35c7ade1b92614d746e73d4c2e (patch) | |
tree | 8284201fc826a33f12597959a8a8be14e0f524bd /ext/node/polyfills/v8.ts | |
parent | d4893eb51a01c5a692d8ca74a3b8ff95c5fd1d9f (diff) |
refactor: use `core.ensureFastOps()` (#21888)
Diffstat (limited to 'ext/node/polyfills/v8.ts')
-rw-r--r-- | ext/node/polyfills/v8.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/node/polyfills/v8.ts b/ext/node/polyfills/v8.ts index 251cead62..4c01bc9ad 100644 --- a/ext/node/polyfills/v8.ts +++ b/ext/node/polyfills/v8.ts @@ -4,12 +4,16 @@ // TODO(petamoriken): enable prefer-primordials for node polyfills // deno-lint-ignore-file prefer-primordials -import { notImplemented } from "ext:deno_node/_utils.ts"; +import { core } from "ext:core/mod.js"; +const { + op_v8_cached_data_version_tag, + op_v8_get_heap_statistics, +} = core.ensureFastOps(); -const { ops } = globalThis.__bootstrap.core; +import { notImplemented } from "ext:deno_node/_utils.ts"; export function cachedDataVersionTag() { - return ops.op_v8_cached_data_version_tag(); + return op_v8_cached_data_version_tag(); } export function getHeapCodeStatistics() { notImplemented("v8.getHeapCodeStatistics"); @@ -24,7 +28,7 @@ export function getHeapSpaceStatistics() { const buffer = new Float64Array(14); export function getHeapStatistics() { - ops.op_v8_get_heap_statistics(buffer); + op_v8_get_heap_statistics(buffer); return { total_heap_size: buffer[0], |