Questions tagged [embedded-v8]

253 questions
0
votes
1 answer

Debugging js bytecode with V8 engine

I'm using the v8 library to run js code in my project. And I want to implement controlled execution of the compiled js code. I would like to be able to control the execution of bytecode step by step. From one instruction to another. Is it possible…
0
votes
1 answer

Executing bytecode without source in v8 engine

I try to use this source https://github.com/JoseExposito/v8-compiler/blob/master/addon/v8-compiler.cpp in my project. But a function compilation_cache() called from runScript always returns NULL. What can be wrong? What I need to fix in the source…
0
votes
1 answer

how to use v8 shared library in linux

I am working on a project that uses v8 engine. I have followed the instructions on v8 git page to compile it and generated some .so files. But now after that there are no more directions as how to proceed with those library files. I wanted to try…
0
votes
1 answer

V8 compile samples/hello-world.cc on Ubuntu

Trying to compile V8 samples/hello-world.cc on ubuntu #include #include #include #include "include/libplatform/libplatform.h" #include "include/v8.h" int main(int argc, char* argv[]) { // Initialize V8. …
0
votes
1 answer

How to Integrate Custom C++ Module into Custom Version of NodeJS?

I wish to create an executable that uses NodeJS to run a specific JavaScript file. However, this NodeJS should have additional "modules" added that expose C++ classes/functions to the JavaScript scope using require. So far, I have successfully…
Griffort
  • 1,174
  • 1
  • 10
  • 26
0
votes
1 answer

How to stringify an Integer in V8?

I'm trying to stringify an integer in v8. The nearest I've come to success so far is using String::Concat. I tried writing this method (in a node.js 9.11.1 native addon), but it doesn't compile. void Method(const FunctionCallbackInfo &args)…
Wyck
  • 10,311
  • 6
  • 39
  • 60
0
votes
1 answer

What does it mean that v8 compiles js code to native machine code?

How does v8 load and execute the native machine code it generates?
user6872780
0
votes
0 answers

Cannot compile v8 sample code on ubuntu 16.04

I'm trying to run the hello world sample code from the official v8 repo. After reading the docs I could make it work on version 5.8 just as it is described in the wiki. However, I'm interested to explore this using the latest version of v8, but when…
xjmdoo
  • 1,658
  • 9
  • 15
0
votes
1 answer

Does V8 have function signatures like Local Get(Local)?

I am learning Node C++ Addon and found that the following code can be run on Node v8.9.3 void test(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); Local obj = Local::Cast(args[0]); …
KKKKy
  • 1
  • 2
0
votes
1 answer

Strange behavior from V8's usage of v8::EmbedderHeapTracer

I'm having a bit of a hard time with using the v8::EmbedderHeapTracer API with V8 version 6.3. My issue is the following sequence of events happening in the following order: V8 will call TracePrologue. V8 will register a V8 reference for embedder…
0
votes
1 answer

Is it possible to skip an object from collecting by v8 GC?

I have a lot of a long live objects in memory(~10GB) and I definitely know that these objects never be collected by GC. The problem is that a mark-sweep gc action take a long time(90sec) to check all objects in memory and its relations. I need some…
cevek
  • 862
  • 1
  • 7
  • 16
0
votes
1 answer

receive "Uncaught ReferenceError: require is not defined" when use "require" keyword in google v8

I am new google to google v8. I modified v8 hello world app. const char* testJS = R"( var assert = require("assert"); 1 + 2; )"; v8::Local script = v8::Script::Compile(context,…
0
votes
1 answer

Ruby mini_racer: self is not defined

I'm trying to run axlsign.js from ruby using mini_racer gem. context = MiniRacer::Context.new context.load('axlsign.js') context.eval('axlsign.generateKeyPair(new Uint8Array(32))') It returns error JavaScript at :1436:4: ReferenceError:…
Ilya Cherevkov
  • 1,743
  • 2
  • 17
  • 47
0
votes
1 answer

CreateSnapshotDataBlob failed

I was trying to use snapshot utility in V8 to speed up my application startup performence. As it is pointed out in the V8 blog, using snapshot makes it possible to skip over the startup time incurred by some initialization. StartupData…
0
votes
1 answer

v8 C++ Api: pass non-English strings from JavaScript to c++

In my c++ code I have: Handle globalTemplate = ObjectTemplate::New(); globalTemplate->Set( String::New("print"), FunctionTemplate::New( printMessage )); Handle context = Context::New( NULL, globalTemplate ); The…
Khachatur
  • 921
  • 1
  • 12
  • 30