[v8-users] Current V8 requires MacOS 10.12? Cannot build on 10.11

2017-09-05 Thread Zac Hansen
trying to build: 1aead19c276a9679723ecd7c0cfd2f7c1c94a53d

I run

 tools/dev/v8gen.py -vv x64.release

and get:

  Traceback (most recent call last):
File "/Users/xaxxon/v8/build/mac/find_sdk.py", line 89, in 
  print main()
File "/Users/xaxxon/v8/build/mac/find_sdk.py", line 62, in main
  raise Exception('No %s+ SDK found' % min_sdk_version)
*  Exception: No 10.12+ SDK found*

I really don't want to upgrade from 10.11 - 10.12 loses a lot of features I 
rely on.

Thank you.

--Zac

-- 
-- 
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 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] How does V8 compiles and executes JavaScript events?

2017-09-05 Thread Jakob Kummerow
On Mon, Sep 4, 2017 at 4:07 PM, Hanyun Tao  wrote:

> Hi Jakob!
>
> I'm reading the Invoke(..) function you mentioned, and I believe the
> following part of the code plays an important role in executing the
> JavaScript but I cannot fully understand it.
>
>   typedef Object* (*JSEntryFunction)(Object* new_target, Object* target,
>  Object* receiver, int argc,
>  Object*** args);
>
>
>   Handle code = is_construct
>   ? isolate->factory()->js_construct_entry_code()
>   : isolate->factory()->js_entry_code();
>
>
>   {
> // Save and restore context around invocation and block the
> // allocation of handles without explicit handle scopes.
> SaveContext save(isolate);
> SealHandleScope shs(isolate);
> JSEntryFunction stub_entry = FUNCTION_CAST(code->
> entry());
>
>
> if (FLAG_clear_exceptions_on_js_entry) isolate->clear_pending_
> exception();
>
>
> // Call the function through the right JS entry stub.
> Object* orig_func = *new_target;
> Object* func = *target;
> Object* recv = *receiver;
> Object*** argv = reinterpret_cast(args);
> if (FLAG_profile_deserialization && target->IsJSFunction()) {
>   PrintDeserializedCodeInfo(Handle::cast(target));
> }
> RuntimeCallTimerScope timer(isolate, ::JS_Execution);
> value = CALL_GENERATED_CODE(isolate, stub_entry, orig_func, func, recv
> ,
> argc, argv);
>   }
>
>
> I could not find some good document to help me understand those data
> structures especially JSEntryFunction ,and Handle.  It would be
> really helpful if you can give me some document that talks about the
> definition of V8's basic data structures like Code.
>

Code:
https://cs.chromium.org/chromium/src/v8/src/objects.h?type=cs=class+code=package:chromium=3646
(as the name suggests, it's the kind of object V8 uses to store generated
code)
Handle:
https://cs.chromium.org/chromium/src/v8/src/handles.h?type=cs=class+Handle=package:chromium=92
(a GC safe pointer to a HeapObject)

Look around the code for more! :-)

For the functionality of the above code, here is my understanding (guess).
>
> The first part of the code defines a special type of object named
> JSEntryFunction.
>

That's a C++ typedef defining a particular (C++) function signature.

The next part of the code tries to obtain the executable code by calling
> isolate->factory()->js_entry_code();  , which might be the part that
> triggers the (re-)compilation or finds the existing compiled code.
>

No, it's the "stub" that handles calling into generated code. The function
being called is target, and as you can see, it is passed as an argument to
the call.
"Invoke" does not deal with compilation. As I wrote before:

> a v8::internal::JSFunction has a code() property. That's either the
> existing compiled code, or a stub that will trigger (re-)compilation based
> on the script() in the JSFunction's shared_function_info(). It will be
> retrieved and called by the JSEntryStub.

You've identified the place where the JSEntryStub is called. That stub will
look up the function's stored code and call it. This "code" could be
another stub that triggers compilation if needed.

The reset of the code executes the generated code.
>
> Could you please verify if my understanding is correct?
>
> Thanks a lot!
>
> On Thursday, August 31, 2017 at 3:36:53 PM UTC-4, Jakob Kummerow wrote:
>>
>> A v8::Function maps to a v8::internal::JSFunction, which has a code()
>> property. That's either the existing compiled code, or a stub that will
>> trigger (re-)compilation based on the script() in the JSFunction's
>> shared_function_info(). It will be retrieved and called by the
>> JSEntryStub.
>>
>> You might want to put your instrumentation into Invoke(...) in
>> execution.cc.
>>
>> On Thu, Aug 31, 2017 at 11:56 AM, Hanyun Tao  wrote:
>>
>>> Hi Jakob,
>>>
>>> Thank you for answering my questions!
>>>
>>> I would like to modify V8's internals to support such functionality. But
>>> before I start I would like to learn a little more about how chromium
>>> interact with V8 to process JavaScript event.
>>>
>>> By reading the source code, I believe that the WebKit rendering engine
>>> will call *v8::Function::Call* in api.cc, and after that the V8 engine
>>> will execute the Javascript code. Am I correct?
>>>
>>> If this is how things going to work, could you please point out where in
>>> this process, V8 compiles the code, or "read" the compiled code correspond
>>> to the JavaScript?
>>>
>>> Thank you!
>>>
>>> On Wednesday, August 30, 2017 at 8:39:00 PM UTC-4, Jakob Kummerow wrote:

 Object addresses are not exposed either. You would have to build such
 instrumentation into V8's internals.

 On Tue, Aug 29, 2017 at 12:32 PM, Hanyun Tao 
 wrote:

