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

2014-02-14 Thread Jane Chen
I'm trying to define a JavaScript function in v8. I need to save some context info for the scope of Script when I enter the script and make it available to the native function I define. What is the API for doing that? -- -- v8-users mailing list v8-users@googlegroups.com

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

2014-02-14 Thread Jane Chen
Found Isolate.GetData and Isolate.SetData. Assuming that's the way to go I'll give them a try. On Friday, February 14, 2014 3:36:39 PM UTC-8, Jane Chen wrote: I'm trying to define a JavaScript function in v8. I need to save some context info for the scope of Script when I enter the script

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

2014-02-18 Thread Jane Chen
, 2014 10:30:02 AM UTC-8, Ben Noordhuis wrote: On Sun, Feb 16, 2014 at 4:51 PM, Jane Chen jxch...@gmail.comjavascript: 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

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

2014-02-19 Thread Jane Chen
This is what I did: svn co http://v8.googlecode.com/svn/branches/3.24 v8 cd v8 make dependencies make -j8 x86.debug library=shared werror=no LIBTOOL-STATIC /space/v8/out/x64.debug/libicudata.a LIBTOOL-STATIC /space/v8/out/x64.debug/obj.host/third_party/icu/libicudata.a TOUCH

[v8-users] Error building v8 on Windows.

2014-02-19 Thread Jane Chen
I'm having problem building v8 on Windows in cygwin. Here are the steps I followed: $ svn co http://v8.googlecode.com/svn/branches/3.24 v8 $ cd v8 $ svn co http://gyp.googlecode.com/svn/trunk build/gyp $ svn co --force https://src.chromium.org/chrome/trunk/deps/third_party/icu46

Re: [v8-users] Error building v8 on Windows.

2014-02-20 Thread Jane Chen
requires something that your Cygwin doesn't have. You can try to figure out what that is and how to install it in Cygwin, or you can try building without i18nsupport and see if that works better. Also, werror=on has no effect, but it's also not the issue here. On Thu, Feb 20, 2014 at 7:36 AM, Jane

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

2014-02-20 Thread Jane Chen
-8, Jakob Kummerow wrote: Wild guess: Python 3.x? Try again with 2.x That said, the shared library build seems to be broken on Mac. A workaround is i18nsupport=off. On Thu, Feb 20, 2014 at 6:04 AM, Jane Chen jxch...@gmail.comjavascript: wrote: This is what I did: svn co http://v8

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

2014-02-20 Thread Jane Chen
:51 PM, Jane Chen jxch...@gmail.comjavascript: 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

Re: [v8-users] Error building v8 on Windows.

2014-02-24 Thread Jane Chen
, Jane Chen jxch...@gmail.comjavascript: wrote: Hi Jacob, I'll give it a try with Visual Studio. Thanks. Things work fine for me on Linux. But as a developer, I need to support Windows, Mac and Solaris as well. Does v8 support Solaris10 (x86-64) at all? I didn't find a Chrome

[v8-users] Access to line numbers from a native function.

2014-02-25 Thread Jane Chen
I'm implementing a native function in V8. When I throw an error, I'd like to include the line number in the JavaScript where my function is called. Is there a way for me to get that? Thanks, Jane -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users

[v8-users] How to set FunctionTemplate to a PrototypeTemplate.

2014-03-04 Thread Jane Chen
Looking at this code example in v8.h: * The following example shows how to use a FunctionTemplate: * * \code *v8::Localv8::FunctionTemplate t = v8::FunctionTemplate::New(); *t-Set(func_property, v8::Number::New(1)); * *v8::Localv8::Template proto_t = t-PrototypeTemplate(); *

[v8-users] Re: How to set FunctionTemplate to a PrototypeTemplate.

2014-03-04 Thread Jane Chen
This used to work in an older version of v8, but stopped working with the latest version of v8. So I'd still like to know the new recommended way to achieve this. Following the current v8 sample code, I can set a FunctionTemplate to an ObjectTemplate. I could use that, but would like to

[v8-users] Differences between v8 version 3.14 and 3.24.

2014-03-05 Thread Jane Chen
I know that the API has changed between v8 version 3.14 and 3.24, for example, now you need to pass Isolate around while creating a new Context or FunctionTemplate. I'd like to get a sense of how extensive and fundamental these API changes are and whether there's major functionality

[v8-users] Sharing objects among Isolates.

2014-03-06 Thread Jane Chen
I have some FunctionTemplates/ObjectTemplates that take time to create. I expect to have many concurrent Isolates. I wonder whether there's any way to reuse or share these expensive objects among Isolates. Thanks. -- -- v8-users mailing list v8-users@googlegroups.com

