Questions tagged [v8]
V8 is Google's open source JavaScript engine.
3,044
questions
-1
votes
0
answers
32
views
Javascript Execution Context Internal Implementation [closed]
How is the javascript Execution Context actually implemented?
How is the lifecycle of execution context managed?
What are all the things that an execution context cannot do?
Or can it handle ...
-4
votes
0
answers
40
views
Representation of decoded JavaScript (JS) objects in Go [closed]
I wrote js binary v8 deserializer, and now I don’t know how to represent js types more correctly. Right now for example js object in my code represent as map[any]any. The key is any because they can ...
1
vote
1
answer
97
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
38
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
19
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
35
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
81
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
52
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
71
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
148
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
63
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 ...