Re: [v8-users] How to remove CheckMaps instructions in an optimization phase

2014-11-05 Thread Vyacheslav Egorov
experiment does not provide any actionable data. Knowing that checks introduce X% overhead is kinda useless - unless you also know an algorithm to eliminate all of them and retain correctness. Vyacheslav Egorov On Wed, Nov 5, 2014 at 5:37 PM, Gabriel Southern wrote: > Perhaps it would help if I

Re: [v8-users] Using --hydrogen_track_positions flag triggers crash in debug mode

2014-10-14 Thread Vyacheslav Egorov
, and those are correct. Vyacheslav Egorov On Tue, Oct 14, 2014 at 9:46 PM, Gabriel Southern wrote: > I wanted to try IRHydra2 (http://mrale.ph/irhydra/2/) with the Octane > benchmarks. When I use the x64.debug version of d8 with the flags listed > for IRHydra2 and run the Octane ben

Re: [v8-users] V8, Hydrogen, disassembly, and Vyacheslav Egorov's JSConf talk

2014-10-09 Thread Vyacheslav Egorov
for example Slides 38 on show HIR, not disassembly) Also if you --trace-hydrogen you can use a tool of mine called IRHydra[1] to inspect optimized code. It can show you source, HIR & disassembly all together[2]. [1] http://mrale.ph/irhydra/2 [2] http://imgur.com/HbOOXEM Vyacheslav Egorov

Re: [v8-users] Re: Array#join - better to special case for Array/etc.?

2014-09-02 Thread Vyacheslav Egorov
start. Take for example a look at: http://jsperf.com/join-faster-than-concat Vyacheslav Egorov On Tue, Sep 2, 2014 at 12:59 AM, Isiah Meadows wrote: > On Mon, Sep 1, 2014 at 9:12 AM, Vyacheslav Egorov > wrote: > >> Array#[push|pop]() is easily optimized for array instances,

Re: [v8-users] Re: Array#join - better to special case for Array/etc.?

2014-09-01 Thread Vyacheslav Egorov
); for (auto& s : array) str.append(s); return str; } which is btw exactly what _FastAsciiArrayJoin attempts to do. Vyacheslav Egorov On Mon, Sep 1, 2014 at 11:20 AM, Isiah Meadows wrote: > That library rarely does type checking. This contributes a lot of > speed to their o

Re: [v8-users] Problem with several threads trying to lock an isolate, and the withdrawal of v8::Locker's preemption

2014-06-12 Thread Vyacheslav Egorov
olate.* This requirement is not checked right now, but neither anything is guaranteed to work if you try and start executing JavaScript in the interrupted isolate from the callback or from another thread (by unlocking isolate in the callback and allowing other thread to lock it). Vyacheslav Egorov

Re: [v8-users] Re: PropertyCallbackInfo::This() return type change

2014-05-14 Thread Vyacheslav Egorov
42..self;" "v + ' is a ' + typeof v")->Equals(v8_str("42 is a number"))); } Vyacheslav Egorov On Wed, May 14, 2014 at 10:19 AM, Sven Panne wrote: > On Tue, May 13, 2014 at 11:15 PM, Ben Noordhuis wrote: > >> Yang, isn't t

Re: [v8-users] Intent to ship: ES6 Map & Set

2014-05-07 Thread Vyacheslav Egorov
slow for various reasons). Can we proactively avoid falling down the same hole with ES6 features? What about having ES6 features (micro)benchmark suite to drive performance of this features across all browsers implementing them? Vyacheslav Egorov On Tue, May 6, 2014 at 9:22 PM, 'Erik Arvid

Re: [v8-users] Disappearing closure bindings

2013-12-04 Thread Vyacheslav Egorov
} return wrapSource(source, url, listenerName); } return preprocessor; })(); Vyacheslav Egorov On Thu, Dec 5, 2013 at 12:04 AM, wrote: > Let me start with a request for patience, I have a complex problem and I'm > unsure on some of the V8 terminology. > >

Re: [blink-dev] Re: [v8-users] Intent to Implement Promises in V8

2013-10-04 Thread Vyacheslav Egorov
taking a look at his code. Vyacheslav Egorov On Fri, Oct 4, 2013 at 7:27 PM, Yusuke SUZUKI wrote: > We're currently working on adding a threading API, probably similar to >> blink's WebThread. > > > Sounds very nice. Providing embedder-side's threading operation

Re: [v8-users] Re: --nouse-idle-notification and "last resort gc"

2013-06-06 Thread Vyacheslav Egorov
Do you report the size of your enormous Judy array to v8 via AdjustAmountOfExternallyAllocatedMemory? If you do try disabling that. Vyacheslav Egorov On Jun 6, 2013 10:22 AM, "Hitesh Gupta" wrote: > Hi, > We are facing a similar problem. We have an XMPP server running ove

Re: [v8-users] Creating persistent weak handles on primitive values did not collected by GC?

2013-04-27 Thread Vyacheslav Egorov
te amount of time] Vyacheslav Egorov On Sat, Apr 27, 2013 at 10:36 AM, Dmitry Azaraev wrote: > > Boolean values are eternal --- they never die. Small integers (31 bits > on ia32 and 32bits on x64) are > > not even allocated in the heap, they are *values* essentially so weak > re

Re: [v8-users] Creating persistent weak handles on primitive values did not collected by GC?