Re: [v8-users] Sharing objects among Isolates.

2014-03-06 Thread Jane Chen
Thanks, Ben! Separate question: how expensive is it to construct an Isolate assuming I don't do much with it? Once constructed, is it worth to keep around and re-use? Thanks, Jane On Thursday, March 6, 2014 10:45:16 AM UTC-8, Ben Noordhuis wrote: On Thu, Mar 6, 2014 at 7:38 PM, Jane Chen

Re: [v8-users] Sharing objects among Isolates.

2014-03-06 Thread Jane Chen
But looks like there's a separate heap, garbage collector, profiler managed per Isolate? On Thursday, March 6, 2014 3:23:44 PM UTC-8, Ben Noordhuis wrote: On Fri, Mar 7, 2014 at 12:06 AM, Jane Chen jxch...@gmail.comjavascript: wrote: Separate question: how expensive is it to construct

[v8-users] How to assign PersistentScript.

2014-03-10 Thread Jane Chen
I get NonCopyablePersistentTraits error when trying to assign or pass a PersistentScript. Is there anyway to make it copyable? Thanks! -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to

Re: [v8-users] V8: Fatal error: CHECK(V8::ArrayBufferAllocator() != NULL) failed

2014-03-10 Thread Jane Chen
How come shell.cc doesn't set the allocator and works fine? On Monday, March 10, 2014 2:39:20 AM UTC-7, Albert Zeyer wrote: Ah, thanks a lot, that helped. It works now. I wonder why it doesn't initializes such a standard allocator by default. Also, the embedder guide should mention this.

[v8-users] Caching Script and re-using it in different context.

2014-03-10 Thread Jane Chen
I realize that Script is actually compiled under a specific context. Given that, is it a good practice to cache a Script object and re-run it in different context? -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message

Re: [v8-users] Caching Script and re-using it in different context.

2014-03-11 Thread Jane Chen
is the actual difference? Jane On Monday, March 10, 2014 3:55:24 PM UTC-7, Ben Noordhuis wrote: On Mon, Mar 10, 2014 at 11:30 PM, Jane Chen jxch...@gmail.comjavascript: wrote: I realize that Script is actually compiled under a specific context. Given that, is it a good practice

[v8-users] How to dispose an Isolate?

2014-03-12 Thread Jane Chen
I am creating an Isolate when needed, and trying to dispose it when done. I wonder whether the assumption is that I have to be in an Isolate in order to dispose an Isolate, since I'm getting: # # Fatal error in ../src/isolate.h, line 452 # CHECK(isolate != __null) failed # C stack trace

[v8-users] Intermittent abortion: context-SetAlignedPointerInEmbedderData().

2014-03-13 Thread Jane Chen
I'm getting intermittent abortion when calling context-SetAlignedPointerInEmbedderData(): # # Fatal error in ../src/api.h, line 401 # CHECK(allow_empty_handle || that != __null) failed # C stack trace === 1: V8_Fatal 2: v8::Utils::OpenHandle(v8::Context

Re: [v8-users] Intermittent abortion: context-SetAlignedPointerInEmbedderData().

2014-03-13 Thread Jane Chen
, Mar 13, 2014 at 6:55 PM, Jane Chen jxch...@gmail.comjavascript: wrote: I'm getting intermittent abortion when calling context-SetAlignedPointerInEmbedderData(): # # Fatal error in ../src/api.h, line 401 # CHECK(allow_empty_handle || that != __null) failed # C stack

Re: [v8-users] How to dispose an Isolate?

2014-03-13 Thread Jane Chen
, Ben Noordhuis wrote: On Wed, Mar 12, 2014 at 8:15 PM, Jane Chen jxch...@gmail.comjavascript: wrote: I am creating an Isolate when needed, and trying to dispose it when done. I wonder whether the assumption is that I have to be in an Isolate in order to dispose an Isolate, since I'm

Re: [v8-users] Intermittent abortion: context-SetAlignedPointerInEmbedderData().

2014-03-13 Thread Jane Chen
? On Thursday, March 13, 2014 11:17:33 AM UTC-7, Ben Noordhuis wrote: On Thu, Mar 13, 2014 at 6:55 PM, Jane Chen jxch...@gmail.comjavascript: wrote: I'm getting intermittent abortion when calling context-SetAlignedPointerInEmbedderData(): # # Fatal error in ../src/api.h, line 401

Re: [v8-users] Intermittent abortion: context-SetAlignedPointerInEmbedderData().

