Questions tagged [v8]
V8 is Google's open source JavaScript engine.
2,790
questions
0
votes
0
answers
5
views
NodeJS `isolated-vm`: How to reference a function inside the isolate
The following code:
const ivm = require('isolated-vm');
const isolate = new ivm.Isolate();
const context = isolate.createContextSync();
context.setSync('log', new ivm.Callback(x => console.log(x))...
0
votes
0
answers
15
views
Accessing authorization headers on koa give the following value `Bearer Internal jwt is muted due to the v8 output caching`
I am accessing the authorization header trough koa kontext
ctx.header.authorization
The value I am receiving is
Bearer Internal jwt is muted due to the v8 output caching
instead of
<Bearer> &...
0
votes
0
answers
20
views
Can asynchronous module definitions be used with abstract syntax trees on v8 engine to read third party dependencies? [duplicate]
I understand eval string-to-function is impossible to use on the browsers' application programming interfaces.
I have been exploring the require.js repositories, and they either use eval or AST
...
0
votes
1
answer
50
views
Can asynchronous module definitions be used with abstract syntax trees on v8 engine to read third party dependencies? This is for Cloudflare Workers
I understand eval string-to-function is impossible to use on the browsers' application programming interfaces, but there must be another strategy to use third party dependencies without node.js on v8 ...
0
votes
1
answer
36
views
Version mismatch between V8 binary and snapshot
I have an issue related to v8, now it is unrelated to your docker image but since I have seen you being active in the space I thought you may be able to help
My setup is the following:
Debian 11
php7....
-2
votes
1
answer
18
views
d8 Warning: unknown flag --print-ast
When I run d8 --help there is indeed no --print-ast.
How can I print AST?
0
votes
1
answer
30
views
Why does v8 report duplicate module strings in heap in my jest tests?
In the process of upgrading node (16.1.x => 16.5.0), I observed that I'm getting OOM issues from jest. In troubleshooting, I'm periodically taking heap snapshots. I'm regularly seeing entries in &...
0
votes
1
answer
48
views
gm.py x64.release Errorr---env: python: No such file or directory
macos monterey 12.3.1
python -V: python3
which python3: /usr/local/bin/python3
alias python="/usr/bin/python3"
path: /Users/Bill/Public/browser/depot_tools /usr/local/bin /usr/bin /bin /usr/...
0
votes
1
answer
38
views
storing a function that was retrieved from FunctionCallbackInfo
I'm pretty much trying to make a AddInputEvent but, after a month, can't find a way to turn a local "function from FunctionCallbackInfo"(i'll just call this argf) in to a Persistent Function ...
0
votes
1
answer
26
views
How to introspect elements kind in an array in V8
After reading this article: https://v8.dev/blog/elements-kinds. I was wondering if some of the arrays that are created in my code are packed or holey. Is there any way to check this at runtime in a ...
0
votes
1
answer
90
views
Unresolve external symbols when using v8.dll in my project
I'm new to making C++ project. I may be not sure prerequisite knowledge of C++ project.
[My environment]
Windows 10
Python 2.7.18
Developer Command Prompt for VS 2022
Visual Studio 2022 Community
I'...
0
votes
0
answers
17
views
V8 Memory Profiler - reporting heap size as 0 bytes (node <= v9)
I'm using using Chrome's "Allocation sampling" profiler.
With node >= v10, "Total JS heap size" hovers around 10 MB as expected.
With node <= v9, it just shows 0 B. No matter ...
0
votes
1
answer
45
views
failed to build native modules on after node 16 upgrade and MacOS upgrade
I’ve upgrade to MacOS Monterey (12.3.1) and Node 16. Since then I’m failed running installation on some node modules due to @newrelic/native-metrics with the following error:
Error running install ...
0
votes
1
answer
30
views
Cannot install mod_v8 in FreeSwitch
I get below error when I try to install mod_v8 with 'load mod_v8' command. As documentation says I checked to modules.conf for uncomment 'languages/mod_v8' line but that file is empty.Also I ...
0
votes
1
answer
21
views
Clearscript V8: how to tell if 32 or 64 bit V8 engine was used?
I have an issue where certain clients report bugs from code called from js.
One they I want to check is if this maybe is because of 32 vs 64 bit engine. How can I tell which was used? Is that ...
1
vote
1
answer
34
views
How to debug node process that exits unexpectedly with code 1, but no apparent error message, and unpredictably
I already have handlers for uncaughtException and unhandledRejection and I am thinking that this isn't a js error at all, as it happens at several different points in the code, and other times does ...
0
votes
1
answer
26
views
V8 embedding: null `this` from method inside class inheriting from one created using Function::New
I am trying to embed V8 with a custom class. It is made to be extended and used in JS.
When accessing this in a method other than the constructor, it is null. It should be able to persist data for ...
-2
votes
0
answers
62
views
Building v8 on Windows / VS 2022
I am currently trying to build v8 on Windows 10 in a VS 2022 Developer Command Prompt.
The last time I built v8 was about 2 years ago; there I used VS 2019 and did not experience major difficulties.
...
0
votes
1
answer
22
views
NodeJS 1614.2 v8.promiseHooks
I am trying to import promiseHooks from v8, but could not find at all.
Based on nodeJs API documentation it should be added in v16.14.0.
How can I import it?
$ node --version
v16.14.2
My code :
...
0
votes
1
answer
45
views
Does Google Apps Script (GAS) support proper tail calls or tail call optimization?
I'm wondering whether investing time into doing tail call optimization for a Google Apps Script is worth it.
So, I've understood that Google Apps Script uses the ES2015 (ES6) version of the JavaScript ...
-1
votes
1
answer
57
views
Why are most v8 javascript bytecodes 5 or 6 bytes long?
I have seen several examples of bytecodes printed out in VSCode. I would like to know why these codes are customarily 5 to 6 bytes long and prepended by 0x. And if possible, can you tell me where I ...
0
votes
2
answers
51
views
How do I inspect whether a object property is a in-object property, fast property, or slow property in v8?
The post https://v8.dev/blog/fast-properties mentions there are three kinds of properties. How do I find out which one a property is?
I am expecting answers with a v8 native syntax function or a ...
2
votes
2
answers
198
views
FILE_INFO_BY_HANDLE_CLASS not found when compile v8 on windows
I am compiling v8 on win10 pro 20H2 build.
I had already fetch the source code
and used gn gen --ide=vs out\x64_proj command under v8\src directory to generate visual studio projects.
there are some ...
0
votes
1
answer
30
views
How to create global object with static methods in v8 engine?
I want to have the same object as JSON in my embedded v8. So I can have several static methods and use it like this:
MyGlobalObject.methodOne();
MyGlobalObject.methodTwo();
I know how to use Function ...
0
votes
1
answer
36
views
What does the FeedbackSlot size(length) mean?
Some questions about Feedback:
as the title asked
A slot site that only encounters objects of a single hidden class is called monomorphic; if it encounters objects of two hidden classes, it is ...
0
votes
1
answer
36
views
How to convert a v8::Local<v8::Value> into a uint32_t
Given the following code how can I convert the v8::Local<v8::Value> into a uint32_t. Or other types based on the Is* method?
v8::Local<v8::Value> value;
v8::Local<v8::Context> ...
0
votes
1
answer
49
views
How to get actual invocation count of a optimized function in V8
Every function has a property invocation_count in FeedbackVector to record the number of times the function was called. But after a function is optimized, its invocation count will not be increased ...
0
votes
1
answer
103
views
Maximum call stack size exceeded for large iterators
I'm trying to convert an iterator to an array. The iterator is the result of calling matchAll on a very long string. The iterator (I assume) has many matches within the string. First I tried it with ...
2
votes
1
answer
82
views
What microtasks are enqueued with a Promise that resolves with a Promise in JavaScript?
I am trying to understand what microtask get enqueued when a Promise is resolved with another Promise.
For example, what microtasks are enqueued with the following code?
const p1 = Promise.resolve(&...
0
votes
1
answer
96
views
Compilation errors while compiling V8 engine on Windows 10 with MSVC
First of all, I run next command:
python tools/dev/v8gen.py x64.release.sample
All GN files generating successfuly. After that I run following command:
ninja -C out.gn/x64.release.sample v8_monolith
...
0
votes
1
answer
86
views
How to get the max old space size that node process have
I'm trying to find the max old space size the node process has.
First I tried using the heapTotal from process.memoryUsage() but:
This contains the entire heap and not the max old space size (see ...
0
votes
1
answer
92
views
Why is the efficiency worse when I use c++ addon to iterate an array in node.js
I'm a beginner at node.js c++ addon, and I'm trying to implement a c++ addon that does the same thing as Array.prototype.map function.
But after I finished this, I benchmarked my addon and found it's ...
0
votes
1
answer
233
views
Unable to compile V8 9.9 for Android with use_custom_libcxx = false
I'm trying to update our V8 integration for Android from 9.1 to 9.9 and I'm unable to build 9.9 with the default NDK standard library (use_custom_libcxx = false).
Using Ubuntu 20.04 LTS 64-bit, I'm ...
-1
votes
2
answers
56
views
Nodejs require module starts with '#'
From Nodejs docs https://nodejs.org/api/modules.html#all-together
require(X) from module at path Y
1. If X is a core module,
a. return the core module
b. STOP
2. If X begins with '/'
a. set Y ...
0
votes
1
answer
11
views
How to stop embedded code execution from imported host function in wee8?
Is there a way in wee8 (v8's wasm api) to stop the execution of an embedded guest function from within an imported host function?
Example:
auto hostFunc(const wasm::Val args[], wasm::Val results[]) -&...
0
votes
1
answer
81
views
How to create DOM elements in JS memory-efficiently?
Consider the following code that inserts 100,000 spans with the content '0' inside.
<body>
<script type="module">
const container = document.getElementById('root')
...
0
votes
1
answer
64
views
How to run in wee8 wasm code that was compiled from c++ with emcc? (WASI in wee8?)
I am trying to compile C++ code to wasm and then embed it in other C++ code with wee8 (v8's wasm-api). Currently I'm getting a Segfault on instantiating the module:
auto instance = wasm::Instance::...
0
votes
1
answer
37
views
What are the "bytes touched" in V8 Parse processor?
I recently started to play around with V8 parse processor, and found there was something called bytes touched along the graph. what does it mean?
And when i tried to apply the IIFE heuristics to eager ...
0
votes
0
answers
34
views
Is NativeScript slower for real-world Applications and does it supports multi-threading?
I know that a similar question exists but it does not gives answer to my question.
I'm a beginner to nativescript and don't know much about it.
While searching on Google about nativescript, I've found ...
0
votes
1
answer
112
views
Chrome Devtools Perfomance profiler dump json file parser
I'm trying to parse the results of the performance profiler tool, but I've googled everything and I cannot find anything. Where to dump profiler jsonfile Sample picture
The only documentation I've ...
0
votes
1
answer
125
views
Call JS functions in v8 from c++
What I want to do is call already compiled functions in JS/v8 from c++. I'm doing this for a game engine I'm writing that uses V8 as the scripting back-end.
This is kinda how a script would be ...
0
votes
1
answer
19
views
For what purpose is _pthread_cond_timedwait function used in v8?
In the profiling logs of chrome (--prof) option with a webpage, a majority of ticks is consumed by _pthread_cond_timedwait function in C++.
What purpose is this used for? Is it used by the profiling ...
-1
votes
1
answer
35
views
What is the internal data-types in V8 Compiler
While using the heap-stats tool for V8, I found that the memory is represented by some internal terms (possibly the V8 representations) under the JS sections.
Where can i find the descriptions of what ...
2
votes
1
answer
84
views
Would calling Performance API frequently be causing a performance issue?
I want to measure the memory usage of my web SPA using performance.memory, and the purpose is to detect if there is any problem i.e. memory leak during the webapp's lifetime.
For this reason I would ...
0
votes
1
answer
29
views
What do these turbofan memory zones mean?
I was playing around with the V8 engine and stumbled upon the zone stats tool. I understand the zone memory concept, but what are these different zones in zone stats memory?
When I upload a trace zone ...
0
votes
1
answer
86
views
Calling function from v8 engine throws error
I am making an application that requires me to call a function within some Javascript code. The problem is, despite looking it up many times, I still get the same error.
No matching function for call ...
0
votes
1
answer
82
views
Can't get V8 Monolith to genorate
I've been trying to use -v8_monolith in my make files but so far it's not working.
I gotten v8 code from google's depot-tools, then followed every tutorial on the web to try to compile the shared libs ...
0
votes
1
answer
41
views
v8 - how to debug Map.prototype.set and OrderedHashTable?
I'm learning more about v8 internals as a hobby project. For this example, I'm trying to debug and understand how Javascript Map.prototype.set actually works under-the-hood.
I'm using v8 tag 9.9.99.
I ...
3
votes
0
answers
348
views
Get zero coverage with nyc and playwright
I'm struggling to set up coverage correctly using Playwright. It reports 0 coverage in all files (except the test files themselves, if I include them).
I'm getting inspiration from https://playwright....
0
votes
2
answers
52
views
"rusty_v8" build error on 32-bit platforms
I am new at Rust and Chromium V8 Engine.
I tried to build Deno from source on Raspberry Pi OS(32bit arm), but an error has occurred at rusty_v8 build. And same result on Intel 32bit.
../../../../....