Re: [v8-users] v8 - Can v8 Engine Run different javascript in multi-thread in the same time?

2011-04-19 Thread Stephan Beal
On Tue, Apr 19, 2011 at 6:25 AM, TengAttack tengatt...@gmail.com wrote: Hello, Can v8 Engine Run different javascript in multi-thread in the same time? I got the infomation from internet, they said it should v8::Locker, but I don't want to use it. How should I do? You have to use Locker.

Re: [v8-users] Accessing C++ member objects

2011-04-19 Thread Matthias Ernst
On Tue, Apr 19, 2011 at 12:31 AM, Dave lhumong...@gmail.com wrote: Hi all, I'm experimenting with V8 for scripting in a game engine. However, I'm having trouble returning member objects of C++ classes by reference. For example, let's say I have the following C++ classes (trimmed for

Re: [v8-users] Re: How to create memory-leak-free class instances?

2011-04-19 Thread Matthias Ernst
On Mon, Apr 18, 2011 at 5:39 PM, quotient7 quotie...@googlemail.com wrote: On 18 Apr., 17:34, Matthias Ernst matth...@mernst.org wrote: A Persistent handle to the JS instance + MakeWeak let you register a callback that gets invoked by V8 when that instance was determined to be only weakly

Re: [v8-users] How to create memory-leak-free class instances?

2011-04-19 Thread Matthias Ernst
On Mon, Apr 18, 2011 at 5:35 PM, Stephan Beal sgb...@googlemail.com wrote: On Mon, Apr 18, 2011 at 5:25 PM, quotient7 quotie...@googlemail.comwrote: 1) I want to create a JavaScript class (prototype), that instantiates a C++ class. So for example, if script makes: new MyClass(blah), in C++

Re: [v8-users] Re: How to create memory-leak-free class instances?

2011-04-19 Thread Stephan Beal
On Tue, Apr 19, 2011 at 9:05 AM, Matthias Ernst matth...@mernst.org wrote: AdjustAmountOfExternalAllocatedMemory allows you to inform the GC that there's hidden cost involved and trigger it to run more eagerly. I'm not positive, but I guess V8 will behave as if this amount had been allocated

[v8-users] fast property access across many calls

2011-04-19 Thread ajg
I am trying to optimize a piece of code, or at least make sure the v8 goodness is properly applied. Say I have C++ code that does 10,000 JS calls to execute a JS function. All calls use same lock, context and same handle scope. The JS code accesses the same properties on the this object, a simple

[v8-users] Re: fast property access across many calls

2011-04-19 Thread ajg
I guess it is important to know how the object this is created. The object is fully constructed from C++, and then passed to the call() as the receiver. On Apr 19, 9:50 am, ajg toniogir...@gmail.com wrote: I am trying to optimize a piece of code, or at least make sure the v8 goodness is

Re: [v8-users] v8 - Can v8 Engine Run different javascript in multi-thread in the same time?

2011-04-19 Thread Matt Seegmiller
What about using Isolates? If I understand them correctly, they allow for multiple instances of V8 running from different threads interacting with different contexts and JS objects at the same time. For anyone working on them, is that correct? And are they ready to be used? Last time I looked

Re: [v8-users] v8 - Can v8 Engine Run different javascript in multi-thread in the same time?

2011-04-19 Thread joko suwito
On 20/04/2011, Matt Seegmiller m...@muzzylane.com wrote: What about using Isolates? If I understand them correctly, they allow for multiple instances of V8 running from different threads interacting with different contexts and JS objects at the same time. For anyone working on them, is that