Questions tagged [embedded-v8]

253 questions
0
votes
1 answer

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 that instance of the class. Am I missing…
giilbert
  • 41
  • 1
  • 5
0
votes
1 answer

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 template for the global function but I can not…
John Tracid
  • 3,836
  • 3
  • 22
  • 33
0
votes
1 answer

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 formatted for my engine: function init(){ //this gets…
0
votes
1 answer

Add identifiers to TDZ using C++ v8 add-on

I have a unique Javascript evaluation environment that sits on top of Node. I need to insert an identifier into the current scope's temporal dead zone (TDZ) so that if that identifier is accessed it throws an uninitialized error. These identifiers…
Me1000
  • 1,760
  • 1
  • 12
  • 14
0
votes
1 answer

V8 Embedding. Cannot print out the `v8::Local` object

In Short I was trying to print out the v8::Local object content, with either of v8/tools/gdbinit and v8/tools/lldb_commands.py helper scripts, I got Empty Line OR Syntax Error messages. Is there anything I've missed? So my question is how can we…
absuu
  • 340
  • 1
  • 11
0
votes
2 answers

V8 Memory leak when using optional chaining in script

I've embedded V8 9.5 into my app (C++ HTTP server). When I started to use optional chaining in my JS scripts I've noticed abnormal rise in memory consumption under heavy load (CPU) leading to OOM. While there's some free CPU, memory usage is…
Islam Boziev
  • 167
  • 1
  • 8
0
votes
1 answer

V8 Embedded, Segmentation Fault after more run iteration

I am trying to use v8 in C++, I want to compile the js code in main thread and then I pass the compiled_script to the executor(child Thread). the Run execution process will run in threads. Story: compile process is expensive and I need performance,…
Mohsen
  • 59
  • 1
  • 8
0
votes
0 answers

how to resolve c++ v8pp unresolved external symbol

I try to execute v8 runtime environment from within c++ application to achive js support for my application. I successfully compile v8pp and now try to use the lib in my own console application. Currently I get a lot of unresolved symbol messages…
Stephan Ahlf
  • 3,310
  • 5
  • 39
  • 68
0
votes
1 answer

Is it possible to include the ICU data into a self-contained binary in v8?

Is it possible to incude the icudtl.dat file into the resulting binary when embedding v8? The documentation hints at this beeing possible with sentences such as "If V8 was compiled with the ICU data in an external file...", but I cannot find any…
0
votes
1 answer

Embeding V8 engine in a Hello_World console application on Linux - GCC 7 linker errors (undefined references)

Here are some details: Host/Test OS, Toolchain: Linux Mint 19.3 Tricia (Ubuntu 18.04), GCC 7 V8 GN build arguments: is_debug=true target_os="linux" target_cpu="x64" is_clang = false is_component_build=false use_glib=false use_custom_libcxx…
Hongkun Wang
  • 717
  • 8
  • 22
0
votes
1 answer

Build a small V8 shared lib on linux?

I tried building V8 following instruction from Hellow world V8 However the lib libv8_monolith.a generted is of 28 MB size. I see framework like Deno which do use V8 underneath is of roughly around only 12 MB. So how do I build a V8 shared lib of…
Anurag Vohra
  • 1,781
  • 12
  • 28
0
votes
0 answers

How can I change the following static linked program into dynamic linked program?

I have already figure out how to staticly link v8 with my own GLIBC/STDC++. $(GCC_ROOT)/bin/g++ samples/bench.cpp -o bench -isystem$(GLIBC_ROOT)/include/ -I. -Iinclude -isystem$(GLIBC) -nodefaultlibs -DV8_COMPRESS_POINTERS -static…
calvin
  • 2,125
  • 2
  • 21
  • 38
0
votes
2 answers

Does Google's V8 require C++14 standard?

I am currently trying to build Google's V8 engine, following its official documents. And I get some errors here: Need a newer glibc python ../../tools/run.py ./bytecode_builtins_list_generator…
calvin
  • 2,125
  • 2
  • 21
  • 38
0
votes
1 answer

How can I retrieve heap memory for string objects and allocated string values in V8/Node app?

I come from web dev, and my understanding of embedding V8 in C++ is limited (null). So I'm coming here, hoping for some assistance. My task is to peak into V8's heap as my Node appis executing insecure user code using Node's VM api. Currently I am…
pairwiseseq
  • 313
  • 2
  • 13
0
votes
1 answer

Get the BytecodeArray of a Local on Nodejs c++ land

I'm struggling a bit with the code base of nodejs + v8. The Goal is to get the bytecode of a function / module (looking at the code they are the same) and disassemble it using the BytecodeArray::Disassemble function, possibly, without side effects,…
Cristian
  • 127
  • 1
  • 6