Questions tagged [v8]
V8 is Google's open source JavaScript engine.
3,043
questions
1
vote
1
answer
73
views
JS string concatenation optimization
Recently I've been implementing a simple logger for JS library, the example looks like this:
class Logger {
static level: 'error' | 'info' = 'error';
static error(message: string) {
if (this....
-1
votes
0
answers
31
views
Chrome: performance memory property vs memory snapshot vs task manager memory
performance.memory
snapshot
Performance.memory shows that the currently used jsHeapSize is 259MB, but the memory snapshot shows only 120MB. What is the difference between them?
By the way, should the ...
0
votes
0
answers
18
views
Object data reassignment gets reflected prior to the reassignment itself while destucturing array [duplicate]
const test = [3, { a: "hello", b: 33 }];
const [x, obj1] = test;
console.log(test); // [3, { a: 33, b: 33 }]
obj1.a = 33;
console.log(test); // [3, { a: 33, b: 33 }]
I am ...
1
vote
0
answers
28
views
Is there a Chrome Devtools Protocol API to list off all Runtime.ScriptIds?
I'm trying to write a script that will dump all instances of a specific function signature in node.js's internal modules. Specifically, I'm trying to dump the locations of the internalBinding function ...
0
votes
0
answers
33
views
Print v8 internal stack trace when calling a javascript function from v8-debug shell
Is there any way to see the internal stack trace in V8 engine?
For example, I have the following in v8-debug shell:
"test".toLocaleUpperCase()
I would like to see the internal stack trace ...
1
vote
2
answers
69
views
OptimizeFunctionOnNextCall() and PrepareFunctionForOptimization() + OptimizeFunctionOnNextCall()
What is the difference between using '%OptimizeFunctionOnNextCall()' alone and using '%OptimizeFunctionOnNextCall()' accompanied with '%PrepareFunctionForOptimization()'?
function test() {
// some ...
-1
votes
1
answer
46
views
Control optimization in V8's TurboFan
I'm studying some internals of V8's TurboFan and came across this slide:
Original slide.
This diagram shows a branch that is removed during control optimization, resulting in a direct connection to a &...
-1
votes
2
answers
61
views
JavaScript heap out of memory - NextJS [closed]
I was running my NextJs project and during development, it broke for an unknown reason and logged this error message:
<--- Last few GCs --->
[8728:000001A567CE5290] 8719226 ms: Mark-sweep (...
-2
votes
1
answer
41
views
Why Does Stack Size Vary By Function (V8 Engine)?
I was just experimenting to see the max call stack size on my machine, and I discovered something very peculiar. I had the following two functions:
function fact(o) {
if (o == 0) return 1;
...
0
votes
0
answers
31
views
Building v8 and adding it to C++ projects
I followed this websites guide, together with a few old stackoverflow posts:
https://v8.dev/docs/source-code
Howerver, after the long compiling process, it seems like I am missing a lot of important ....
0
votes
0
answers
28
views
Branch code coverage is not 100% for code with async/await
When writing tests in my project, I came across the fact that the code coverage in the branch column is not 100%. Using NODE_V8_COVERAGE=v8_coverage I found a place that is not covered by the test, ...
-1
votes
3
answers
143
views
Javascript Set creation performance [closed]
For large arrays (i.e. 1M elements), is it faster to create and iterate over a Set (from an Array) than an Array - if you just need a single or two iterations to occur ever and performance is the only ...
1
vote
2
answers
61
views
Issue in converting v8::Local<v8::Data> to v8::Local<v8::Value>
I have a v8 method which returns type v8::Local<v8::Data>. I want to convert this to type v8::Local<v8::Value>. Value is a child class of Data (ref).
I tried using Data class methods like ...
0
votes
0
answers
90
views
How to properly build Google V8 as a static library on a Mac OS in 2024?
I have been trying to follow the instructions to build V8 as described on the official web site with the intent of embedding it on my application but I keep getting a linker error.
I followed the ...
0
votes
0
answers
51
views
Undefined symbols for architecture x86_64: Need help in understanding the error
I got this error while compiling a custom javascript runtime project ( i updated some source c++ code and v8 version)
Undefined symbols for architecture x86_64:
"boost::system::detail::...