Re: [v8-users] Why does CompileUnbound require a context?

2017-01-30 Thread tblodt
I discovered there's at least one more thing that CompileUnbound does with the current context. There's a call to isolate->debug()->OnAfterCompile() in Compiler::GetFunctionFromEval, which sends the Debugger.scriptParsed event--if the current context is being debugged. If the current context is

[v8-users] Minimal example of the v8-inspector c++ api

2017-01-27 Thread tblodt
I've been trying to use the v8-inspector C++ api in my app, but it doesn't seem to be working. I have a feeling I'm probably misunderstanding something simple due to the lack of documentation and comments in v8-inspector.h. Could someone create a minimal example of using the v8-inspector c++

[v8-users] Re: C++ object prototype still not working

2017-01-07 Thread tblodt
I've got a V8 library on github that isn't abandoned: https://github.com/tbodt/v8py. I've gotten pretty much everything to work with it. It's a Python extension module, though... Hope this helps. ~Theodore On Wednesday, December 21, 2016 at 9:33:02 AM UTC-8, kent williams wrote: > > I think

[v8-users] Why does CompileUnbound require a context?

2017-01-07 Thread tblodt
I'd like to compile a script without any context active or present. When I tried to use CompileUnbound, it crashed because there was no current context. Is there some way I can do this? ~Theodore -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users

[v8-users] Re: Good SIMPLE v8 C++ wrapping example?

2016-12-23 Thread tblodt
SetPrototype and Set can fail, so they return optionals. FromJust asserts that the optional is not empty (and crashes the program if it is empty). On Monday, December 19, 2016 at 10:18:31 AM UTC-8, kent williams wrote: > > That example has some weird: > Line 11341: > >

[v8-users] Re: What is required for the JS Environment to persist across script evaluations?

2016-12-03 Thread tblodt
Basically, you create a context and then run multiple scripts in the same context. ~Theodore -- -- 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 Groups "v8-users" group. To

[v8-users] Re: Missing symbol ___asan_version_mismatch_check_v8

2016-12-01 Thread tblodt
That didn't work. V8 insisted on linking with the asan runtime included with it's special version of clang, so mkpeephole wouldn't run because it couldn't find ___asan_version_mismatch_check_apple_800. I'm going to try playing with the executable path. -- -- v8-users mailing list

[v8-users] Re: Missing symbol ___asan_version_mismatch_check_v8

2016-12-01 Thread tblodt
Well, I looked a little more closely at the compiler options and discovered that my library is not, in fact, getting compiled with ASAN. Only V8 is. Now the problem is that if I compile the library with the same compiler as V8, it can't find @executable_path/libclang_rt.asan_osx_dynamic.dylib,

[v8-users] Re: Missing symbol ___asan_version_mismatch_check_v8

2016-12-01 Thread tblodt
I just tried compiling my library with the same prebuilt compiler used for v8 (third_party/llvm-build/Release+Asserts/bin/clang), and it still didn't work. -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you

[v8-users] Re: Missing symbol ___asan_version_mismatch_check_v8

2016-12-01 Thread tblodt
Also, d8 loads fine. -- -- 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 Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email

[v8-users] Missing symbol ___asan_version_mismatch_check_v8

2016-12-01 Thread tblodt
I'm trying to build both V8 and my library that embeds with the address sanitizer, and I'm getting this error when trying to load my library: dlopen(v8py.so, 2): Symbol not found: ___asan_version_mismatch_check_v8 Referenced from: v8py.so Expected in: flat namespace in v8py.so What's going

[v8-users] Re: eval in current C++ scope

2016-11-25 Thread tblodt
A HandleScope does not store any key-value pairs. It sounds like what you need is to create multiple Contexts. If that's not quite what you want, I'd suggest creating objects using Object::New and using them as the receiver in CompileFunctionInContext. ~Theodore On Wednesday, November 23,

[v8-users] InternalFieldCount seems to be ignored when ConstructorBehavior is kThrow