2013-04-26 Thread Vyacheslav Egorov
is undefined for them. > it is safe return persistent handle via raw return handle; instead of return handle_scope.Close(handle); ? Yes. You need to use Close only for Local handles. If you return Persistent handle you can just return that directly. -- Vyacheslav Egorov On Fri, Apr 26, 2013 at 12

Re: [v8-users] How to use --trap_on_deopt

2013-03-18 Thread Vyacheslav Egorov
y state to figure out what is going on. So unless you have deep understanding of V8 internals and proficient in reading assembly language this flag is useless. Vyacheslav Egorov On Mon, Mar 18, 2013 at 5:19 PM, Nick Evans wrote: > I would like to use the --trap_on_deopt flag ("put a

Re: [v8-users] .map is slower than for

2013-02-04 Thread Vyacheslav Egorov
Andy, Lack of deforestation is not really *the* main issue in this particular example. If you try fastMap that I attached then you'll see that its overhead is at least 80% less. Vyacheslav Egorov On Mon, Feb 4, 2013 at 7:02 PM, Andrii Melnykov wrote: > > On Monday, February 4, 2

Re: [v8-users] .map is slower than for

2013-02-04 Thread Vyacheslav Egorov
code.google.com/p/v8/issues/detail?id=2206). An alternative approach could provide specializations of map for various backing storage types. But again, there is no plumbing in V8 to enable that. Vyacheslav Egorov On Mon, Feb 4, 2013 at 4:17 PM, Andreas Rossberg wrote: > Moreover, 'ma

Re: [v8-users] Resize an Array in C++ ?

2012-12-07 Thread Vyacheslav Egorov
It should work. Please post the a complete reproduction of the problem that can be compiled: example above should not compile because Set expects a handle not a raw number. Vyacheslav Egorov On Fri, Dec 7, 2012 at 3:24 PM, Paul Harris wrote: > Hi, > > How do I do the equivalent of

Re: [v8-users] What causes a function to be "optimized too many times"? How do I avoid it?

2012-11-08 Thread Vyacheslav Egorov
: chrome.exe --no-sandbox --js-flags="--trace-opt --trace-deopt" > log.txt Vyacheslav Egorov On Thu, Nov 8, 2012 at 4:48 AM, Kevin Gadd wrote: > Interesting, I wonder why --trace-deopt isn't spitting out deopt notices for > me. Maybe some of the output is being lost bec

Re: [v8-users] What causes a function to be "optimized too many times"? How do I avoid it?

2012-11-07 Thread Vyacheslav Egorov
caleF] I do not see such deopt on Chrome 23 (though I did see some deopts of this function). This indeed looks like an issue either with type feedback or with generated code, though I can't be sure. Sven recently was changing things in that neighborhood. I am CCing him. I hope he will be able to

Re: [v8-users] Does changing the type passed to a constructor change a hidden class (and other queries)?

2012-11-06 Thread Vyacheslav Egorov
and you pass point that contains strings in x and y then function add will deoptimize. But this will happen when you execute add not when you create point with string values in x and y. Vyacheslav Egorov On Tue, Nov 6, 2012 at 3:44 PM, Wyatt wrote: > Interesting! But wouldn't each of the

Re: [v8-users] Does changing the type passed to a constructor change a hidden class (and other queries)?

