Questions tagged [embedded-v8]

229 questions
46
votes
2 answers

What exactly is the difference between v8::Isolate and v8::Context?

What is the difference/connection between these objects in V8? Does a context "belong" to an Isolate or vice versa? I know that a single Isolate may only be accessed by one thread at a time (and that's what v8::Locker is for I guess?). I've looked…
DeX3
  • 4,387
  • 4
  • 39
  • 63
36
votes
3 answers

Calling a v8 javascript function from c++ with an argument

I am working with c++ and v8, and have run into the following challenge: I want to be able to define a function in javascript using v8, then call the function later on through c++. Additionally, I want to be able to pass an argument to the…
user396404
  • 2,589
  • 7
  • 27
  • 41
30
votes
3 answers

How to embed V8 in a Java application?

I'm looking for a solution for embedding the Google JavaScript engine V8 in my Java application. Have you got some solutions?
Stephan
  • 37,597
  • 55
  • 216
  • 310
26
votes
1 answer

What is an internal field count and what is SetInternalFieldCount used for?

I'm having trouble understanding what the SetInternalFieldCount() function actually does. In the v8 documentation the function is described as setting "the number of internal fields for objects generated from this template." Which is pretty self…
Loourr
  • 4,647
  • 7
  • 38
  • 65
20
votes
4 answers

Fastest possible Javascript object serialization with Google V8

I need to serialize moderately complex objects with 1-100's of mixed type properties. JSON was used originally, then I switched to BSON which is marginally faster. Encoding 10000 sample objects JSON: 1807mS BSON: 1687mS MessagePack:…
user172783
15
votes
1 answer

How to expose "native functions" to Javascript in a web page using Chromium and Delphi 6?

I have successfully embedded Chromium into my Delphi 6 projects with the help of Delphi Chromium Embedded. Now I want to be able to execute Javascript code and the have results returned to my host Delphi app. My current method is to call…
Robert Oschler
  • 13,520
  • 17
  • 74
  • 209
12
votes
1 answer

v8::Persistent MarkIndependent, what does this method exactly do?

Following is v8 code comment, I don't quite understand explaination. /** * Marks the reference to this object independent. Garbage collector * is free to ignore any object groups containing this object. * Weak callback for an independent handle…
Kevin
  • 302
  • 1
  • 11
11
votes
2 answers

How to compile the smallest possible V8 library for Windows?

I'm making a game engine for school, and I want to use Google's V8 to allow for JavaScript scripting in-engine. The engine is written using Visual Studio 2013, and as the final game must not exceed 50MB, I want to keep the V8 filesize impact as…
Adam Rezich
  • 2,972
  • 5
  • 28
  • 39
10
votes
1 answer

V8 does not clean up all garbage

I'm having trouble cleaning up garbage in V8. First, my Javascript is as follows: var bigstring = "ASD"; for (var b = 0; b < 20; b++) { bigstring = bigstring + bigstring; } trace("bigstring " + bigstring.length); function frame() { //…
Bart van Heukelom
  • 40,403
  • 57
  • 174
  • 291
9
votes
3 answers

Access the Abstract Syntax Tree of V8 Engine

Is it possible to access the AST of the v8 engine, for a given JavaScript code? I'm working on a JavaScript Static Analyzer using V8 engine.
9
votes
2 answers

Installing PHPv8js on Ubuntu

I'm having some trouble installing phpv8js on Ubuntu. I've made sure I have a recent version of libv8 installed and have the required version of PHP but the install fails using PECL. Here's the output: libtool: compile: g++ -I.…
robbiehudson
  • 91
  • 1
  • 1
  • 2
8
votes
2 answers

Perl: Javascript::V8 templates - from the perl

Looking for template engine like HTML::Mason (or Mason), so what "compiles" source components into perl code, but instead of perl-code will "compile" components into JavaScript code and after run/execute them with Javascript::V8 perl…
kobame
  • 5,686
  • 2
  • 28
  • 57
8
votes
2 answers

JavaScript Standard Library for V8

In my application, I allow users to write plugins using JavaScript. I embed V8 for that purpose. The problem is that developers can't use things like HTTP, Sockets, Streams, Timers, Threading, Crypotography, Unit tests, et cetra. I searched Stack…
Alon Gubkin
  • 53,054
  • 52
  • 181
  • 282
8
votes
1 answer

Right way to run the same code twice in v8 (array out-of-bounds fails on second run - deoptimizer)

The following program is based on the example in the v8 Getting Started page. I have made three changes to demonstrate a problem I am encountering: I create an empty array put it into the global context. The script being run references the zeroth…
Oliver Bock
  • 4,185
  • 3
  • 33
  • 56
7
votes
1 answer

How would one enable and use ES6 modules in the V8 javascript engine?

I use an embedded V8 engine in my (Windows Desktop) C++ application. I understand that V8 has support for ES6 modules. How would I go about activating and using this feature in my application? I would not expect anyone to have a complete worked…
Boinst
  • 2,970
  • 2
  • 29
  • 56
1
2 3
15 16