2016-11-25 Thread tblodt
When I set the constructor behavior on my FunctionTemplate to kThrow (instead of the default kAllow), then create an object from the template using InstanceTemplate()->NewInstance(), it seems like the InternalFieldCount on the InstanceTemplate is ignored, and the object that gets created has 0

[v8-users] How to set the class name of the global object

2016-11-23 Thread tblodt
I'm trying to get behavior similar to that of the global object in a Chrome JavaScript context through the V8 API. I've created a FunctionTemplate, called SetClassName on the template, set various properties on its PrototypeTemplate and InstanceTemplate, and then used the InstanceTemplate to

[v8-users] Re: Per-isolate FunctionTemplate cache

2016-11-21 Thread tblodt
Here's what Jochen originally said: v8 has an per-isolate cache of function templates. As the string is > referenced by the function template, it will never go out of scope. > I'd recommend to create a weak handle to the function you create via > GetFunction() instead

[v8-users] What's the correct way to build V8 as a static library on macOS?

2016-11-20 Thread tblodt
I tried building with GN, but I was not able to get it to generate any lib*.a files. So that didn't work for me. I'm currently building with Gyp, but my build doesn't seem to have snapshot support enabled. There is a libv8_nosnapshot.a file, but no libv8.a file. What's the officially correct

Re: [v8-users] Setting an execution limit

2016-11-20 Thread tblodt
I don't think there's any way. V8 JavaScript code is compiled to native code, and no instrumentation is really possible on that. On Sunday, November 20, 2016 at 10:18:24 AM UTC-8, James Lovejoy wrote: > > Really I need something a little more deterministic than a time limit. Is > there a way to

[v8-users] Per-isolate FunctionTemplate cache

2016-11-20 Thread tblodt
Jochen Eisinger said that "v8 has an per-isolate cache of function templates". I have a few questions about this cache: If I create multiple FunctionTemplates with different callback data but the same callback function and everything else, does it only create one function template and use the

Re: [v8-users] Re: Weak callback for function callback data never getting called

2016-10-05 Thread tblodt
Actually, that didn't work. Any other ideas? Any techniques for debugging GC (like getting information on where an object is referenced?) -- -- 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] Re: Weak callback for function callback data never getting called

2016-10-05 Thread tblodt
Why didn't I think of that? Put a(mother) handle scope inside the for loop > Also, autocorrect failure ^ -- -- 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 Groups

Re: [v8-users] Re: Weak callback for function callback data never getting called

2016-10-05 Thread tblodt
Thanks for all your feedback. I tried attaching the weak callback to the function instead of the callback data, and I tried a tight loop with AdjustAmountOfExternalAllocatedMemory. But the weak callback still isn't getting called. Here's the updated main function: int main() {

[v8-users] Weak callback for function callback data never getting called

2016-10-02 Thread tblodt
I'm using FunctionTemplate to create a function that has callback data, and I want to get a callback when the function is no longer reachable from Javascript so I can do some cleanup associated with the callback data. I'm trying to do this with a weak reference callback, but I'm having some

[v8-users] What's the difference between v8::Global and v8::Persistent?

2016-10-01 Thread tblodt
The documentation comments say Persistent "allows copy and assignment", and Global has "move semantics". What exactly does that mean? Thanks ~Theodore -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are

[v8-users] Re: Memory management for Functions

2016-10-01 Thread tblodt
In this example, the Persistent is allocated on the stack. If I want the callback to keep working after the Persistent goes out of scope, would I have to allocate it on the heap? Would I then have to delete the Persistent in the callback? ~Theodore On Tuesday, March 15, 2016 at 11:12:23 AM

[v8-users] Re: PersistentBase::MarkIndependent()

2016-09-30 Thread tblodt
Anybody know the answer to this? (bump) On Friday, April 17, 2015 at 12:19:05 PM UTC-7, Jane Chen wrote: > > 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