2012-11-06 Thread Vyacheslav Egorov
The answer is no for each case. V8 does not track types of values assigned to a named properties. Vyacheslav Egorov On Tue, Nov 6, 2012 at 12:27 PM, Wyatt wrote: > With the follow code one hidden class is created: > > function Point(x, y) { > this.x = x; > this.y =

Re: [v8-users] What causes a function to be "optimized too many times"? How do I avoid it?

2012-11-06 Thread Vyacheslav Egorov
Hi Kevin, Does it deoptimize? I do not see any deoptimizations in the log you have attached, were you running with --trace-deopt? Vyacheslav Egorov On Tue, Nov 6, 2012 at 12:33 AM, Kevin Gadd wrote: > Hi, > > I've been looking into some performance issues in Chrome Canary for

Re: [v8-users] Re: [V8-Users] V8 3.6.6.25 With Max-Old-Space-Size Greater Than 1900MB?

2012-11-05 Thread Vyacheslav Egorov
Depends on the operating system you are running in. Check out man backtrace if you are on Mac/Linux/BSD like OS. Vyacheslav Egorov On Mon, Nov 5, 2012 at 8:17 AM, Joran Greef wrote: > How can I get such a back trace? > > On 05 Nov 2012, at 6:14 PM, v8-users@googlegroups.com wrote:

Re: [v8-users] V8 3.6.6.25 with max-old-space-size greater than 1900MB?

2012-11-05 Thread Vyacheslav Egorov
can somehow get a back trace from inside CollectAllAvailableGarbage. -- Vyacheslav Egorov On Mon, Nov 5, 2012 at 7:08 AM, Joran Dirk Greef wrote: > In practice it's working perfectly now. I rolled Node from v0.8 back to v0.6 > and the false positive allocation errors are no longe

Re: [v8-users] V8 3.6.6.25 with max-old-space-size greater than 1900MB?

2012-11-05 Thread Vyacheslav Egorov
ou hit a full collection it will always pause your app for much longer then a incremental collector of 3.7 and later would (given that everything is tweaked correctly). -- Vyacheslav Egorov On Mon, Nov 5, 2012 at 1:28 AM, Joran Dirk Greef wrote: > Recent GC changes in V8 are wreaking hav

Re: [v8-users] Re: --nouse-idle-notification and "last resort gc"

2012-11-05 Thread Vyacheslav Egorov
currently no way to configure GC like that. Vyacheslav Egorov On Mon, Nov 5, 2012 at 12:50 AM, Joran Dirk Greef wrote: > Max-old-space-size is measured in MB not KB as you suggest. > > Further, max-new-space-size makes no difference to the GC trace given above, > whether it's passed

Re: [v8-users] make release.check fails as missing cpplint.py

2012-10-24 Thread Vyacheslav Egorov
> Please make sure you have depot_tools in your $PATH. http://dev.chromium.org/developers/how-tos/install-depot-tools -- Vyacheslav Egorov On Wed, Oct 24, 2012 at 11:05 PM, Joe Millenbach wrote: > I'm trying to follow the directions on the build page to both build > and test my

Re: [v8-users] Is empty functions optimized away whenever know?

2012-10-21 Thread Vyacheslav Egorov
explained in my previous mail. Anyway all this matters only on a very hot path. Vyacheslav Egorov On Oct 21, 2012 7:10 PM, "idleman" wrote: > Thanks for your answer! > > To make the question some more clear, I invoke huge number of asynchronous > functions, but sometimes I

Re: [v8-users] Is empty functions optimized away whenever know?

2012-10-21 Thread Vyacheslav Egorov
definitely save space. -- Vyacheslav Egorov On Oct 20, 2012 10:05 PM, "idleman" wrote: > Hi, > > Is empty functions in lined whenever the function is know? Example: > > function do_nothing() { } > > //somewhere later in the code: > var cb = do_nothing; >

Re: [v8-users] Distinguish a floating-point argument from an integer?

2012-10-16 Thread Vyacheslav Egorov
No this is not possible. No matter what they write in the source 5 or 5.0 it'll be represented as 5. Vyacheslav Egorov On Oct 16, 2012 9:31 PM, "Brandon Harvey" wrote: > I'd like to be able to do printf / snprintf style string formatting, on > the C++ side, usin

Re: [v8-users] Distinguish a floating-point argument from an integer?

2012-10-15 Thread Vyacheslav Egorov
There are no integers in JavaScript so semantically they are identical. It's an implementation detail that 5.0 is sometimes represented as 5. Why do you want to distinguish them? Vyacheslav Egorov On Oct 16, 2012 5:25 AM, "Brandon Harvey" wrote: > I'd like to be abl

Re: [v8-users] documentation for deopt bailouts

2012-10-11 Thread Vyacheslav Egorov
ode and go read assembly around deopt point. > does that mean i should replace the for in with a for loop that iterates > over Object.keys? Yes. -- Vyacheslav Egorov On Thu, Oct 11, 2012 at 11:48 AM, Christoph Sturm wrote: > I'm trying to optimize my node app with --trace-deopt

Re: [v8-users] Re: ia32 bug?

2012-09-07 Thread Vyacheslav Egorov
Chromium's bindings layer uses External to associate opaque data with V8 objects and callbacks (see methods accepting Handle data in V8 api). So making External into a non-Value might involve some bindings work. -- Vyacheslav Egorov On Fri, Sep 7, 2012 at 2:50 PM, Sven Panne wrote: &g

Re: [v8-users] Re: [V8-Users] Is There A Limit To Number Of Properties In An Object?

2012-08-21 Thread Vyacheslav Egorov
Minor correction: I obviously meant to say "way below" not "way beyond". Vyacheslav Egorov On Aug 21, 2012 8:03 AM, "Joran Greef" wrote: > Thank you Vyacheslav > > On 20 Aug 2012, at 8:41 PM, v8-users@googlegroups.com wrote: > > > I would say l

Re: [v8-users] Is there a limit to number of properties in an Object?

2012-08-20 Thread Vyacheslav Egorov
I would say limit is around 2^24 entries (biggest fixed array can have approx 2^27 entries and hash table requires 3 entries per key-value pair and tries to maintain 50% occupancy). But overheads for mutating such a table become less than reasonable way beyond this point. Vyacheslav Egorov On

Re: [v8-users] garbage collection of anonymous functions

2012-08-20 Thread Vyacheslav Egorov
=332 This keeps them alive as long as wrapper is alive. -- Vyacheslav Egorov On Aug 20, 2012 6:04 PM, "Morten Olsen" wrote: > Hi, > > I'm struggling to figure out precisely what/where keeps an anonymous > function alive when used as an event h

Re: [v8-users] Crankshaft without 64-bit hardware support

2012-08-13 Thread Vyacheslav Egorov
than supporting register pairs across the pipeline. -- Vyacheslav Egorov On Mon, Aug 13, 2012 at 11:34 AM, Vyacheslav Egorov wrote: > Are you planning to allocate a couple of general purpose registers to > represent a double? Do these registers have to be ordered? (e.g. do > you need r_{N

Re: [v8-users] Crankshaft without 64-bit hardware support

2012-08-13 Thread Vyacheslav Egorov
In any case it would require some adjustments in allocator to get "what interferes with what" right. -- Vyacheslav Egorov On Mon, Aug 13, 2012 at 7:53 AM, Evgeny Baskakov wrote: > Hi guys, > > I'm looking for ways to modify the Crankshaft compilation mode to make it > wo

Re: [v8-users] Re: trace bailout stopped working on node 0.7.7 (V8 3.9.24.7) up to latest release 0.8.4

2012-08-01 Thread Vyacheslav Egorov
There is no such flag now. Sorry. -- Vyacheslav Egorov On Tue, Jul 31, 2012 at 6:56 PM, Sławek Janecki wrote: > Anyone? Is there a flag in new V8 that tells me, why my function wont be > optimized? > In previous V8 versions optimizer will try to optimize and bailout when > nesseser

Re: [v8-users] Re: [V8-Users] 64-Bit Integers

2012-07-27 Thread Vyacheslav Egorov
discussions about including 64bit types into ES6 as part of Binary Data work (e.g. http://wiki.ecmascript.org/doku.php?id=harmony:binary_data_discussion ). I don't know what is the status of this now. Any standardization issues should be addressed to TC-39. -- Vyacheslav Egorov On Fri, Jul 27, 2012 at

Re: [v8-users] recommended V8 GC settings for nodejs in heroku (hitting heroku memory limits)

2012-07-25 Thread Vyacheslav Egorov
You need to use something that gives you access to heap snapshots. I think node-inspector does. But better ask at node.js list. Vyacheslav Egorov On Jul 25, 2012 11:15 PM, "spollack" wrote: > I think you are probably right. after more testing, i can see that the GC > is runnin

Re: [v8-users] recommended V8 GC settings for nodejs in heroku (hitting heroku memory limits)

2012-07-25 Thread Vyacheslav Egorov
the memory because writing stuff to network/disk does not keep up with incomming data etc). I don't think any GC tweaks will be helpful here. -- Vyacheslav Egorov On Tue, Jul 24, 2012 at 9:52 PM, spollack wrote: > here is a reading even closer to the peak: > {"rss":542273536,

Re: [v8-users] Integer division when operands and target are integers

2012-07-25 Thread Vyacheslav Egorov
would be accepted or not without actually seeing a patch. -- Vyacheslav Egorov On Wed, Jul 25, 2012 at 4:20 PM, Evan Wallace wrote: > Oh ok, that makes sense. So V8 generates an integer instruction only if the > remainder is always zero. I've submitted this as issue 2258. > &g

Re: [v8-users] recommended V8 GC settings for nodejs in heroku (hitting heroku memory limits)

2012-07-24 Thread Vyacheslav Egorov
What is V8 heap usage: heapTotal and heapUsed parts reported by process.memoryUsage? -- Vyacheslav Egorov On Tue, Jul 24, 2012 at 8:52 PM, spollack wrote: > I am running a nodejs app in heroku, and on certain datasets i'm going over > the heroku memory limit of 512MB. I'm run

Re: [v8-users] Integer division when operands and target are integers

2012-07-24 Thread Vyacheslav Egorov
Once type-feedback told hydrogen that division happened to produce double value it does not try to revert it to integer division. The only exception is (quite fragile) MathFloorOfDiv optimization performed by HUnaryMathOperation::Canonicalize. Consider contributing your patch :-) -- Vyacheslav

Re: [v8-users] Re: How to write efficient code for Node/MongoDB mixed use?

2012-07-23 Thread Vyacheslav Egorov
Yes. -- Vyacheslav Egorov On Mon, Jul 23, 2012 at 4:48 PM, Sebastian Ferreyra Pons wrote: >> Yes. In a constructor function, the hidden class begins with an >> element that also includes a prototype. In two different constructor >> functions these initial elements will be

Re: [v8-users] Re: De-optimization of hot function when constructor adds methods directly to object

2012-07-20 Thread Vyacheslav Egorov
inheritance languages (at least Oberon compilers used in back in 80s). -- Vyacheslav Egorov On Fri, Jul 20, 2012 at 12:41 AM, jMerliN wrote: >> This will be great but there is no easy way to check that two hidden >> classes are compatible. Hidden classes are currently compared by >&g

[v8-users] Re: De-optimization of hot function when constructor adds methods directly to object

2012-07-19 Thread Vyacheslav Egorov
. This is much more complex and I am not sure it benefits any real world code. -- Vyacheslav Egorov On Jul 19, 8:03 pm, jMerliN wrote: > Vyacheslav, > > When I run the code you posted, I see a much bigger discrepancy > between test/test2 in the first pass and a slight reduction in test's &g

Re: [v8-users] Version Performance

2012-07-19 Thread Vyacheslav Egorov
The major difference between 3.0 and those before it is Crankshaft --- adaptive compilation pipeline: http://blog.chromium.org/2010/12/new-crankshaft-for-v8.html I am not sure what was the major difference between 2.x and 1.x -- Vyacheslav Egorov On Thu, Jul 19, 2012 at 5:07 PM, W Brimley

Re: [v8-users] De-optimization of hot function when constructor adds methods directly to object

2012-07-19 Thread Vyacheslav Egorov
ement is purely time spent in optimized code. If you call the same code second time you see purely timing results for optimized code. This is why benchmarks should always contain warm up phase to let optimizing JIT kick in. Hope this explains it. -- Vyacheslav Egorov On Thu, Jul 19, 2012 at 3:

Re: [v8-users] Re: Is --trace-deopt actually usable? If so, how are you supposed to use it?

2012-07-18 Thread Vyacheslav Egorov
a normal function with .prototype; they are just not linked together with a transition and are completely separated. I am not exactly sure why. Functions coming from different contexts (iframes) will have different hidden classes. Strict functions ("use strict";) will have different hi

Re: [v8-users] Re: Is --trace-deopt actually usable? If so, how are you supposed to use it?

2012-07-18 Thread Vyacheslav Egorov
ove. > Your explanation on why the no-message deopts occur is helpful To be precise I was referring to deoptimization that happens on "deoptimize" instruction you quoted in your first mail. [please do not hesitate to ask more questions!] -- Vyacheslav Egorov On Wed, Jul 18, 2012 at 6:

[v8-users] Re: Is --trace-deopt actually usable? If so, how are you supposed to use it?

2012-07-17 Thread Vyacheslav Egorov
parate files (I do it with a small script) or minimized by applying --hydrogen-filter=foo flag to block optimization of all functions that are not called foo. -- Vyacheslav Egorov On Jul 18, 12:42 am, Kevin Gadd wrote: > Thanks for the link to that video, I'll give it a look. Based on

Re: [v8-users] Destructors, a proposal of sorts

2012-07-11 Thread Vyacheslav Egorov
ments] -- Vyacheslav Egorov On Wed, Jul 11, 2012 at 5:02 PM, Michael Schwartz wrote: > Here's a pattern, using Canvas as an example: > > function foo() { > var c = new Canvas(); > var ctx = c.getContext('2d'); > var grad = ctx.createLinearGradient(0,0

Re: [v8-users] Destructors, a proposal of sorts

2012-07-10 Thread Vyacheslav Egorov
emory management (e.g. reference counting based scheme) in pure JS (but it will be error prone). That said if you are doing server side JS you can easily expose MakeWeak to your code. Some node.js modules do that. -- Vyacheslav Egorov On Tue, Jul 10, 2012 at 3:33 PM, mschwartz wrote: > I was read

Re: [v8-users] HTML5 Drag Drop feature crashing

2012-07-10 Thread Vyacheslav Egorov
This is not a V8 crash, the crash is in the WebKit. Please report it to them. -- Vyacheslav Egorov On Tue, Jul 10, 2012 at 2:16 PM, Manjunath G wrote: > Hi, > > When I try to test the HTML5 feature drag drop from > http://html5demos.com/drag, > v8 is crashing. Looks like crash

Re: [v8-users] Strict mode performance benefits

2012-07-10 Thread Vyacheslav Egorov
call is on a very hot path. Vyacheslav Egorov On Jul 10, 2012 9:19 AM, "Jakob Kummerow" wrote: > On Tue, Jul 10, 2012 at 7:58 AM, Rohit wrote: > >> Does V8's strict mode implementation offer any performance benefits? >> > > No. > > > -- > v8-us

Re: [v8-users] CALL_AND_RETRY_2 memory errors and strange TODO message in heap-inl.h

2012-06-27 Thread Vyacheslav Egorov
ll it's a huge engineering problem as it requires audit and refactoring of 4 years of code written in "no OOM or crash" paradigm. -- Vyacheslav Egorov On Thu, Jun 28, 2012 at 12:53 AM, Brian Wilson wrote: > Thanks, > > I've started by setting a breakpoint in > v8:

Re: [v8-users] instanceof Array fails after ReattachGlobal

2012-06-27 Thread Vyacheslav Egorov
ntext before a call to * DetachGlobal. */ void ReattachGlobal(Handle global_object); Unfortunately it seems that your use case is not supported by V8's API. -- Vyacheslav Egorov On Wed, Jun 27, 2012 at 3:58 PM, MikeM wrote: > > > There is no way. New context mean

Re: [v8-users] CALL_AND_RETRY_2 memory errors and strange TODO message in heap-inl.h

2012-06-27 Thread Vyacheslav Egorov
t V8 might start handle OOMs more gracefully in some day in the future (which is not trivial as OOM might leave VM in inconsistent state). -- Vyacheslav Egorov On Wed, Jun 27, 2012 at 11:55 PM, Brian Wilson wrote: > > I've been running into some issues lately where I see the mes

Re: [v8-users] instanceof Array fails after ReattachGlobal

2012-06-27 Thread Vyacheslav Egorov
return new foo(); } var o1 = mkfoo(); var o2 = mkfoo(); o1 instanceof o2.constructor // => false -- Vyacheslav Egorov On Tue, Jun 26, 2012 at 5:34 PM, MikeM wrote: >> Array function in one context is different from Array function in >> another context as each context is a se