> Thank you Jakob!
>
> I can understand why it is 

Re: [v8-users] Re: V8 snapshots

2017-09-05 Thread Zac Hansen
That kind of error usually means you either haven't created a context or
aren't in a context or haven't created an appropriate handle.  Or...
Something else :-/. Maybe a lock?  V8 errors are very much a "you screwed
up somewhere" notification and often nothing more

On Tue, Sep 5, 2017 at 9:42 AM Francisco Moraes 
wrote:

> I will give it a try sometime this week. I tried to remove our
> initialization JS file but that caused a failure further down the
> serialization as well, so still investigating.
>
>
> On Saturday, September 2, 2017 at 1:07:28 AM UTC-4, Zac Hansen wrote:
>>
>> Can you post a minimal complete example that reproduces your problem?
>>
>> On Friday, September 1, 2017 at 8:57:51 AM UTC-7, Francisco Moraes wrote:
>>>
>>> Hello,
>>>
>>> I am trying to create a snapshot that includes most of code but I ran
>>> into the following assertion:
>>>
>>>   CHECK(isolate->handle_scope_implementer()->blocks()->is_empty());
>>>
>>> Any clarifications about what would generate it that our JS code is
>>> doing and is not legal? I found that creating Unsafe Arrays is also not
>>> permitted but that is relatively easy to work around.
>>>
>>> Francisco
>>>
>> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "v8-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/v8-users/kxtnaSSQL9c/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
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 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Why element kind transition can't cause the cache to miss

2017-09-05 Thread Jakob Kummerow
What cache are you talking about?

Different elements kinds do cause inline cache misses.

On Tue, Sep 5, 2017 at 3:08 AM, cyril  wrote:

> Hi all,
>
> Why element kind transition can't cause the cache to miss?
>
>
> --
> --
> 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 to v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
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 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Re: V8 snapshots

2017-09-05 Thread Francisco Moraes
I will give it a try sometime this week. I tried to remove our 
initialization JS file but that caused a failure further down the 
serialization as well, so still investigating.


On Saturday, September 2, 2017 at 1:07:28 AM UTC-4, Zac Hansen wrote:
>
> Can you post a minimal complete example that reproduces your problem?
>
> On Friday, September 1, 2017 at 8:57:51 AM UTC-7, Francisco Moraes wrote:
>>
>> Hello,
>>
>> I am trying to create a snapshot that includes most of code but I ran 
>> into the following assertion:
>>
>>   CHECK(isolate->handle_scope_implementer()->blocks()->is_empty());
>>
>> Any clarifications about what would generate it that our JS code is doing 
>> and is not legal? I found that creating Unsafe Arrays is also not permitted 
>> but that is relatively easy to work around.
>>
>> Francisco
>>
>

-- 
-- 
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 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Why element kind transition can't cause the cache to miss

2017-09-05 Thread cyril
Hi all,

Why element kind transition can't cause the cache to miss? 


-- 
-- 
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 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Re: Destructing mismatch return of a function raises an invalid Error

2017-09-05 Thread Afshin Mehrabani
Oh nice! 

Thanks for the update. 

On Monday, September 4, 2017 at 5:14:12 PM UTC+1, Afshin Mehrabani wrote:
>
> I'm not sure this is a bug is a default behavior but it does look weird to 
> me. I spent a few minutes today until I figured out what was the problem.
>
> Imagine this code:
>
> function helloworld () {
>>   return 42;
>> }
>> let [magic, index] = helloworld();
>> console.log(magic, index)
>
>
> Just because the return type of the function doesn't match, engine raises 
> this error:
>
>  TypeError: helloworld is not a function
>
>
> Which is wrong. `helloworld` is a function but the return type doesn't 
> match. Probably the error should be something like "Cannot cast Number to 
> Array or Iterable".
>
> The same code in Python raises this error:
>
> TypeError: 'int' object is not iterable
>
>
>
> Thanks,
>
> Afshin
>

-- 
-- 
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 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Destructing mismatch return of a function raises an invalid Error

2017-09-05 Thread Ben Noordhuis
On Mon, Sep 4, 2017 at 6:14 PM, Afshin Mehrabani  wrote:
> I'm not sure this is a bug is a default behavior but it does look weird to
> me. I spent a few minutes today until I figured out what was the problem.
>
> Imagine this code:
>
>> function helloworld () {
>>   return 42;
>> }
>> let [magic, index] = helloworld();
>> console.log(magic, index)
>
>
> Just because the return type of the function doesn't match, engine raises
> this error:
>
>>  TypeError: helloworld is not a function
>
>
> Which is wrong. `helloworld` is a function but the return type doesn't
> match. Probably the error should be something like "Cannot cast Number to
> Array or Iterable".
>
> The same code in Python raises this error:
>
>> TypeError: 'int' object is not iterable
>
>
>
> Thanks,
>
> Afshin

That was fixed a few months ago, see [0].  You are probably using an
older V8 version.

[0] https://bugs.chromium.org/p/v8/issues/detail?id=5532

-- 
-- 
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 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.