Re: [v8-users] Building v8 with Makefile

2018-11-13 Thread madana gopal
Thanks for details Jakob and Peter.
 

> Node has been using Makefile mechanism. I am interested to use ninja 
> mechanism here and trying it out first. With use_sysroot = false, is it 
> possible to explicitly mention alternate sysroot path as part of ninja 
> build? Please let me know.


Thanks.

Regards,
Madan 

 

-- 
-- 
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: ChromeDevTools connected to Inspector, but error responses... missing native JS functions?

2018-11-13 Thread kpiascik via v8-users
Hi @soylentgraham,

I'm trying to replicate what you're doing as well but am running into some 
other problems.  The most notable of which is that my websocket is on a 
different thread than my isolate creation.
I see from your solution that you're adding the frontend messages to a 
queue and looking through them in your event loop.  My problem is that I 
have long running javascript that is not intended to exit/return until the 
program stops.  Do you have any suggestions/ideas?

Thanks,
Konrad
  

On Tuesday, September 18, 2018 at 10:49:43 AM UTC-4, @soylentgraham wrote:
>
> YetAnotherUpdate
>
> After some more digging, I found the issue I have is identified node and 
> chromium too... 
>
> https://github.com/nodejs/node/commit/b1e26128f317a6f5a5808a0a727e98f80f088b84
>
> So, it looks like the default v8 [platform] isn't chrome-dev-tools 
> compatible.
> Ibon's case worked as it has a specific Android platform implementation. 
> Chromium and Node also have their own platform.
>
> So, I made the most basic platform proxy possible to work around it...
>
> https://github.com/SoylentGraham/V8InspectorMinimal/blob/master/src/TV8Platform.h
>
> And it works!
> I can now modify code on the fly, execute from the console.
> I can't seem to debug, and pressing pause-execution a few times gives me a 
> new assert, but the higher level code is a bit of a mess at this point, so 
> I'm probably implementing something wrong...
>
> Still, if anyone else ever finds this problem... V8 alone cannot be used 
> with chrome dev tools. (as of 7.1.0.0  
>
> 4544e18b0c3845a9fca422cf0903df4803343cf1)
>
> On Friday, 14 September 2018 11:44:33 UTC+1, @soylentgraham wrote:
>>
>> So the core of my issue at the moment, is this assert (UNIMPLEMENTED)
>>
>> void 
>> DefaultWorkerThreadsTaskRunner::PostDelayedTask(std::unique_ptr task,
>>
>>  double 
>> delay_in_seconds) {
>>
>>   base::LockGuard guard(_);
>>
>>   if (terminated_) return;
>>
>>   if (delay_in_seconds == 0) {
>>
>> queue_.Append(std::move(task));
>>
>> return;
>>
>>   }
>>
>>   // There is no use case for this function with non zero 
>> delay_in_second on a
>>
>>   // worker thread at the moment, but it is still part of the interface.
>>
>>   UNIMPLEMENTED();
>>
>> }
>>
>> from 
>>
>> DefaultPlatform::CallDelayedOnWorkerThread(
>>
>> being called by
>>
>> protocol::Response V8InspectorImpl::EvaluateScope::setTimeout(double 
>> timeout) {
>>
>>   if (m_isolate->IsExecutionTerminating()) {
>>
>> return protocol::Response::Error("Execution was terminated");
>>
>>   }
>>
>>   m_cancelToken.reset(new CancelToken());
>>
>>   v8::debug::GetCurrentPlatform()->CallDelayedOnWorkerThread(
>>
>>   v8::base::make_unique(m_isolate, m_cancelToken), 
>> timeout);
>>
>>   return protocol::Response::OK();
>>
>> }
>>
>>
>>
>> so, SetTimeout in the inspector, explicitly uses something we[developers] 
>> know isn't implemented...
>> From reading things before, Node.js was using the default platform, I 
>> think now it has it's own platform. Maybe chromium does too...
>> Perhaps the demo/unittest debugger/d8/inspector doesn't call settimeout, 
>> so this hasn't been found with default setups...
>>
>> Maybe I HAVE to implement my own platform to support chrome dev tools and 
>> handle delayed jobs...
>>
>>
>> On Thursday, 13 September 2018 17:14:58 UTC+1, @soylentgraham wrote:
>>>
>>> For any future readers;
>>> I went back to trying to build a debug v8 set of libs (wouldnt compile 
>>> before, added is_component_build=false which I think fixed that)
>>> Built with latest master (4544e18b0c3845a9fca422cf0903df4803343cf1) 
>>>
>>> Which forced me to correct a few uses of deprecated functions, including 
>>> v8::String::NewFromUtf8() with no isolate, so *possibly* that was the 
>>> source of the crash re: scriptorigin. I now get an origin in CDT (kinda, it 
>>> still breaks in a VMXX file)
>>>
>>> Then asserts as before in "code that should never be reached" (see 
>>> earlier in the thread)
>>>
>>> [image: Screen Shot 2018-09-13 at 17.08.09.png]
>>>
>>>
>>>
>>> On Wednesday, 12 September 2018 17:34:30 UTC+1, @soylentgraham wrote:

 With a lot of back & forth help from Ibon/hyperandroid, we've got a bit 
 further in working out which things are good, and which are bad. 
 Feels like we're close, but things are still unstable, and a bit 
 unresponsive.

 I can kinda break into the code (which only shows *this *in sources)
 Still get the assert above from trying to autocomplete too many times. 
 (albeit after a RunMessageLoop callback now)
 And if I add a script origin, I get a crash trying to stacktrace 
 (immediately when connecting, still trying to figure this out, as my 
 scriptorigin is okay)

 More stripped back version here (cutting more dependencies out, but all 
 my setup, inspector, frontend, messaging is in v8minimal.cpp)
 

Re: [v8-users] Building v8 with Makefile

2018-11-13 Thread Peter Schow
Node has been built with yocto, correct?  You may want to see see how
the Node yocto recipe(s) work, and see if someone has already done the
heavy-lifting for V8.

-- 
-- 
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] Building v8 with Makefile

