Re: [v8-users] RAII and v8

2010-10-22 Thread Ben Noordhuis
On Thu, Oct 21, 2010 at 22:05, Andrea Odetti andrea.ode...@gmail.com wrote: 1) exception: why is it not throwing normal C++ exceptions? I need to check after most calls if the TryCatch has caught anything The Google C++ style guide has a list of pros and cons:

Re: [v8-users] Re: RAII and v8

2010-10-22 Thread Ben Noordhuis
On Fri, Oct 22, 2010 at 15:12, Andrea Odetti andrea.ode...@gmail.com wrote: Meanwhile, do I need to call TryCatch::CanContinue() after each and every call into v8? Just in case something was thrown? For every call into V8 that results in JS code being run, yes. That's probably not very often,

Re: [v8-users] Re: Problems with Math.h (MINIX)

2010-10-27 Thread Ben Noordhuis
On Wed, Oct 27, 2010 at 14:47, pikpik pikpik.1...@gmail.com wrote: Does anyone have any idea why things from math.h would cause scope- related errors in some parts of V8? (This is using the involved files without changes.) After including part of the contents of math.h directly into a given

Re: [v8-users] from function to function template

2010-11-19 Thread Ben Noordhuis
On Fri, Nov 19, 2010 at 09:30, ondras ondrej.z...@gmail.com wrote: I need to check (in C++) whether a given v8::Object is an instance of a given v8::Function. The problem is that I don't have the adequate v8::FunctionTemplate (to call HasInstance) and there is no way to get from Function to

Re: [v8-users] Math.floor(i / 2) is much faster than Math.floor(i * .5) ?

2013-04-07 Thread Ben Noordhuis
On Sun, Apr 7, 2013 at 11:02 PM, Jakob Kummerow jkumme...@chromium.org wrote: This is expected. V8 has a special optimization for Math.floor of a division. The only way of fixing this would be to remove that optimization, in which case the /2 case would become about as slow as the *.5 case.

Re: [v8-users] Newbie Questions related to Context, Scope

2013-04-15 Thread Ben Noordhuis
On Sun, Apr 14, 2013 at 11:44 PM, Amy amyue.x...@gmail.com wrote: Hey, I just read though the Embedder's Guide, and taken a look inside v8.h. I am still confused about why we need separate Context and even a context stack (I remembered I saw it in the guide). Is that for the third-party

Re: [v8-users] Debugger support tutorial

2013-04-15 Thread Ben Noordhuis
On Mon, Apr 15, 2013 at 12:18 PM, Florent S. flor...@adopteunmec.com wrote: Hi there! I wanted to add debugger support to my app and use d8. I wonder if there is a step by step add debugger support tutorial. So far i wasn't lucky. I've added this to my code : void

Re: [v8-users] How to test an Argument for InstanceOf() type

2013-04-23 Thread Ben Noordhuis
On Tue, Apr 23, 2013 at 2:06 AM, Mike Moening mike.moen...@gmail.com wrote: If I have an object I injected into the global using an ObjectTemplate. The user creates one in script like this: var o = new MyObject(); That fires my SetCallAsFunctionHandler() which creates the object using the

Re: [v8-users] How to avoid GCs when working with numbers?

2013-04-23 Thread Ben Noordhuis
On Mon, Apr 22, 2013 at 11:37 PM, Andrei Kashcha anv...@gmail.com wrote: Recently I've been profiling a lot v8's garbage collection. Surprising truth is it's really slow when JS program does heavy computation. For example, consider a straightforward n-body computation for 5 bodies, over 50 000

Re: [v8-users] Confusion between context GetEntered() and GetCurrent().

2013-04-23 Thread Ben Noordhuis
On Thu, Apr 4, 2013 at 12:47 PM, Olivier GEORGET olivier.geor...@gmail.com wrote: Hi, I'm new to V8 and have only fiddled with it. Can someone please explain me the main difference between the Context access functions ? There is actually 3 of them : v8::Context::GetCurrent();

Re: [v8-users] How to test an Argument for InstanceOf() type

2013-04-23 Thread Ben Noordhuis
On Tue, Apr 23, 2013 at 3:45 PM, Mike Moening mike.moen...@gmail.com wrote: I originally created an ObjectTemplate which I also Set() in another ObjectTemplate used as argument to Context::New() It appears ObjectTemplate can't do HasInstance(). When should I use the FunctionTemplate versus

Re: [v8-users] Confusion between context GetEntered() and GetCurrent().

2013-04-23 Thread Ben Noordhuis
On Tue, Apr 23, 2013 at 5:49 PM, johnjbar...@chromium.org wrote: On Tuesday, April 23, 2013 6:47:51 AM UTC-7, Ben Noordhuis wrote: On Thu, Apr 4, 2013 at 12:47 PM, Olivier GEORGET olivier...@gmail.com wrote: Hi, I'm new to V8 and have only fiddled with it. Can someone please explain

Re: [v8-users] How to test an Argument for InstanceOf() type

2013-04-23 Thread Ben Noordhuis
On Tue, Apr 23, 2013 at 5:42 PM, Mike Moening mike.moen...@gmail.com wrote: If I use the FunctionTemplate instead of the ObjectTemplate I can't seem to get a constructor callback to work. funcTemplate-InstanceTemplate()-SetCallAsFunctionHandler(ctorCallback); Why would you use

