[v8-users] Re: When is SetSecondPassCallback need to be called?

2018-07-26 Thread fengxingren
Thanks for your reply. But I can't find any other conversations by searching with keywords such like "SetSecondPassCallback", "phantom handles". If two Persistent handles refer to the same v8 object, weak callback will be called twice. So wrappable object will be double-deleted either using

Re: [v8-users] where is the implementation of ObjectTemplate constructor?

2018-07-23 Thread fengxingren
Thanks. So the heap object 's "member data" are initialized by READ_FILEDS macro which directly read by offset. 在 2018年7月21日星期六 UTC+8上午1:36:42,Jakob Kummerow写道: > > ObjectTemplate has no constructor (because it lives on the managed heap, > where C++ constructors don't make sense). Declaring a

[v8-users] When is SetSecondPassCallback need to be called?

2018-07-23 Thread fengxingren
Hi, I noticed that chromium's sourcecode src/gin/wrappable.cc use SetSecondPassCallback to make wrappable object deleted, while node.js does not. So when is SetSecondPassCallback need to be used? what's the purpose of this api? I also find a related link

[v8-users] where is the implementation of ObjectTemplate constructor?

2018-07-20 Thread fengxingren
Hi, ObjectTemplate is declared in v8.h, and it's constructor was declared as private. But where is the implementation of it's constructor? I can't find it's source code. -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this

Re: [v8-users] what is the relationship between natives_blob.bin and snapshot_blob.bin?

2018-07-17 Thread fengxingren
Thanks for your kindly reply. What do you mean "Js natives"? Are they some c++ native functions written in c++ on which v8's build-in js source codes depend? I noticed that "v8_use_external_startup_data" is only used when " v8_use_snapshot=true". So I thought "v8_use_external_startup_data"

[v8-users] Re: Cached data or startup snapshot?

2018-07-17 Thread fengxingren
So what is the result? Have you found the reason that cause code executing slower? 在 2018年2月23日星期五 UTC+8下午6:59:58,Alexandru Dima写道: > > Hi Yang, > > I have spent quite some time to create a repro that executes the exact > same code in the exact same state, once with the code loaded from cached

[v8-users] what is the relationship between natives_blob.bin and snapshot_blob.bin?

2018-07-12 Thread fengxingren
when v8 is compiled with options "v8_use_snapshot=true v8_use_external_startup_data=true", two files which are natives_blob.bin and snapshot_blob.bin will be generated. when we use v8 in our embedder progroam, *V8::InitializeExternalStartupData *need be called to load the two files. After

[v8-users] enviroment.x64 contains two versions of windows sdk

2018-06-19 Thread fengxingren
Hi everyone, I tried to compile v8 v6.4 on windows 7 following the instructions in https://github.com/v8/v8/wiki/Building-with-GN, and got LNK error 1104 "can not open advapi32.lib". I installed vs2015 and multiple versions of windows sdk which are 10.0.10150.0, 10.0.10240.0, 10.0.10586.0,

Re: [v8-users] why can't SetSecurityToken control cross access?

2018-06-07 Thread fengxingren
I think I can understand it a bit. Look at the following test case. THREADED_TEST(SecurityChecks) { LocalContext env1; v8::HandleScope handle_scope(env1->GetIsolate()); v8::Local env2 = Context::New(env1->GetIsolate()); Local foo = v8_str("foo"); Local bar = v8_str("bar");

Re: [v8-users] why can't SetSecurityToken control cross access?

2018-06-01 Thread fengxingren
But I called SetSecurityToken to set different token for each context. I commented out the SetAccessCheckCallback calls to let access to be controlled only by SetSecurityToken. Even if I add "SetAccessCheckCallback(AccessAlwaysBlocked);" statement, the cross access are still allowed in

Re: [v8-users] why can't SetSecurityToken control cross access?

2018-05-30 Thread fengxingren
ur... I still can not get it. In the following modification, I changed object x by scripts. *Modification Three:* TEST(EvalInAccessCheckedContext) { v8::Isolate* isolate = CcTest::isolate(); v8::HandleScope scope(isolate); v8::Local obj_template = v8::ObjectTemplate::New(isolate);

Re: [v8-users] why can't SetSecurityToken control cross access?

2018-05-30 Thread fengxingren
Great explaination! I just can not get this point before. The fact that some tasks can usually be done by both c++ and js code makes me confuse the c++ and js worlds. 在 2018年5月30日星期三 UTC+8下午6:51:34,Ben Noordhuis写道: > > On Wed, May 30, 2018 at 12:41 PM, > > wrote: > > thanks. But in

Re: [v8-users] why can't SetSecurityToken control cross access?

2018-05-30 Thread fengxingren
thanks. But in Modification Two, I changed object x 's property a in a different context successfully. is this fulfilled "Access checks are invoked when trying to access objects" condition? 在 2018年5月30日星期三 UTC+8下午5:32:55,Ben Noordhuis写道: > > On Wed, May 30, 2018 at 9:32 AM, > > wrote: > > I

[v8-users] why can't SetSecurityToken control cross access?

2018-05-30 Thread fengxingren
I try to understand SetSecurityToken's function. So I modified EvalInAccessCheckedContext test case in test-api.cc which is included in v8 sourcecode. Follow is my modification. Modification One: TEST(EvalInAccessCheckedContext) { v8::Isolate* isolate = CcTest::isolate(); v8::HandleScope