2014-03-13 Thread Jane Chen
with a new context every time for execution. Jane On Thursday, March 13, 2014 1:46:18 PM UTC-7, Ben Noordhuis wrote: On Thu, Mar 13, 2014 at 7:56 PM, Jane Chen jxch...@gmail.comjavascript: wrote: You were right. context was empty. But I created it right before accessing

Re: [v8-users] Intermittent abortion: context-SetAlignedPointerInEmbedderData().

2014-03-14 Thread Jane Chen
: if (check.HasOverflowed()) return; so how could my stack be overflown? I checked my Isolate, and I was not in context when I create this context. Jane On Friday, March 14, 2014 4:51:48 AM UTC-7, Ben Noordhuis wrote: On Fri, Mar 14, 2014 at 1:57 AM, Jane Chen jxch...@gmail.comjavascript: wrote: Ben

Re: [v8-users] Intermittent abortion: context-SetAlignedPointerInEmbedderData().

2014-03-14 Thread Jane Chen
? On Friday, March 14, 2014 4:51:48 AM UTC-7, Ben Noordhuis wrote: On Fri, Mar 14, 2014 at 1:57 AM, Jane Chen jxch...@gmail.comjavascript: wrote: Ben, Can one Isolate have more than one Context? Say if I use one Context to construct a Script, and later create another Context to execute

Re: [v8-users] Intermittent abortion: context-SetAlignedPointerInEmbedderData().

2014-03-15 Thread Jane Chen
case. On Saturday, March 15, 2014 9:34:29 AM UTC-7, Ben Noordhuis wrote: On Sat, Mar 15, 2014 at 1:54 AM, Jane Chen jxch...@gmail.comjavascript: wrote: Again on trunk, I can only consistently reproduce this by using one thread to compile a script, exit the isolate, and then using

[v8-users] Should stack_guard_ be updated each time an Isolate is entered?

2014-03-17 Thread Jane Chen
Hi All, I am new to v8. I am trying to embed v8 in our system and use it in a multi-threaded environment. I observe that sometimes I get stack overflow check failing while creating a new context if I re-use an Isolate created by another thread. This makes me wonder whether the stack_guard_

Re: [v8-users] V8::Dispose() causes crash

2014-03-26 Thread Jane Chen
You have to be IN an isolate in order to dispose another Isolate. On Wednesday, March 26, 2014 6:15:42 AM UTC-7, Kevin Ingwersen wrote: Hey. I am getting somewhat confused currently. So, I have been trying out how to properly dispose an isolate. But whatever I try, I get an error. If I

[v8-users] Enter/Exit an Isolate.

2014-03-27 Thread Jane Chen
Hi, With a model where I always have one isolate per thread, and a thread may serve multiple requests and live around for some time, is there any reason why I want to Enter the isolate every time I make v8 calls and Exit afterwards? Is there any disadvantage to always be in an Isolate even

[v8-users] Re: v8 API changes

2014-03-27 Thread Jane Chen
May I know what would be the svn repository branch version for this? On Thursday, March 27, 2014 5:40:56 AM UTC-7, Sven Panne wrote: With the Chrome 34 stable release not too far in the future and the branch for 35 already looming, it is a good time to give a small overview of the recent

Re: [v8-users] v8::Object destructor callback?

2014-03-28 Thread Jane Chen
Ah! Thanks Ben! I got it just after I wrote my own book-keeping for them. :-) Will check it out anyway. On Friday, March 28, 2014 10:32:07 AM UTC-7, Ben Noordhuis wrote: On Fri, Mar 28, 2014 at 6:03 PM, Jane Chen jxch...@gmail.comjavascript: wrote: I create a v8::Object from my

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

2014-04-01 Thread Jane Chen
Does that trigger GC? I also learned that there's Isolate::RequestGarbageCollectionForTesting now. Hope that'll do it, although I haven't tried it yet. On Tuesday, April 1, 2014 8:52:42 AM UTC-7, Murat Gözcü wrote: sorry for my missed english. this is indirect response to your question.

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

2014-04-08 Thread Jane Chen
Does garbage collection happen in the same thread in which idleNotification() is called? Can garbage collection of an Isolate happens in a separate thread when this thread is still in the Isolate? On Sunday, April 6, 2014 8:47:47 PM UTC-7, Alex Chi wrote: In recently, I am coding a script

[v8-users] v8 harmony flag?

2014-05-04 Thread Jane Chen
I found the following documentation for Promise in version 3.24's v8.h: /** * An instance of the built-in Promise constructor (ES6 draft). * This API is experimental. Only works with --harmony flag. */ How do I enable the harmony flag in v8? -- -- v8-users mailing list

[v8-users] Intercepter callback on ObjectTemplate.