2018-11-13 Thread Jakob Kummerow
You can put:

is_clang = false
use_sysroot = false

into args.gn to make the V8 build use your system toolchain and libraries
instead of the bundled ones.

On Mon, Nov 12, 2018 at 9:18 PM madana gopal 
wrote:

> Hi,
>
> Also, v8 is using its own toolchain for arm,mips  etc, and we have
> toolchain already present as part of our yocto build system.So, do we have
> any way to make v8 build to point to our own toolchain?. please clarify.
>
> Thanks.
>
> Regards,
> Madan
>
> --
> --
> 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.


Re: [v8-users] Where does these codes get printed? The source file!

2018-11-13 Thread Ben Noordhuis
On Mon, Nov 12, 2018 at 10:28 PM TLim  wrote:
> I'm sorry to keep asking questions, but I'm wondering how can I get
> void Code::Disassemble(const char* name, std::ostream& os, Address 
> current_pc) {   ...
> }
> to get executed instead of
> void BytecodeArray::Disassemble(std::ostream& os) { ...}

V8 consists of an interpreter and a JIT compiler. The interpreter
operates on bytecode, the compiler emits code objects. The compiler is
only used for interpreted functions that are considered hot (called
frequently and with stable types.)

In the example you posted, if you call foo() in a loop, it eventually
gets compiled to native code because it's a good candidate.* You can
also start d8 with --allow_natives_syntax and optionally
--predictable, and call %OptimizeFunctionOnNextCall(foo) to force it
to be compiled. The percentage sign is not a typo, by the way.

* In fact, I would expect TurboFan to compile the top-level script,
inline foo() into the caller and optimize it down to just `.result =
3`, where .result is a pseudo-variable containing the result of the
evaluated script.

-- 
-- 
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.