Re: [v8-users] instanceof Array fails after ReattachGlobal

2012-06-26 Thread Vyacheslav Egorov
Array function in one context is different from Array function in another context as each context is a separate world with it's own built-in objects. You can use Array.isArray which should work cross-context. -- Vyacheslav Egorov On Mon, Jun 25, 2012 at 9:08 PM, MikeM wrote: > The co

Re: [v8-users] Re: [SIGSEGV] v8::HandleScope::HandleScope()

2012-06-16 Thread Vyacheslav Egorov
This assertion indeed indicates that your are trying to use V8 from a thread that does not own an isolate. You should get exclusive access to the isolate you are going to use with Locker: https://github.com/v8/v8/blob/master/include/v8.h#L3638 -- Vyacheslav Egorov On Fri, Jun 15, 2012 at 1:16

Re: [v8-users] ArrayBuffer fast access

2012-06-16 Thread Vyacheslav Egorov
compiler and to a person reading my code). -- Vyacheslav Egorov On Sat, Jun 16, 2012 at 5:44 PM, Pablo Sole wrote: > Hello there, > > I'm embedding v8 into a binary instrumentation framework and I'm trying > to use an ArrayBuffer/TypedBuffer for fast memory operations (

Re: [v8-users] [SIGSEGV] v8::HandleScope::HandleScope()

2012-06-15 Thread Vyacheslav Egorov
Hello, Please link against debug version of V8 to get more information about the crash. Also ensure that the thread that invokes your even_handler owns V8 Isolate if you have multiple threads using V8 concurrently. -- Vyacheslav Egorov On Fri, Jun 15, 2012 at 8:28 AM, Serega wrote: > Hel

Re: [v8-users] SetAccessor and read only?

2012-06-08 Thread Vyacheslav Egorov
Actually CCing Michael and Andreas. -- Vyacheslav Egorov On Fri, Jun 8, 2012 at 10:49 PM, Vyacheslav Egorov wrote: > +mstarzinger +rossberg > > I think we need a repro and V8 version. I could not repro on ToT with > an example like: > >  static Handle Getter(Local property,

Re: [v8-users] SetAccessor and read only?

2012-06-08 Thread Vyacheslav Egorov
perty]] (Object.defineProperty) but there is some special handling in our code that prevents it. https://github.com/v8/v8/blob/master/src/runtime.cc#L4459-4478 -- Vyacheslav Egorov On Fri, Jun 8, 2012 at 9:33 PM, Erik Arvidsson wrote: > The V8 WebKit bindings generates something like this