2014-05-07 Thread Jane Chen
With v8 for any JavaScript object foo, I can call: for (var key in foo) {print(key+:+foo[key]);}; Is there a way for me to get a callback from the above for...in loop? In other words, can I register an interceptor callback for the for..in access of foo? -- -- v8-users mailing list

Re: [v8-users] Intercepter callback on ObjectTemplate.

2014-05-07 Thread Jane Chen
O, got it! Will give it a try... Thanks a lot! On Wednesday, May 7, 2014 2:53:12 PM UTC-7, Michael Starzinger wrote: The NamedPropertyEnumeratorCallback in ObjectTemplate::SetNamedPropertyHandler() is your friend. Best regards, Michael On Wed, May 7, 2014 at 10:59 PM, Jane Chen

[v8-users] FunctionTemplate::Inherit

2014-06-09 Thread Jane Chen
It seems to me that FunctionTemplate::Inherit does not allow multiple inheritance, i.e., there is only one partent template and the last one wins. Is that right? Thanks! -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this

Re: [v8-users] FunctionTemplate::Inherit

2014-06-10 Thread Jane Chen
10, 2014 2:59:35 AM UTC-7, Ben Noordhuis wrote: On Mon, Jun 9, 2014 at 10:54 PM, Jane Chen jxch...@gmail.com javascript: wrote: It seems to me that FunctionTemplate::Inherit does not allow multiple inheritance, i.e., there is only one partent template and the last one wins

Re: [v8-users] FunctionTemplate::Inherit

2014-06-10 Thread Jane Chen
Correction: I meant to say that Internal field count needs to be set on _instance_ template for it to take effect on the instances created on instance template. Is that right? On Tuesday, June 10, 2014 5:28:27 PM UTC-7, Jane Chen wrote: Thanks, Ben! I was following the example in test

[v8-users] V8::ContextDisposedNotification()

2014-06-14 Thread Jane Chen
I tried using V8::ContextDisposedNotification() to trigger GC. But it doesn't seem to do anything. Can someone explain how it is supposed to work? I'd like to tell v8 to garbage collect everything used in the disposed context. Thanks! -- -- v8-users mailing list

Re: [v8-users] V8::ContextDisposedNotification()

2014-06-15 Thread Jane Chen
Huh! I called IdleNotification before ContextDisposedNotification! Now it really makes a difference! Thanks a lot! On Sunday, June 15, 2014 2:14:42 AM UTC-7, Ben Noordhuis wrote: On Sun, Jun 15, 2014 at 2:33 AM, Jane Chen jxch...@gmail.com javascript: wrote: I tried using V8

[v8-users] Throwable that can't be caught by JavaScript.

2014-06-25 Thread Jane Chen
I need a way to throw an exception from a function callback. For this type of exception, I don't want the script to catch it, but instead, I'd like v8 to throw it out to my system so that I can catch it and re-run the script. Does v8 provide such an API? If not, is there some kind of

[v8-users] Weak callback not called for an uncaught exception.

2014-06-25 Thread Jane Chen
I create an Error object registered with weak callback and throw it from my function callback. If the script has try catch and catches the error, my weak callback is called during GC. If the script does not catch it, but instead my TryCatch running the script catches it, my weak callback

Re: [v8-users] Throwable that can't be caught by JavaScript.

2014-06-26 Thread Jane Chen
: On Thu, Jun 26, 2014 at 6:53 AM, Jane Chen jxch...@gmail.com javascript: wrote: I need a way to throw an exception from a function callback. For this type of exception, I don't want the script to catch it, but instead, I'd like v8 to throw it out to my system so that I can catch

[v8-users] instanceof.

2014-06-26 Thread Jane Chen
I have an object instantiated from a template, which has a class name set. When I do instanceof on it in JavaScript, it only shows it's an object, but not of my class. My class seems unknown. Does v8 provide a callback API for instanceof? Or object is the best you can get? -- -- v8-users

[v8-users] Function name not available for a FunctionTemplate callback in StackTrace::CurrentStackTrace().

2014-06-26 Thread Jane Chen
If I get current stack trace from StackTrace::CurrentStackTrace() from a function created out of a FunctionTemplate, the top frame doesn't contain a function name. Is the function created in such a way considered nameless? For example, if I take stack trace from shell.cc::Read(), the top

Re: [v8-users] instanceof.

2014-06-27 Thread Jane Chen
: ValueIterator is not defined at (shell):1:15 On Thursday, June 26, 2014 9:12:09 PM UTC-7, Ben Noordhuis wrote: On Thu, Jun 26, 2014 at 6:48 PM, Jane Chen jxch...@gmail.com javascript: wrote: I have an object instantiated from a template, which has a class name set. When I do instanceof