Re: [v8-users] How to test an Argument for InstanceOf() type

2013-04-24 Thread Ben Noordhuis
On Wed, Apr 24, 2013 at 1:07 AM, Mike Moening mike.moen...@gmail.com wrote: Ben, Can you expand on your example? I'm sure this is piece of cake for you, but I'm not getting what you mean. All the samples I can find show using ObjectTemplate and the SetCallAsFunctionHandler() to handle

Re: [v8-users] How to test an Argument for InstanceOf() type

2013-04-24 Thread Ben Noordhuis
On Wed, Apr 24, 2013 at 12:28 PM, Stephan Beal sgb...@googlemail.com wrote: On Wed, Apr 24, 2013 at 11:00 AM, Ben Noordhuis i...@bnoordhuis.nl wrote: ...The trick I mentioned in my other post is that you add a second internal field that points to some atom (usually a char class_name_id

Re: [v8-users] compile with make gdbjit=on ia32.debug but fail

2013-04-26 Thread Ben Noordhuis
On Fri, Apr 26, 2013 at 4:39 AM, Amy amyue.x...@gmail.com wrote: I got the following errors when I was trying to compile with gdbjit=on, how to solve it? CXX(target) /workspace/v8/out/native/obj.target/v8_base/src/gdb-jit.o ../src/gdb-jit.cc:503:13: error: no matching constructor for

Re: [v8-users] Creating persistent weak handles on primitive values did not collected by GC?

2013-04-27 Thread Ben Noordhuis
On Sat, Apr 27, 2013 at 10:36 AM, Dmitry Azaraev dmitry.azar...@gmail.com wrote: Boolean values are eternal --- they never die. Small integers (31 bits on ia32 and 32bits on x64) are not even allocated in the heap, they are *values* essentially so weak reachability is undefined for them.

Re: [v8-users] How to check if there is a current context?

2013-04-28 Thread Ben Noordhuis
On Sun, Apr 28, 2013 at 12:07 PM, danijar pfis...@gmail.com wrote: I want to use only a single v8::Context for my whole application, so that I can access registered callbacks from everywhere. I tried simple always using v8::Context::GetCurrent() but I crashes if I haven't created a context

Re: [v8-users] How to link V8 in android(libwebcore.so) ?

2013-05-22 Thread Ben Noordhuis
On Wed, May 22, 2013 at 9:46 AM, Crossle Song xming.s...@gmail.com wrote: I wanna link V8 in android libwebcore.so, help me ? Don't double-post, people will hate you for it. -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this

Re: [v8-users] Parsing ArrayBuffer from Script

2013-05-23 Thread Ben Noordhuis
On Fri, May 24, 2013 at 12:32 AM, Michael Wielpütz m.wielpu...@gmail.com wrote: Hi, currently I'm trying to read an ArrayBuffer, resulting from Javascript, inside a C++ application. For testing purposes I stripped the code down to the following: v8::Isolate* isolate =

Re: [v8-users] v8::ResourceConstraints.How can I use it?

2013-05-29 Thread Ben Noordhuis
On Wed, May 29, 2013 at 12:48 PM, Vitaly Alekseev valekseevten...@gmail.com wrote: The v8::ResourceConstraints class is defined as follows: class V8EXPORT ResourceConstraints { public: ResourceConstraints(); int max_young_space_size() const { return max_young_space_size_; } void

Re: [v8-users] wrapping a c++ class

2013-06-02 Thread Ben Noordhuis
On Sat, Jun 1, 2013 at 8:49 PM, t...@ainfach.de t...@ainfach.de wrote: Hello, i try to wrap an object and everytime i end up in a segmentation fault (in line 56). https://gist.github.com/timglabisch/22aa198c360335650fca#file-gistfile1-cpp-L56 here is my gdb output as well: Breakpoint 1,

Re: [v8-users] Profiling v8 inside chromium/content_shell

2013-06-11 Thread Ben Noordhuis
On Tue, Jun 11, 2013 at 7:24 AM, Adam Klein ad...@chromium.org wrote: I'm trying to profile the v8 execution of a web app using Chromium's content_shell with some success. But I'm also getting some odd results. I'm using a commandline like: content_shell --no-sandbox --js-flags='--prof

Re: [v8-users] where is the --print_ast ???

2013-06-19 Thread Ben Noordhuis
On Wed, Jun 19, 2013 at 10:08 AM, QingHai Hu ustc.sos...@gmail.com wrote: I get the newest code from the github of v8, but when I want to test v8 with using out/ia32release/shell --print_ast mytest.js , the terminal tells me unknown flag --print_ast. And I make the out/ia32release/shell --help

Re: [v8-users] objects that assigned to any function's prototype can not destroy by garbage collection?

2013-06-27 Thread Ben Noordhuis
On Thu, Jun 27, 2013 at 3:52 PM, Lew Janyu anydreameng...@gmail.com wrote: Please view the code below: // d8 --expose-gc for(var i = 0; i 100; i++) { // allocation huge memory var buffer = []; buffer.length = 10; // assign to some native function's prototype

Re: [v8-users] Floating point error

2013-07-03 Thread Ben Noordhuis
On Wed, Jul 3, 2013 at 6:49 PM, Benedikt Naessens th3sink...@gmail.com wrote: When I run shell on my ARM A9 Cortex and I type: print(3.3*3.3); I get a floating point exception (core dumped). The Building V8 with GYP site (https://code.google.com/p/v8/wiki/BuildingWithGYP) seems to be a bit

Re: [v8-users] Floating point error

2013-07-04 Thread Ben Noordhuis
On Thu, Jul 4, 2013 at 12:07 PM, Benedikt Naessens th3sink...@gmail.com wrote: I have a hard time finding the core dump (for some reason, apport doesn't copy the core dump to /var/crash and in case apport is disabled no core dump is made at all). Anyway, I've built V8 with the arm.debug

Re: [v8-users] Binary data in embedded V8

2013-07-04 Thread Ben Noordhuis
On Fri, Jul 5, 2013 at 12:08 AM, Stephan Beal sgb...@googlemail.com wrote: On Fri, Jul 5, 2013 at 12:03 AM, Arseniy Pavlenko h0x...@gmail.com wrote: Any updates/workarounds for 8 bit binary strings? JS doesn't support them, so v8 doesn't either. You cannot legally use Strings for

Re: [v8-users] Re: Making v8::Persistent safe to use

2013-07-05 Thread Ben Noordhuis
On Fri, Jun 21, 2013 at 9:19 AM, Dan Carney dcar...@chromium.org wrote: The transition from Local to Handle won't happen for a while. It's more of a cleanup step after everything else is done, and there's no urgency since there shouldn't be any performance impact. At that point, we'll add

Re: [v8-users] Wrapping a C++ class, revisited

2013-07-08 Thread Ben Noordhuis
On Mon, Jul 8, 2013 at 9:35 AM, Lyndsey lyndseypad...@gmail.com wrote: I know that others have posted questions about this here and elsewhere. However, I generally find either the question or the answer (or both) to be either too vague or too old (or both). I simply want to wrap a C++ class

Re: [v8-users] Wrapping a C++ class, revisited

2013-07-08 Thread Ben Noordhuis
On Mon, Jul 8, 2013 at 6:45 PM, Lyndsey lyndseypad...@gmail.com wrote: Thank you Ben. I assume you mean something like what's being done here? I think the problem is that I'm not using node, and that would be needed to do the following, correct? point-Wrap(args.This()); //Where Wrap is

Re: [v8-users] Re: Wrapping a C++ class, revisited

2013-07-09 Thread Ben Noordhuis
On Mon, Jul 8, 2013 at 11:58 PM, Lyndsey lyndseypad...@gmail.com wrote: I should also note that I forgot to change the comment above the GetPointX method. I am obviously reaching breakpoints in there now. :) Also, I wholeheartedly agree about adding the check to ensure the constructor is

Re: [v8-users] Re: Making v8::Persistent safe to use

2013-07-17 Thread Ben Noordhuis
On Tue, Jul 16, 2013 at 11:44 PM, Mike Moening mike.moen...@gmail.com wrote: I've got a simple example in yellow below of using Persistent that is broken with the recent API changes. Can somebody tell me how to re-write this so that it will compile with the new API changes? I'm a tad lost on

Re: [v8-users] Re: Making v8::Persistent safe to use

2013-07-24 Thread Ben Noordhuis
On Wed, Jul 24, 2013 at 3:34 PM, Dan Carney dcar...@chromium.org wrote: Constantly needing to create a LocalT::New() every time I need to use a PersistentT in cases like the above isn't playing nicely. I've noticed since the change that GC time from --prof has grown around 5% in high I/O

Re: [v8-users] Re: Holding v8:Persistent handles

2013-08-05 Thread Ben Noordhuis
On Mon, Aug 5, 2013 at 9:01 AM, Dan Carney dcar...@chromium.org wrote: Good. Will we be able to copy persistent? In my case I have to be able to pass around a persistent and store it in several places at a time. Or should I wrap it in another object and ref count it myself? It will be

Re: [v8-users] Soft Floating Point support

2013-08-05 Thread Ben Noordhuis
On Mon, Aug 5, 2013 at 11:25 AM, Thulasidhar JK thulasid...@gmail.com wrote: Dear All, We are planning to use Blink+V8 as the browser in our embedded devices (blu-ray players) We are currently using Webkit+JSC on ARMv6z CPU and are moving into a new variant of this chipset, which does not

Re: [v8-users] Persistent::WrapperClassId size reduction

2013-08-05 Thread Ben Noordhuis
On Mon, Aug 5, 2013 at 12:56 PM, Dan Carney dcar...@chromium.org wrote: Hi all, is anyone using more than a few bits of the Persistent::WrapperClassId field? I'm not seeing a lot of uses in the wild, and I'd like to cut it down from a uint16_t to a uint8_t. Thanks, Dan I'll have to

Re: [v8-users] New feature: handle eternalization

2013-08-07 Thread Ben Noordhuis
On Wed, Aug 7, 2013 at 10:46 AM, Dan Carney dcar...@chromium.org wrote: Hi all, as part of the refactor of v8::Persistent, I've added the ability to store and fetch a handle which will live for the lifetime of the Isolate, but which has none of the complexity and overhead (and problems) of a

Re: [v8-users] How to trigger garbage collection?

2013-08-07 Thread Ben Noordhuis
On Wed, Aug 7, 2013 at 10:49 AM, xwaf...@gmail.com wrote: I used gdb --args ../out/ia32.debug/d8 --trace_gc --trace_gc_verbose run.js and r to run the benchmark without any breakpoint, the gc will be triggered 9 times(all in the newspace). but if I set a breakpoint at

Re: [v8-users] Who сan tell me why v8::Debug::DisableAgent had been deleted?

2013-08-16 Thread Ben Noordhuis
On Fri, Aug 16, 2013 at 2:17 PM, Vitaly Alekseev valekseevten...@gmail.com wrote: Hi, all! Who сan tell me why v8::Debug::DisableAgent had been deleted? How can I disable it? Not sure what you mean. It still exists in HEAD, doesn't it? What particular version of V8 are you referring to? --

Re: [v8-users] Re: Who сan tell me why v8::Debug::DisableAgent had been deleted?

2013-08-16 Thread Ben Noordhuis
On Fri, Aug 16, 2013 at 3:51 PM, Vitaly Alekseev valekseevten...@gmail.com wrote: I looked documentation. http://izs.me/v8-docs/classv8_1_1Debug.html. There it isn't described V8 has a very strong 'Use the source, Luke' vibe to it. I just check what's in include/*.h. -- -- v8-users mailing

Re: [v8-users] Need Help: Global Object properties not accessible in multithreaded application.

2013-08-18 Thread Ben Noordhuis
On Sun, Aug 18, 2013 at 4:13 PM, Clemens Cap clemens@uni-rostock.de wrote: I wrote a multithreaded V8 application where (in the normal case) every thread starts and executes in its own Isolate. There is one phenomenon I do not understand and which probably is due to my lack of

Re: [v8-users] How do I cast PersistentContext to void* and back?

2013-08-19 Thread Ben Noordhuis
On Mon, Aug 19, 2013 at 6:35 AM, Luke l...@webconnex.com wrote: I'm trying to convert PersistentContext to a void* to be passed to C, then back. I understand that there are a lot of changes happening to Persistent. This is what I have so far, which is probably wrong: void* isolate_new() {

Re: [v8-users] Cannot exit non-entered context when exiting Context::GetEntered(). Why?

2013-08-19 Thread Ben Noordhuis
On Mon, Aug 19, 2013 at 11:21 PM, Clemens Cap clemens@uni-rostock.de wrote: Why would I then get a Cannot exit non-entered context in the following code fragment? Context::GetEntered()-Exit(); I get the same error in Context::GetCurrent()-Exit(); Check if the return value from

Re: [v8-users] Re: New feature: handle eternalization

2013-08-23 Thread Ben Noordhuis
On Fri, Aug 23, 2013 at 8:58 AM, Dan Carney dcar...@chromium.org wrote: We've discussed the api a bit more, and decided that it really needs to look more like Local and Persistent. I apologize to anyone who may have already started to use the original api. This change will land next week and

Re: [v8-users] Persistent MakeWeak callback signature change?

2013-08-27 Thread Ben Noordhuis
On Tue, Aug 27, 2013 at 10:55 PM, Mike Moening mike.moen...@gmail.com wrote: Seems the Persistent::MakeWeak has changed. I can't figure out how to fix it. static void JSLogFile_DestructorCallback(Isolate* env, PersistentValue* value, void* pNative); ... obj.MakeWeak(pIsolate, pFile,

Re: [v8-users] Best way to pass an arbitrary data pointer into a callback?

2013-09-02 Thread Ben Noordhuis
On Sun, Sep 1, 2013 at 11:40 PM, Kram Jordy kramjo...@gmail.com wrote: Hello, Sorry if this is an obvious question, but I'm trying to pass a native c++ data pointer through when setting up a function template for access within a callback. So for example in the code below, if I wanted to pass

Re: [v8-users] passing callback function to JS method

2013-09-02 Thread Ben Noordhuis
On Mon, Sep 2, 2013 at 6:21 PM, Mike Moening mike.moen...@gmail.com wrote: I could except the function argument to the execut method is optional. If the argument exists I covert it. Otherwise I don't Using the explicit constructor would cause a scoping issue. How about this? LocalFunction

Re: [v8-users] How to use V8 as JavaScript parser?

2013-09-14 Thread Ben Noordhuis
On Sat, Sep 14, 2013 at 1:21 PM, Ivan P. ivan.pizhe...@gmail.com wrote: Hello, Does anyone has experience with using V8 as standalone parser? Please share any links and/or code if possble. The idea is to get AST and traverse it. I need only traverse AST, not modify it. V8 doesn't have a

Re: [v8-users] Builder v8 as a static library for Android

2013-09-17 Thread Ben Noordhuis
On Tue, Sep 17, 2013 at 11:50 AM, Diep Nguyen Hoang viruslove1...@gmail.com wrote: Hi, currently I'm trying to build v8 as a static library on Android. I have successfully finished build command, and have libv8_base.arm.a, libv8_nosnapshot.arm.a, libv8_snapshot.a already. But when I put them

Re: [v8-users] GetIsolate from PersistentContext?

2013-09-18 Thread Ben Noordhuis
On Wed, Sep 18, 2013 at 9:44 PM, Luke l...@webconnex.com wrote: How do I get an Isolate from a persistent context? I need to enter an Isolate::Scope and Context::Scope, but this method is marked to be deprecated: V8_INLINE Scope(Isolate* isolate, PersistentContext context) What is the

Re: [v8-users] GetIsolate from PersistentContext?

2013-09-18 Thread Ben Noordhuis
On Wed, Sep 18, 2013 at 10:10 PM, Luke l...@webconnex.com wrote: On Wednesday, September 18, 2013 1:05:06 PM UTC-7, Ben Noordhuis wrote: On Wed, Sep 18, 2013 at 9:44 PM, Luke lu...@webconnex.com wrote: How do I get an Isolate from a persistent context? I need to enter an Isolate::Scope

Re: [v8-users] Re: How to push a task to Nodejs' V8 main thread ?

2013-09-24 Thread Ben Noordhuis
On Tue, Sep 24, 2013 at 8:46 AM, ashish negi thisismyidash...@gmail.com wrote: Does it require uv_ ? Does uv provide something that can put some task on v8 main thread and call some interface function for me to implement ? Discussions about libuv and node.js are wildly off-topic on this list.

Re: [v8-users] How does v8 decide when to do garbage collection?

2013-09-27 Thread Ben Noordhuis
On Fri, Sep 27, 2013 at 12:04 PM, Craig Thomson cr...@craigthomson.me.uk wrote: Hi, I am trying to understand a bit of the v8 source to do with garbage collection and I am hoping that someone can give me a pointer in the right direction. How does v8 decide when to do Garbage collection? Is

Re: [v8-users] How does v8 decide when to do garbage collection?

2013-09-27 Thread Ben Noordhuis
On Fri, Sep 27, 2013 at 7:40 PM, ioannis ioanni...@gmail.com wrote: So i'm going to piggyback this post for some additional questions... 1) Is it safe to call v8::V8::IdleNotification() within a WeakCallback() to scavenge additional objects that have been set as weak in WeakCallback() ? I

Re: [v8-users] How does v8 decide when to do garbage collection?

2013-09-28 Thread Ben Noordhuis
On Sat, Sep 28, 2013 at 12:37 AM, ioannis ioanni...@gmail.com wrote: Ben thanks for the reply... For q1) i figured as much... For q2) Hmm. indeed you are right, although an object may be in scope if it is not referenced after the point where GC is initiated then it is eligible for garbage

Re: [v8-users] How does v8 decide when to do garbage collection?

2013-09-30 Thread Ben Noordhuis
On Sun, Sep 29, 2013 at 7:27 PM, ioannis ioanni...@gmail.com wrote: Thanks for the pointers. This would mean that i need to keep a record of all the objects that have been created dynamically and rebuild the relationships on every GC. Isn't this a bit expensive ? It might be, yes. I stress

Re: [v8-users] How to execute code with a specific object as 'this'

2013-10-03 Thread Ben Noordhuis
On Thu, Oct 3, 2013 at 5:11 PM, ChaRles Lew crlf0...@gmail.com wrote: Hi, i'm a newbie on using v8. I'm trying to embedded v8 into a c++ application and provide javascript as an extension language. Now i'm seeking a way to invoke javascript code (as a string) from c++ environment, with a

Re: [v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-06 Thread Ben Noordhuis
On Sat, Oct 5, 2013 at 10:07 PM, James Lomax james@gmail.com wrote: Hi, this is somethings that's had me stumped for the past 6 hours now.. I have an object template which has a setter and getter for the object update which simply set/get an object handle accessible to both the setter and

Re: [v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-06 Thread Ben Noordhuis
On Sun, Oct 6, 2013 at 1:40 PM, James Lomax james@gmail.com wrote: Thanks, is there a special way to turn a LocalValue into a PersistentFunction? I tried changing FuncWrapper to wrap a PersistentFunction and then solved the problem of turning a Local into a persistent with this (in

Re: [v8-users] Setter/Getter for function turns function into a string when the function is called?

2013-10-06 Thread Ben Noordhuis
On Sun, Oct 6, 2013 at 6:16 PM, James Lomax james@gmail.com wrote: So having just ported to more recent v8 I now can't figure out how to call the PersistentFunction This issue can be quickly fixed by un-privatising PersistentFunction::operator* and implementing an inline operator- within

Re: [v8-users] What is recv in Function Call ?

2013-10-15 Thread Ben Noordhuis
On Tue, Oct 15, 2013 at 8:56 AM, ashish negi thisismyidash...@gmail.com wrote: In the c++ function class i see the function call definition as : class Function : public Object { public: // V8EXPORT LocalValue Call(HandleObject recv, int argc,

Re: [v8-users] What is recv in Function Call ?

2013-10-15 Thread Ben Noordhuis
On Tue, Oct 15, 2013 at 10:05 AM, ashish negi thisismyidash...@gmail.com wrote: I am actually making an addon for nodejs, that simulates the JS - Proxy - Bridge. This addon gets a callback. Can i get the 'this' pointer i.e. v8::Object from that callback. The signature of callback is

Re: [v8-users] My program which using v8 library crashes with Valgrind but not without Valgrind

2013-10-15 Thread Ben Noordhuis
On Tue, Oct 15, 2013 at 3:24 PM, dan wu wudan@gmail.com wrote: My program invokes the oracle library(libclnt.so) and the v8 library(libv8).When I use Valgrind to detected memory leaks,I get error messages as follow: ORA-24550: signal received: [si_signo=4] [si_errno=0] [si_code=1]

Re: [v8-users] Re: How to know when object gets deleted ?

2013-10-23 Thread Ben Noordhuis
On Wed, Oct 23, 2013 at 11:33 AM, ashish negi thisismyidash...@gmail.com wrote: I changed the code to : v8::Handlev8::Object Interceptor::MakeInterceptor(){ v8::HandleScope scope; if(InterceptorTemplate.IsEmpty()) { v8::Handlev8::ObjectTemplate objectTemplate = v8::ObjectTemplate::New();

Re: [v8-users] How to find two Persistents point to same javascipt object OR one Local and another Persistent?

2013-10-23 Thread Ben Noordhuis
On Wed, Oct 23, 2013 at 12:53 PM, ashish negi thisismyidash...@gmail.com wrote: I call a c++ function from the javascript with a string parameter objName, which is some object name in the javascript world. In c++ function, i take a local handle to the object. LocalObject basicObj =

Re: [v8-users] Building v8 for Android, ARM binary sizes

2013-10-23 Thread Ben Noordhuis
On Wed, Oct 23, 2013 at 1:12 PM, Pris Matic prismatic.proj...@gmail.com wrote: Hi, I built v8 for Android three different ways and the file sizes for the resulting binaries seemed a little 'off' compared to a value I got from the site of a mobile development framework (Appcelerator) that

Re: [v8-users] What version of v8?

2013-10-23 Thread Ben Noordhuis
On Wed, Oct 23, 2013 at 6:01 PM, Spencer Killen spleen.mas...@gmail.com wrote: So I download the source from Git, just by cloning the entire project but I dont know what version anything is, when I cloned the source did I pick a version or did I do that when I built it? Unless you specified a

Re: [v8-users] How to use v8::Persistent::SetWeak to avoid memory leak

2013-10-24 Thread Ben Noordhuis
On Thu, Oct 24, 2013 at 5:25 AM, Yorath Wang yorathw...@gmail.com wrote: I am using v8 (tag 3.22.19) built as shared library, the environment is windows 8.1 x64, visual studio 2010. I use External::new(ptr) to pass the pointer to Print function, but the ptr is allocated use new, I don't know

Re: [v8-users] v8 Gyp visual studio 2013 project files

2013-10-25 Thread Ben Noordhuis
On Fri, Oct 25, 2013 at 7:31 PM, mchand...@lindenlab.com wrote: Is there any way to get v8/gyp to output visual studio 2013 project files to be able to compile via the command line. I can get it to work if i have visual studio 2010 installed as well but i want to be able to compile with just

Re: [v8-users] v8 Gyp visual studio 2013 project files

2013-10-25 Thread Ben Noordhuis
On Sat, Oct 26, 2013 at 12:26 AM, mchand...@lindenlab.com wrote: Is there a command line option for this? Cmake is not very nice with env variables. I don't think there is, sorry. -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received

Re: [v8-users] not yet optimizing ToObject, not enough type info

2013-11-07 Thread Ben Noordhuis
On Thu, Nov 7, 2013 at 5:22 PM, dhruvbird dhruvb...@gmail.com wrote: I'm getting a lot of such lines printed with I run with --trace_opt --trace_deopt 1. What does it mean (simplified)? 2. Any idea how I can find out which operations are leading to this? 3. Also, the function name isn't

Re: [v8-users] not yet optimizing ToObject, not enough type info

2013-11-08 Thread Ben Noordhuis
On Thu, Nov 7, 2013 at 7:44 PM, dhruvbird dhruvb...@gmail.com wrote: On Thursday, November 7, 2013 9:39:04 AM UTC-8, Ben Noordhuis wrote: On Thu, Nov 7, 2013 at 5:22 PM, dhruvbird dhru...@gmail.com wrote: I'm getting a lot of such lines printed with I run with --trace_opt --trace_deopt 1

Re: [v8-users] v8 profiler not printing javascript symbols (using node.js)

2013-11-08 Thread Ben Noordhuis
On Thu, Nov 7, 2013 at 7:46 PM, dhruvbird dhruvb...@gmail.com wrote: Hello, I'm running my script as: node --prof script.js And the profiling using: cd path to v8 checkout ./tools/linux-tick-processor path to v8.log but I only see the [C++] symbols, and not the [Javascript] symbols. Is

Re: [v8-users] v8 profiler not printing javascript symbols (using node.js)

2013-11-09 Thread Ben Noordhuis
On Sat, Nov 9, 2013 at 4:53 AM, dhruvbird dhruvb...@gmail.com wrote: Hi Ben, On Friday, November 8, 2013 3:42:53 AM UTC-8, Ben Noordhuis wrote: On Thu, Nov 7, 2013 at 7:46 PM, dhruvbird dhru...@gmail.com wrote: Hello, I'm running my script as: node --prof script.js And the profiling

Re: [v8-users] not yet optimizing ToObject, not enough type info

2013-11-09 Thread Ben Noordhuis
On Sat, Nov 9, 2013 at 4:57 AM, dhruvbird dhruvb...@gmail.com wrote: Okay, so is it possible that this is happening because different types are passed in to that function all the time? Will the optimizer not create 2 different functions for each type passed in? I'm basically passing in

Re: [v8-users] v8 profiler not printing javascript symbols (using node.js)

2013-11-09 Thread Ben Noordhuis
On Sat, Nov 9, 2013 at 7:35 PM, dhruvbird dhruvb...@gmail.com wrote: Thanks Ben that seems to have worked. I am able to see the js symbols now. However, I get the following error when running 'make native': make[1]: Entering directory `/home/dhruvbird/projects/node/deps/v8/out' CXX(target)

Re: [v8-users] MemoryChunk layout: What is Guard doing for?

2013-11-11 Thread Ben Noordhuis
On Mon, Nov 11, 2013 at 1:06 PM, Steve Jonghee Yun yun.jong...@gmail.com wrote: I am reading V8 sources for GC. MemoryAllocator::AllocateChunk() explain MemoryChunk like below. Is [Guard] for what? // // MemoryChunk layout: // // Executable //

Re: [v8-users] Advance notice/RFC: Remove SetIndexedPropertiesToExternalArrayData and friends

2013-11-12 Thread Ben Noordhuis
On Tue, Nov 12, 2013 at 9:08 AM, Dmitry Lomov dslo...@chromium.org wrote: As you probably know, over the course of the last several months, V8 switched to an in-house implementations of ArrayBuffer, typed arrays and DataView. These implementations feature faster allocation, better garbage

Re: [v8-users] What is an undetectable object?

2013-11-18 Thread Ben Noordhuis
On Mon, Nov 18, 2013 at 6:05 AM, Steve Jonghee Yun yun.jong...@gmail.com wrote: // Tells whether the instance is undetectable. // An undetectable object is a special class of JSObject: 'typeof' operator // returns undefined, ToBoolean returns false. Otherwise it behaves like // a

Re: [v8-users] What is mutator?

2013-11-20 Thread Ben Noordhuis
On Wed, Nov 20, 2013 at 6:50 AM, Steve Jonghee Yun yun.jong...@gmail.com wrote: I read some document of V8 GC and memory allocation. They mentioned 'mutator'. Also spaces.h explain MemoryChunkFlags enum like below. // Large objects can have a progress bar in their page header. These

Re: [v8-users] Debugging multiple Isolates

2013-11-21 Thread Ben Noordhuis
On Wed, Nov 20, 2013 at 9:06 AM, Roman Decker roman.dec...@gmail.com wrote: Hello there, in my application (using V8 3.17.16), I have to execute multiple scripts. I also want to be able to debug them. Previously I started all the scripts in the default isolate, and debugging them worked just

Re: [v8-users] RSS keeps growing

2013-11-21 Thread Ben Noordhuis
On Thu, Nov 21, 2013 at 10:31 AM, romain.go...@applidium.com wrote: Hi everyone, I have this app running on v8 (it's a Node.js server, but my question is a v8 one). If I measure its memory consumption using tools like ps or top, it seems like it's badly leaking memory. Indeed, between two

Re: [v8-users] Crash when trying to convert tryCatch stuff to strings?

2013-11-24 Thread Ben Noordhuis
On Sun, Nov 24, 2013 at 9:35 AM, Gregory Hlavac ghla...@gmail.com wrote: d:\trsdependencies\v8trunk\src\contexts.cc (47): v8::internal::Context::builtins d:\trsdependencies\v8trunk\src\execution.cc (634): v8::internal::Execution::ToString d:\trsdependencies\v8trunk\src\api.cc (2690):

Re: [v8-users] Crash when trying to convert tryCatch stuff to strings?

2013-11-25 Thread Ben Noordhuis
On Mon, Nov 25, 2013 at 11:13 AM, Gregory Hlavac ghla...@gmail.com wrote: New information, this now also happens on this line. Utility::trace(\tLine of exception: + to_string(msg-GetLineNumber())); I am however able to use msg-GetScriptResourceName() successfully just before that.

Re: [v8-users] Debugging multiple Isolates

2013-11-26 Thread Ben Noordhuis
On Tue, Nov 26, 2013 at 1:15 PM, Roman Decker roman.dec...@gmail.com wrote: Hey, thanks for the response, I have fixed my original problem, however I've run into a new one. What is the concurrency model? One isolate per thread or more? The application has two threads: The first thread is

Re: [v8-users] type-feedback-based storage switch

2014-01-01 Thread Ben Noordhuis
On Mon, Dec 30, 2013 at 5:25 PM, wei wang flyingwei1...@gmail.com wrote: Hello, I learnt from somewhere (http://www.html5rocks.com/en/tutorials/speed/v8/ the array section) that V8 will switch the array storage (for example from array to hashtable) based on type-feedback. Could someone

Re: [v8-users] Size limitation on the snapshot file?

2014-02-06 Thread Ben Noordhuis
On Thu, Feb 6, 2014 at 4:30 AM, Zhao Cheng zcb...@gmail.com wrote: I also notice that ScriptData can be used to precompile script, is the ScriptData serializable so I could write it in a file and the load it in clients' machines? And is there any benchmark on how much time ScriptData could

Re: [v8-users] Profiling JavaScript Code on nodejs using V8

2014-02-06 Thread Ben Noordhuis
On Wed, Feb 5, 2014 at 10:39 AM, Pomil Proch pomil.pr...@gmail.com wrote: Can there be possible workaround for v8 , so that i can add timestamp information ,iteration count for functions There are a large number of tools[1] based on escodegen[2] that augment source code to do things like you

Re: [v8-users] Multiple context in the same isolate

2014-02-09 Thread Ben Noordhuis
On Sun, Feb 9, 2014 at 9:46 PM, Sara Abdelhameed saraabdelhameed1...@gmail.com wrote: Hi, all I have a small question, can multiple contexts that are created in the same isolate share their objects? is it applicable that we could create two context one after the other in the same isolate scope

Re: [v8-users] Keeping Context entered across Lockers

2014-02-11 Thread Ben Noordhuis
On Tue, Feb 11, 2014 at 10:29 PM, Geoff Morrison gm...@zback.org wrote: On Tuesday, February 11, 2014 2:47:48 AM UTC-8, Ben Noordhuis wrote: On Tue, Feb 11, 2014 at 12:11 AM, Geoff Morrison gm...@zback.org wrote: I'm trying to Enter a Context in one Locker, then use it in another

Re: [v8-users] A pseudo-global.

2014-02-11 Thread Ben Noordhuis
On Tue, Feb 11, 2014 at 10:37 PM, Kevin Ingwersen ingwie2...@googlemail.com wrote: Hey there. I am working on a rather tricky implementation. Currently, I am designing a NodeJS module, that will grant access and bindings to CEF. So far, I can start CEF from nodejs easily. But what I want to

Re: [v8-users] Re: Set and retrieve custom context for native functions.

2014-02-15 Thread Ben Noordhuis
On Sat, Feb 15, 2014 at 1:11 AM, Jane Chen jxche...@gmail.com wrote: Found Isolate.GetData and Isolate.SetData. Assuming that's the way to go I'll give them a try. There's also Context::GetEmbedderData() / Context::GetAlignedPointerFromEmbedderData() and Context::SetEmbedderData() /

Re: [v8-users] Multiple context in the same isolate

2014-02-15 Thread Ben Noordhuis
On Sat, Feb 15, 2014 at 3:21 PM, Sara Abdelhameed saraabdelhameed1...@gmail.com wrote: Actually, I don't understand what you mean; but suppose if I have this scenario 1- create 1st context 2- enter it and declare some objects here and do some operations on them 3- then exit this context 4-

Re: [v8-users] Multiple context in the same isolate

2014-02-16 Thread Ben Noordhuis
On Sat, Feb 15, 2014 at 6:58 PM, Sara Abdelhameed saraabdelhameed1...@gmail.com wrote: Yes, I did that in the threads I lock and unlock the global isolate, and I know that didn't make the threads run in parallel, because I used the same isolate for the two threads, but I want just to run the

Re: [v8-users] Re: Set and retrieve custom context for native functions.

2014-02-16 Thread Ben Noordhuis
On Sun, Feb 16, 2014 at 4:51 PM, Jane Chen jxche...@gmail.com wrote: Hey Ben, That's really good to know. I think that's probably what I need. Just took a look at the API doc: /** * Gets the embedder data with the given index, which must have been set by a * previous call to

Re: [v8-users] How to cause getters/setters to perform their usual function?

2014-02-17 Thread Ben Noordhuis
On Mon, Feb 17, 2014 at 10:51 AM, Danny Dorfman wilderness...@gmail.com wrote: Hello there, I have a piece of native C++ code that creates special objects. Objects, that behave differently under certain conditions. My question is, how to make these special objects resume their normal

Re: [v8-users] Re: Set and retrieve custom context for native functions.

2014-02-19 Thread Ben Noordhuis
On Wed, Feb 19, 2014 at 7:18 AM, Jane Chen jxche...@gmail.com wrote: I need to store some pointers (void*) in my context. It looks like that the closest thing I get is Int32Array. I'm not sure what you mean. Context::SetAlignedPointerInEmbedderData() is for storing, well, pointers. -- --

Re: [v8-users] Error building v8 on Mac OSX.

2014-02-20 Thread Ben Noordhuis
On Thu, Feb 20, 2014 at 7:51 PM, Jane Chen jxche...@gmail.com wrote: Jacob, Thanks for your reply. My Python version is 2.6.1: Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin I just tried with the following (removing shared library and

Re: [v8-users] Testing for NaN in the code

2014-02-26 Thread Ben Noordhuis
On Wed, Feb 26, 2014 at 7:09 AM, Danny Dorfman wilderness...@gmail.com wrote: Is there a simple way of testing a HandleValue against NaN? ( I tried using IsNumber, and I get true, but I need to be more specific ). bool is_nan = value-IsNumber() ::isinf(value-ToNumber()-Value()); // Like that?

  1   2   3   4   5   6   7   8   >