Re: [v8-users] XOR two 31-bit unsigned integers much faster than XOR two 32-bit unsigned integers?

2012-05-30 Thread Vyacheslav Egorov
uint32 via >>> 0, I get to 36ms (0.00036ms per key). Limiting number of bits inside the table does not improve anything (which is quite expected with code shaped like that). -- Vyacheslav Egorov On Wed, May 30, 2012 at 7:10 PM, Joran Greef wrote: > Keeping everything as Int32 but c

Re: [v8-users] XOR two 31-bit unsigned integers much faster than XOR two 32-bit unsigned integers?

2012-05-30 Thread Vyacheslav Egorov
mask = number_of_buckets - 1 (and number_of_buckets is a power of 2). -- Vyacheslav Egorov On Wed, May 30, 2012 at 7:02 PM, Joran Greef wrote: > To clarify, Array instead of Uint32Array is slightly slower as expected: > 0.54ms per key vs 0.48ms per key. > > -- > v8-users mail

Re: [v8-users] XOR two 31-bit unsigned integers much faster than XOR two 32-bit unsigned integers?

2012-05-30 Thread Vyacheslav Egorov
rts input via ToInt32) so the result is always a number from unsigned 32-bit integer range. See: http://es5.github.com/#x11.7.3 x >>> 0 is basically ToUint32(x) -- Vyacheslav Egorov On Wed, May 30, 2012 at 6:34 PM, Stephan Beal wrote: > On Wed, May 30, 2012 at 6:25 PM, Vyacheslav Eg