[v8-users] How to SetAlignedPointerInInternalField on FunctionTemplate-GetFunction().

2014-06-27 Thread Jane Chen
I can't SetAlignedPointerInInternalField on FunctionTemplate-GetFunction(), even after I SetInternalFieldCount on FunctionTemplate-InstanceTemplate(). Is that just the way it is or am I missing something here? -- -- v8-users mailing list v8-users@googlegroups.com

[v8-users] Extend Date.

2014-07-02 Thread Jane Chen
I want to create a v8::Date object with more precision embedded, like saving an internal field or aligned pointer, but I'd like to inherit all the defined APIs from Date. Is there a way to do that? -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users

Re: [v8-users] instanceof.

2014-07-09 Thread Jane Chen
-SetClassName(bldrLabel); global-Set(bldrLabel,bldrTemp); var b = new XMLBuilder(); b instanceof XMLBuilder; false Object.prototype.toString.call(b); [object XMLBuilder] On Friday, June 27, 2014 3:22:14 PM UTC-7, Ben Noordhuis wrote: On Fri, Jun 27, 2014 at 9:29 PM, Jane Chen jxch...@gmail.com

[v8-users] Status of --harmony-modules and --harmony-scoping

2014-07-30 Thread Jane Chen
I am on v8 3.24, and I find these files under test/mjsunit/harmony: module-resolution.js, module-parsing.js, module-recompile.js, module-linking.js Does it mean that import and export of modules work as demonstrated by the tests as long as I turn on the harmony-modules and harmony-scoping

[v8-users] es-staging flag.

2014-08-01 Thread Jane Chen
Hi All, What's the difference between the harmony features enabled by es-staging and the rest of the harmony-xxx ones? Is this feature group (harmony-symbols, harmony-collections, harmony-iteration) more ready or complete than the other harmony- ones? Thanks, Jane -- -- v8-users mailing

[v8-users] Persistent::Reset().

2014-09-01 Thread Jane Chen
I'm embedding v8 3.24. I have an object containing a Persistent handle. Is it required that Persistent::Reset() be called within the same isolate where the v8 object is originally created? Is it required that all persistent handles be reset before an isolate can be exited or destroyed?

[v8-users] FunctionCallbackInfo: This, Holder and Callee.

2014-09-11 Thread Jane Chen
What's the difference between This() and Holder() in FunctionCallbackInfo? What does Callee() return? Can you show it with a JavaScript example? Thanks! -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you

[v8-users] Function::Call()'s first argument.

2014-09-13 Thread Jane Chen
What is the first argument meant for in Function::Call: LocalValue Call(HandleValue recv, int argc, HandleValue argv[]); It seems that passing in current context's global object works for me. But when do I need to pass in something other than that? Thanks! -- -- v8-users mailing list

[v8-users] Create a function wrapping an internal pointer.

2014-09-14 Thread Jane Chen
If I create a function with a function template and set a callback, I can't save an aligned pointer in an internal field. If I create an object with an object template and SetCallAsFunctionHandler, I can save an internal field, but the returned object's typeof returns an object, not a

[v8-users] V8::TerminateExecution().

2014-09-29 Thread Jane Chen
I'm following the example in TestTerminateOnlyV8ThreadFromThreadItself() in test-thread-termination.cc, and it works for me: function f() { var term = true; try { while (true) { if (term) terminate(); term = false; } print(not terminated.); } catch (err) {

Re: [v8-users] instanceof.

2014-10-08 Thread Jane Chen
Ben, I was able to get instanceof returning true following your tips. Thanks. But it seems to me this design assumes that there is only a singleton Function we are operating on as I'm always interacting with This, which is the function returned from FunctionTemplate.GetFunction(). If I

Re: [v8-users] instanceof.

2014-10-13 Thread Jane Chen
,createBuilder,builder); subTemp-Inherit(builderTemp); return args.GetReturnValue().Set(subTemp-GetFunction()); On Saturday, October 11, 2014 4:01:23 AM UTC-7, Ben Noordhuis wrote: On Fri, Oct 10, 2014 at 11:14 PM, Jane Chen jxch...@gmail.com javascript: wrote: One more try: In my constructor

Re: [v8-users] instanceof.

2014-10-14 Thread Jane Chen
Yes, that works. But every time the callback function is called, This() object is the same one. On Tuesday, October 14, 2014 6:03:30 AM UTC-7, Ben Noordhuis wrote: On Tue, Oct 14, 2014 at 7:20 AM, Jane Chen jxch...@gmail.com javascript: wrote: If I don't set return value, and only

Re: [v8-users] instanceof.

