Re: [v8-users] Running instanceof from C++ given a class name as a string

2018-06-21 Thread Gonzalo Diethelm
This works perfectly. I knew I was being naive, thank you Jakob for pointing me in the right direction! On Thursday, June 21, 2018 at 11:28:51 PM UTC+2, Jakob Kummerow wrote: > > Well, if you're creating a new FunctionTemplate, then of course your > existing "car" object isn't an instance of

Re: [v8-users] Re: Finding cycles in an object

2018-06-21 Thread Gonzalo Diethelm
Jakob, you rule. That in fact fixed all my problems. Thanks to you and Zac for all the guidance! On Thursday, June 21, 2018 at 11:12:24 PM UTC+2, Jakob Kummerow wrote: > > The Local class defines an operator == that should do exactly what you > need. > > On Thu, Jun 21, 2018 at 5:43 AM Gonzalo

[v8-users] Re: how to debug torque

2018-06-21 Thread cyril
I just want to debug the code in ".tq" file or the code which is created by torque 在 2018年6月22日星期五 UTC+8上午11:34:30,cyril写道: > > Recently, I discovered that v8 has added a module named torque. Anyone > know how to debug it ?? > -- -- v8-users mailing list v8-users@googlegroups.com

[v8-users] git cl upload failing

2018-06-21 Thread 'Brian Stell' via v8-users
I've been using git to submit changes for review for a while. Now when I run 'git cl upload' it fails with the following message. bstell@bstell:$ git cl upload Running presubmit upload checks ... Done processing /usr/local/google/home/bstell/v8/v8/src/objects/intl-objects.cc Total errors found:

[v8-users] Re: how to debug torque

2018-06-21 Thread Zac Hansen
That's not a very detailed question. What is insufficient with the usual tools? On Thursday, June 21, 2018 at 8:34:30 PM UTC-7, cyril wrote: > > Recently, I discovered that v8 has added a module named torque. Anyone > know how to debug it ?? > -- -- v8-users mailing list

[v8-users] how to debug torque

2018-06-21 Thread cyril
Recently, I discovered that v8 has added a module named torque. Anyone know how to debug it ?? -- -- 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

Re: [v8-users] How Date.now() function value is returned (Is it from kernel of v8 engine has its own implementation)

2018-06-21 Thread Abhishek Kanike
​Yes gin has its own implementation of time apart from default-platform. I have one more concern. How can i implement my own javascript API? Basically I am thinking to create two javascript API which calls two respective calls from my shared library (external)​. Instead of creating two new api's

Re: [v8-users] Re: Where are let / const objects stored?

2018-06-21 Thread Jakob Kummerow
Variable allocation is complicated. In short, Function-local variables are allocated on the stack. When nested closures refer to them, they get allocated in a Context object. On Thu, Jun 21, 2018 at 12:15 AM Zac Hansen wrote: > I don't know the answer, but they are accessible via the debugging

Re: [v8-users] Re: Finding cycles in an object

2018-06-21 Thread Jakob Kummerow
The Local class defines an operator == that should do exactly what you need. On Thu, Jun 21, 2018 at 5:43 AM Gonzalo Diethelm wrote: > Sure, slot does have a value, I just didn't include it in the code. > Something like: > > Local slot = String::NewFromUtf8(isolate, "MyBeautifulSlot", >

Re: [v8-users] How Date.now() function value is returned (Is it from kernel of v8 engine has its own implementation)

2018-06-21 Thread Jakob Kummerow
gin provides its own v8::Platform implementation, overriding the default platform. On Thu, Jun 21, 2018 at 9:55 AM Abhishek Kanike wrote: > Hi Jakob and v8-users,​​ > I have following observations on printing logs in v8 and date.now call > trace. > >1. *Logs in v8:* > >*printf* and

Re: [v8-users] How Date.now() function value is returned (Is it from kernel of v8 engine has its own implementation)

2018-06-21 Thread Abhishek Kanike
Hi Jakob and v8-users,​​ I have following observations on printing logs in v8 and date.now call trace. 1. *Logs in v8:* *printf* and *std::cout* were not outputting any logs in adb logcat. I ​tried redirecting stdio logs to logcat by following commands - $ adb shell stop$ adb shell

[v8-users] Re: Finding cycles in an object

2018-06-21 Thread Gonzalo Diethelm
Sure, slot does have a value, I just didn't include it in the code. Something like: Local slot = String::NewFromUtf8(isolate, "MyBeautifulSlot", NewStringType::kNormal).ToLocalChecked(); Cheers! On Thursday, June 21, 2018 at 2:27:00 PM UTC+2, Zac Hansen wrote: > > You're dereferencing a

[v8-users] Re: Finding cycles in an object

2018-06-21 Thread Zac Hansen
You're dereferencing a "super pointer" to get to a "pointer", hence * not &. You can't "go back" because the local/global represents an "reference count" to the object which must be known to the JS runtime. As for p0 and p1, have you tried setting slot to a fixed string value before using

[v8-users] Re: Finding cycles in an object

2018-06-21 Thread Gonzalo Diethelm
Note to self: this might be related to Local vs Global (or Persistent? so many names...) Need to look into that. On Thursday, June 21, 2018 at 7:58:37 AM UTC+2, Gonzalo Diethelm wrote: > > I run the following JS code in the Chrome console: > > // Version 67.0.3396.87 (Official Build) (64-bit) >

[v8-users] Re: Finding cycles in an object

2018-06-21 Thread Gonzalo Diethelm
Never mind my last question, it didn't really make much sense. So, I have found some basic behaviour related to this, which really surprised me: Local parent; // this will be a JS object Local slot;// this will be a new slot in parent Local object = // this will be the value we want to

[v8-users] Re: Finding cycles in an object

2018-06-21 Thread Gonzalo Diethelm
Thanks, that is useful (not sure why it is unary * instead of unary &, but meh). Do you know if there is any way to then go from the T* back into the Local? Something like: Handle object = Object::New(isolate); Local ret = Local::Cast(object); Object* ptr = *object; // this works, according to

[v8-users] Re: Finding cycles in an object

2018-06-21 Thread Zac Hansen
unary * on a local gives a T*: https://v8.paulfryzel.com/docs/master/classv8_1_1_local.html#a3c96c0bc5db1288bad5769e8e54e26da On Wednesday, June 20, 2018 at 10:58:37 PM UTC-7, Gonzalo Diethelm wrote: > > I run the following JS code in the Chrome console: > > // Version 67.0.3396.87 (Official

[v8-users] v8 link error when generate cctest.exe

2018-06-21 Thread Amaranth F
I use this parameter to generate the ninja project: gn gen out/Release "--args=is_debug=false target_cpu=\"x64\" v8_static_library=true v8_use_snapshot=true v8_use_external_startup_data=false" and then run: ninja -C out\Release when it finally says: ninja: Entering directory `out\Release'

[v8-users] Where are let / const objects stored?

2018-06-21 Thread Gonzalo Diethelm
I run the following JS code in the Chrome console: // Version 67.0.3396.87 (Official Build) (64-bit) var p = 11 p // returns 11 let q = 12 q // returns 12 const r = 13 r // returns 13 Now, from C++ code, I can look up p in the global context, and it is found; its value is, unsurprisingly,

[v8-users] Running instanceof from C++ given a class name as a string

2018-06-21 Thread Gonzalo Diethelm
I run the following JS code in the Chrome console: // Version 67.0.3396.87 (Official Build) (64-bit) function Car(make) { this.make = make } var car = new Car('Ferrari') car instanceof Car // returns true Now, on my C++ code I get ahold of car (by looking "car" up in the global context), and