Re: [v8-users] XOR two 31-bit unsigned integers much faster than XOR two 32-bit unsigned integers?

2012-05-30 Thread Vyacheslav Egorov
array: new Int32Array(256); [not necessary if you are running x64 version of V8] c) stop doing >>> 0 at the end; -- Vyacheslav Egorov On Wed, May 30, 2012 at 5:21 PM, Joran Greef wrote: > The difference comes through when changing "integer % Math.pow(2,32)" > to "

Re: [v8-users] XOR two 31-bit unsigned integers much faster than XOR two 32-bit unsigned integers?

2012-05-30 Thread Vyacheslav Egorov
int32 (another example of this bug: http://code.google.com/p/v8/issues/detail?id=2097). I suggest you post your code here if possible so that we could take a look. -- Vyacheslav Egorov On Wed, May 30, 2012 at 4:40 PM, Jakob Kummerow wrote: > As long as you're running unoptimized code o

Re: [v8-users] Re: Low benchmark score on MIPS platform

2012-05-30 Thread Vyacheslav Egorov
Paul, I wonder if you have some reference MIPS numbers to share? Do the numbers you match Lawrence's? Lawrence, I wonder what numbers you are aiming for? What numbers did you see with your other JavaScript engine? -- Vyacheslav Egorov On Wed, May 30, 2012 at 12:00 PM, Lawrence wrote:

Re: [v8-users] Re: Read-only SetIndexedPropertiesToExternalArrayData

2012-04-23 Thread Vyacheslav Egorov
V8 does not support read only external arrays. -- Vyacheslav Egorov On Mon, Apr 23, 2012 at 7:49 AM, Paul Harris wrote: > Any more information on this? > > I would like make TypeArray access read-only too. > > > On Tuesday, May 10, 2011 8:04:17 AM UTC+8, Henrik Lindqvist w

Re: [v8-users] Locally-scoped version of Persistent?

2012-04-10 Thread Vyacheslav Egorov
Locally scoped version of persistent is almost equivalent to Local except that Local can never be weak. > Local lcontext = pcontext; It should be Local lcontext = Local::New(pcontext); -- Vyacheslav Egorov On Fri, Apr 6, 2012 at 3:32 AM, Marcel Laverdet wrote: > Hey I'm wonderin

Re: [v8-users] Re: How to get a function's prototype

2012-03-14 Thread Vyacheslav Egorov
operator* defined on a v8::Handle does not return a pointer to an object but rather a pointer to place which contains that pointer. Why do you actually want to get a raw pointer to an object? -- Vyacheslav Egorov On Wed, Mar 14, 2012 at 1:44 PM, avasilev wrote: > Seems this approach will l

Re: [v8-users] Error evaluating an object

2012-03-05 Thread Vyacheslav Egorov
property names). You have to enclose top level expression like that in parenthesis if you want to ensure that it is parsed as an expression. -- Vyacheslav Egorov On Mon, Mar 5, 2012 at 1:02 PM, fdmanana wrote: > Hi, > > When trying to evaluate the following object expression in the shell