2014-10-14 Thread Jane Chen
Please ignore my last post. Things are working for me now. Thanks a lot for your support Ben! Jane On Tuesday, October 14, 2014 6:03:30 AM UTC-7, Ben Noordhuis wrote: On Tue, Oct 14, 2014 at 7:20 AM, Jane Chen jxch...@gmail.com javascript: wrote: If I don't set return value

[v8-users] v8 crashes with toString overridden using FunctionTemplate.

2014-10-21 Thread Jane Chen
I'm using 3.24. I create a FunctionTemplate with my own callback function for toString: v8::Localv8::FunctionTemplate result = v8::FunctionTemplate::New(isolate,valueCstor); result-SetClassName(className); result-InstanceTemplate()-SetInternalFieldCount(VALUE_TEMP_ID_COUNT); *

[v8-users] Garbage collection for objects returned from generators.

2014-12-24 Thread Jane Chen
I have a program embedding v8 3.24, with iterators and generators enabled. After the following JavaScript code runs, garbage collection is run, but the wrapped objects returned from gen() do not get a callback: function* gen(limit){ for (var i = 0; i limit; i++) yield wrap(new Date()); }

[v8-users] Re: Correct use of V8::TerminateExecution(isolate)

2014-12-31 Thread Jane Chen
I'm also interested to know what the contract is. Is checking empty handle enough or whether I need to check both against empty handles and isTerminating? Once TerminateExecution is called, which v8 APIs are supposed to continue to work, which aren't? On Friday, December 26, 2014 2:41:32 PM

Re: [v8-users] How to handle out-of-memory type of errors.

2015-01-15 Thread Jane Chen
it extensively though. If anyone knows of other scenarios, please share. Jane On Thursday, January 15, 2015 at 3:21:01 AM UTC-8, Ben Noordhuis wrote: On Thu, Jan 15, 2015 at 7:37 AM, Jane Chen jxch...@gmail.com javascript: wrote: I'm embedding v8 3.24 in my system. When running this query

Re: [v8-users] How to handle out-of-memory type of errors.

2015-01-15 Thread Jane Chen
UTC-8, Jane Chen wrote: Ben, Thanks. That actually worked for my test case. Except that my callback is only called once with an apparent size of 1GB. So no need to tally. That's my only chance to call TerminateExecution before it aborts. At least that's what I saw on Linux with v3.24

Re: [v8-users] How to handle out-of-memory type of errors.