Re: [v8-users] BinaryOpStub_MUL_Alloc_HeapNumbers = ?

2012-01-17 Thread Vyacheslav Egorov
Here is an alternative (a bit more precise) test case: http://jsperf.com/float64-vs-float/2 -- Vyacheslav Egorov On Tue, Jan 17, 2012 at 10:46 AM, Daniel Clifford wrote: > All the examples are optimized by Crankshaft. However, in the Float64Array > case, storing the intermediate values

Re: [v8-users] BinaryOpStub_MUL_Alloc_HeapNumbers = ?

2011-12-30 Thread Vyacheslav Egorov
are values and they can be shared: a.x = 1 / n; // a.x will contain pointer to the boxed number (HeapNumber) a.y = a.x; // a.y points to the same HeapNumber as a.x. -- Vyacheslav Egorov On Fri, Dec 30, 2011 at 5:41 AM, Joseph Gentle wrote: > Cool, thanks. I tracked down the deoptim

Re: [v8-users] BinaryOpStub_MUL_Alloc_HeapNumbers = ?

2011-12-29 Thread Vyacheslav Egorov
at contain floating point values. This currently requires boxing (and boxing requires heap allocation, heap allocation puts pressure on GC etc). I wonder if you can put typed arrays (e.g. Float64Array) to work here. -- Vyacheslav Egorov On Thu, Dec 29, 2011 at 4:18 AM, Joseph Gentle wrote: &g

Re: [v8-users] BinaryOpStub_MUL_Alloc_HeapNumbers = ?

2011-12-26 Thread Vyacheslav Egorov
-opt --trace-bailout --trace-deopt output to figure out what optimizer does with those function. -- Vyacheslav Egorov On Mon, Dec 26, 2011 at 7:00 AM, Joseph Gentle wrote: > What does it mean when I see BinaryOpStub_MUL_Alloc_HeapNumbers in my > profile? Does that mean the compiler is p

Re: [v8-users] Re: ASSERT(state_ != NEAR_DEATH);

2011-12-26 Thread Vyacheslav Egorov
Your weak callback (handle_weak) is empty and does not follow the contract. Put object.Dispose(); there. -- Vyacheslav Egorov On Mon, Dec 26, 2011 at 12:55 PM, D C wrote: > Hi: > Thanks for you replay, I modify my source according to your words, > It seems not work. > here

Re: [v8-users] ASSERT(state_ != NEAR_DEATH);

2011-12-25 Thread Vyacheslav Egorov
Every weak callback should either revive (via ClearWeak or MakeWeak) or destroy (via Dispose) the handle for which it was called. This contract is described in v8.h, see the comment above WeakReferenceCallback definition. You have a callback that does not follow this contract. -- Vyacheslav

Re: [v8-users] Fast Property Access in V8 JavaScript Engine

2011-12-17 Thread Vyacheslav Egorov
). Optimizer will try to deal with polymorphism by inlining (limited amount) of polymorphic cases. -- Vyacheslav Egorov On Sat, Dec 17, 2011 at 8:51 PM, Marcel Laverdet wrote: > I only have a loose understanding of v8's hidden classes and optimizer, > but there's something I've

Re: [v8-users] Fast Property Access in V8 JavaScript Engine

2011-12-17 Thread Vyacheslav Egorov
faster. However it cannot replace hidden classes entirely as noted above. -- Vyacheslav Egorov On Sat, Dec 17, 2011 at 11:31 AM, Vladimir Nesterovsky < vladi...@nesterovsky-bros.com> wrote: > Yesterday I've seen an article about some design principles of V8 > JavaSc

Re: [v8-users] Hint V8?

2011-12-16 Thread Vyacheslav Egorov
nsure that this function is optimized? If it is frequently called and it takes non-trivial amount of time to execute --- it will be optimized. -- Vyacheslav Egorov On Fri, Dec 16, 2011 at 9:11 PM, Egor Egorov wrote: > > Yes but how many calls do I have to fire till this optimisation takes &

Re: [v8-users] Hint V8?

2011-12-16 Thread Vyacheslav Egorov
will call it with numbers only V8 will in the end generate code that is specialized appropriately for the number case. -- Vyacheslav Egorov On Fri, Dec 16, 2011 at 12:23 PM, Egor Egorov wrote: > Let's suppose I have a function that expects an argument of a certain > type, a number.