2015-01-17 Thread Jane Chen
. If anyone has more insights or experience dealing with it, I'd appreciate it if you can share them here. On Thursday, January 15, 2015 at 2:32:30 PM UTC-8, Jane Chen wrote: Here's the trace_gc log: [13997] 258 ms: Scavenge 2.3 (39.2) - 1.9 (39.2) MB, 8.4 ms [Runtime::PerformGC]. [13997

[v8-users] PersistentBase::MarkIndependent()

2015-04-17 Thread Jane Chen
On v8 3.24: /** * 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 should not assume that it will be preceded by a global * GC prologue callback or followed by

Re: [v8-users] Function templates and object templates in custom start-up snapshot.

2015-06-05 Thread Jane Chen
. Does that sound more promising? And is that what V8::CreateSnapshotDataBlob enables? On Thursday, June 4, 2015 at 4:40:02 AM UTC-7, Ben Noordhuis wrote: On Wed, Jun 3, 2015 at 5:06 PM, Jane Chen jxch...@gmail.com javascript: wrote: Ben, My question is, say if I have a function Print

Re: [v8-users] Function templates and object templates in custom start-up snapshot.

2015-06-06 Thread Jane Chen
Ben, The SetAccessor() idea was great. It helped cut the context creation time significantly. Thanks again! On Wednesday, June 3, 2015 at 4:06:39 AM UTC-7, Ben Noordhuis wrote: On Wed, Jun 3, 2015 at 7:11 AM, Jane Chen jxch...@gmail.com javascript: wrote: I have global variables

Re: [v8-users] Function templates and object templates in custom start-up snapshot.

2015-06-03 Thread Jane Chen
in that snapshot? Jane On Wednesday, June 3, 2015 at 4:06:39 AM UTC-7, Ben Noordhuis wrote: On Wed, Jun 3, 2015 at 7:11 AM, Jane Chen jxch...@gmail.com javascript: wrote: I have global variables and global functions exposed through object templates and function templates, which slows down

[v8-users] CpuProfile serialization API.

2015-06-24 Thread Jane Chen
Is there serialization API for v8 CpuProfile? I'd like to generate a file such as v8.log using --prof in my embedding application at the granularity of a JavaScript request. What's the correct way of doing that? My v8 version is 3.24. -- -- v8-users mailing list v8-users@googlegroups.com

Re: [v8-users] CpuProfile serialization API.

2015-06-24 Thread Jane Chen
, Jun 24, 2015 at 12:36 PM, Jane Chen jxch...@gmail.com javascript: wrote: Is there serialization API for v8 CpuProfile? I'd like to generate a file such as v8.log using --prof in my embedding application at the granularity of a JavaScript request. What's the correct way of doing

[v8-users] How to turn off profiling.

2015-06-24 Thread Jane Chen
Embedding v8 3.24. I know how to turn on profiling using v8::V8::SetFlagsFromString(--prof,6). How do I turn it off when done? -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google

[v8-users] Function templates and object templates in custom start-up snapshot.

2015-06-02 Thread Jane Chen
I have global variables and global functions exposed through object templates and function templates, which slows down context creation. I wonder whether I could still leverage the custom snapshot feature to speed up context creation with any of the following two approaches: 1) With the

[v8-users] Function names in CpuProfileNode.

2015-10-29 Thread Jane Chen
Testing profiling against v8 4.6.88. I have functions that are exposed through accessor callbacks. If a native function is set for multiple accessor properties, the last property shows up as the function name in the CpuProfileNode, regardless what name you set to the function returned by the

[v8-users] Re: Function names in CpuProfileNode.

2015-10-29 Thread Jane Chen
A test case to demonstrate the issue can be found at: https://code.google.com/p/v8/issues/detail?id=4527 On Thursday, October 29, 2015 at 3:46:21 PM UTC-7, Jane Chen wrote: > > Testing profiling against v8 4.6.88. > > I have functions that are exposed through accessor callbacks.

Re: [v8-users] Help about javaScript debug on v8

2015-11-12 Thread Jane Chen
Ben, In v8 4.6.88, I can no longer find src/debug-debugger.js, nor src/{liveedit,mirror}-debugger.js. Does it mean that the function-based API is also deprecated and removed? Jane On Saturday, March 14, 2015 at 3:53:55 AM UTC-7, Ben Noordhuis wrote: > > On Sat, Mar 14, 2015 at 8:30 AM, Deguo

Re: [v8-users] Is there any up-to-date documentation on how to use v8::Debug

2015-11-11 Thread Jane Chen
to the embedder so it is easier to do "spot > consulting'. > > What are you planning to do? > > On Monday, November 9, 2015 at 11:58:14 PM UTC+1, Jane Chen wrote: >> >> Just went to this link: >> >> https://chromium.googlesource.com/v8/v8/+/master/docs/de

Re: [v8-users] Is there any up-to-date documentation on how to use v8::Debug

2015-11-09 Thread Jane Chen
Just went to this link: https://chromium.googlesource.com/v8/v8/+/master/docs/debugger_protocol.md and found that "*The message based API is no longer maintained.*" Does that mean that users (or embedders) should no longer use the message based API since it is no longer supported? On

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-30 Thread Jane Chen
he point is that for a single function, it can only infer a single > name. > > I think this is working as intended. > > On Thu, Oct 29, 2015 at 11:57 PM, Jane Chen <jxch...@gmail.com > > wrote: > >> A test case to demonstrate the issue can be found at: >> >>

[v8-users] How to advance an iterator.

2015-11-03 Thread Jane Chen
With the change of behavior in Iterator discussed here: https://groups.google.com/forum/#!topic/v8-users/8LkrofVr0aA If I have an iterator (natively defined) which supports for ... of loop, what is the equivalent of calling next to advance it? I hope the following js example demonstrates what

Re: [v8-users] How to advance an iterator.

2015-11-03 Thread Jane Chen
4.6.88. Just tried it in v8 shell. myIterable[Symbol.iterator].next is undefined. On Tuesday, November 3, 2015 at 3:40:07 PM UTC-8, Ben Noordhuis wrote: > > On Wed, Nov 4, 2015 at 12:17 AM, Jane Chen <jxch...@gmail.com > > wrote: > > With the change of behavior in It

Re: [v8-users] How to advance an iterator.

2015-11-03 Thread Jane Chen
t; http://tc39.github.io/ecma262/#sec-getiterator > > On Tue, Nov 3, 2015 at 5:45 PM, Jane Chen <jxch...@gmail.com > > wrote: > >> 4.6.88. Just tried it in v8 shell. myIterable[Symbol.iterator].next is >> undefined. >> >> On Tuesday, November 3, 2015 at

Re: [v8-users] Object.ForceSet to bypass accessors.

2015-10-30 Thread Jane Chen
> > On Tue, Oct 6, 2015, 21:57 Jakob Kummerow <jkum...@chromium.org > > wrote: > >> Have you checked bit.ly/v8-api-changes ? >> >> On Tue, Oct 6, 2015 at 8:44 PM, Jane Chen <jxch...@gmail.com >> > wrote: >> >>> In v8 4.7.0, Object.ForceSet

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Jane Chen
> accessor. But I assume you're doing that? > > On Friday, October 30, 2015 at 3:03:27 PM UTC-7, Jane Chen wrote: >> >> Is there anyway to use something like CreateDataProperty to override the >> accessor so that the actual function is associated with the property, &

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Jane Chen
ntiation > would make perfect sense. > > On Saturday, October 31, 2015 at 11:03:10 AM UTC-7, Jane Chen wrote: >> >> Yes, the first time the property is accessed, it gets the correct native >> function. In my accessor before I return, I have: >> >

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Jane Chen
stuff like dynamically loading the functions or maybe compiling JavaScript > callbacks with your function or whatever, in which case lazy instantiation > would make perfect sense. > > On Saturday, October 31, 2015 at 11:03:10 AM UTC-7, Jane Chen wrote: >> >> Yes, the first time th

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Jane Chen
rty produced behavior similar to what you're seeing -- my > accessor was entered repeatedly. > > Is ForceSet just silently failing for you? Is it returning false? > > On Saturday, October 31, 2015 at 4:11:22 PM UTC-7, Jane Chen wrote: >> >> ForceSet worked in 3.24.

[v8-users] Iterator for ... of loop behavior change?

2015-10-07 Thread Jane Chen
I'm seeing a behavior change regarding the above between version 3.24 and 4.7.0: [jchen@jchen-z620 x64.release]$ ./shell --harmony V8 version 3.24.35.33 [sample shell] > var it = {next: function() { return {value:"foo", done:true}; }}; > for (var k of it) print(k); > [jchen@jchen-z620

[v8-users] Cached persistent handle seemingly gets reset.

2015-10-15 Thread Jane Chen
Embedding v8 3.24. Running stress tests with 30 concurrent threads serving JavaScript requests on one node. Got a segmentation fault in the 23rd hour of the run at this line: v8.h 5546: template Local Local::New(Isolate* isolate, const PersistentBase& that) { return New(isolate,

[v8-users] Object.ForceSet to bypass accessors.

2015-10-06 Thread Jane Chen
In v8 4.7.0, Object.ForceSet is deprecated. What is the new recommended way of bypassing accessors? The use case I have is that I lazily create global objects and functions using accessors. Once it is created, I want to reset the accessor and force save the created objects on Global.

[v8-users] v8 shell crashes with Fatal error in v8::ToLocalChecked Empty MaybeLocal.

2015-10-05 Thread Jane Chen
[jchen@jchen-z620 x64.release]$ ./shell V8 version 4.7.0 (candidate) [sample shell] > read(); (shell):1: Bad parameters read(); ^ # # Fatal error in v8::ToLocalChecked # Empty MaybeLocal. # Illegal instruction (core dumped) This is with a build made with either: make -j8 x64.debug -werror=no

Re: [v8-users] v8::platform::PumpMessageLoop().

2015-10-13 Thread Jane Chen
> best > -jochen > > On Tue, Oct 13, 2015 at 6:41 AM Jane Chen <jxch...@gmail.com > > wrote: > >> Looking at v8 4.7.0, both shell.cc and d8.cc calls: >> >> while (v8::platform::PumpMessageLoop(platform, isolate)) continue; >> >> after

[v8-users] v8::platform::PumpMessageLoop().

2015-10-12 Thread Jane Chen
Looking at v8 4.7.0, both shell.cc and d8.cc calls: while (v8::platform::PumpMessageLoop(platform, isolate)) continue; after running a script. What's the purpose of this? As always, thanks in advance. -- -- v8-users mailing list v8-users@googlegroups.com

[v8-users] Generator test.

2015-08-27 Thread Jane Chen
Embedding v8 3.24. Is there any API to test whether a v8 object is a generator? I tried GetConstructorName(), or GetConstructor(), then GetName(), neither gives me GeneratorFunctionPropotype which I got in JavaScript using g().constructor.name. The best I seem to get is ObjectProtoToString()

Re: [v8-users] Generator test.

2015-08-28 Thread Jane Chen
Is there a v8 c++ API to achieve this? On Friday, August 28, 2015 at 2:17:29 AM UTC-7, Andy Wingo wrote: On Fri 28 Aug 2015 07:05, Jane Chen jxch...@gmail.com javascript: writes: Embedding v8 3.24. Is there any API to test whether a v8 object is a generator? I tried

  1   2   >