Re: [v8-users] [couldn't find pc offset for node=0]

2011-10-12 Thread Vyacheslav Egorov
> Would this be a valuable bug report as is? Yes, please file a bug with a repro so we can start looking. -- Vyacheslav Egorov On Wed, Oct 12, 2011 at 2:25 AM, Marcel Laverdet wrote: > I've managed to simplify the repro case a lot, removing the dependency on > NodeJS and other

Re: [v8-users] [couldn't find pc offset for node=0]

2011-10-11 Thread Vyacheslav Egorov
Marcel, It's really hard to say anything without reproduction. It might be a genuine bug in the deoptimizer. -- Vyacheslav Egorov On Tue, Oct 11, 2011 at 9:53 PM, Marcel Laverdet wrote: > Hey there I'm trying to track down an issue with my v8 application (on > NodeJS). This

Re: [v8-users] Re: Assertion in Isolate::Current()

2011-10-10 Thread Vyacheslav Egorov
You have to use Isolate::Enter or Isolate::Scope. If you want to use the default isolate just acquire isolate lock with Locker. v8.h includes very detailed comments. Please read them for further information: http://code.google.com/p/v8/source/browse/trunk/include/v8.h#3510 -- Vyacheslav Egorov

Re: [v8-users] Re: Assertion in Isolate::Current()

2011-10-10 Thread Vyacheslav Egorov
You can not declare handle scope in a thread that does not yet own V8 Isolate. You should enter an Isolate first. -- Vyacheslav Egorov On Mon, Oct 10, 2011 at 1:02 PM, Adrian wrote: > Hi, > > This is the exact, complete program, that is failing.. > > class TestThread : public

Re: [v8-users] Re: Large unexpected Code FreeStoreAllocationPolicy resize

2011-09-02 Thread Vyacheslav Egorov
:Exit so your stacks of entered/saved contexts grow without bounds. Please check that they are balanced. You can also add some debug prints into Context::Enter to see length of entered_contexts_ stack. -- Vyacheslav Egorov On Fri, Sep 2, 2011 at 4:09 PM, Stuart wrote: > The system is still

Re: [v8-users] Re: V8 Garbage collection in multitasking mode

2011-09-01 Thread Vyacheslav Egorov
> Would it produce weak references?  I think not, right? No. When I am talking about weak references I mean v8 API Handles that were made weak with MakeWeak method. -- Vyacheslav Egorov On Thu, Sep 1, 2011 at 11:09 PM, Dennis H wrote: > Hi Vyacheslav, > > I guess you are right

Re: [v8-users] Re: V8 Garbage collection in multitasking mode

2011-09-01 Thread Vyacheslav Egorov
you seem to allocate for each task. -- Vyacheslav Egorov On Thu, Sep 1, 2011 at 8:34 PM, Dennis H wrote: > Hi Vyacheslav, > > I see your point. > > I don't use separate Isolate for each thread and all tasks use > function objects compiled in the global Context/Isolate. &g

Re: [v8-users] Re: Garbage Collection very slow on Android with latest stable line

2011-09-01 Thread Vyacheslav Egorov
rintF("FreeUnmarkedObjects took %d ms\n" + "%d bytes in %d objects alive, %d bytes in %d objects freed\n", + static_cast(end - start), + alivebytes, + alive, + freedbytes, + freed); } -- Vyacheslav Egorov, Software Engi

Re: [v8-users] Crankshaft Preemption Mechanism

2011-08-31 Thread Vyacheslav Egorov
stack check in the prologue. But if print is an API function then this loop will have no interruption point which is bad. -- Vyacheslav Egorov On Wed, Aug 31, 2011 at 10:39 PM, Kyle Morgan wrote: > Hi Vyacheslav, > > Allow me to demonstrate what I mean.  I ran the v8 shell with code &

Re: [v8-users] Crankshaft Preemption Mechanism

2011-08-31 Thread Vyacheslav Egorov
s are important part of V8's interruption mechanism so both compilers emit them to make all loops interruptable. [1] http://code.google.com/p/v8/source/browse/trunk/src/hydrogen.cc#2823 [2] http://code.google.com/p/v8/source/browse/trunk/src/hydrogen.cc#1247 -- Vyacheslav Egorov On Wed, Aug 31,

Re: [v8-users] V8 Garbage collection in multitasking mode

2011-08-31 Thread Vyacheslav Egorov
in parallel on V8 unless you create several isolates. If you are using a single isolate from many threads you have to ensure that only one thread is executing JS at the given moment. -- Vyacheslav Egorov On Wed, Aug 31, 2011 at 2:28 AM, Dennis H wrote: > Dear v8 Developers, > > I am r

Re: [v8-users] Re: Garbage Collection very slow on Android with latest stable line

2011-08-30 Thread Vyacheslav Egorov
his will lead to fragmentation but is much more stable then disabling full collection entirely. -- Vyacheslav Egorov On Tue, Aug 30, 2011 at 6:52 PM, Chris Jimison wrote: > Hi Vyacheslav, > > Sorry I took so long to get back to this. > >> What version were you using before u

Re: [v8-users] v8 on Linux on Power architecture (powerpc)

2011-08-26 Thread Vyacheslav Egorov
Hi, Main issue here is that V8 does not have a PPC codegen. You'll to implement one (plus all required arch specific runtime support) if you want to see V8 running on Power PC. -- Vyacheslav Egorov On Fri, Aug 26, 2011 at 4:06 PM, swsyessws wrote: > Hello all, I am a new user of

  1   2   >