Commit Graph

10 Commits

Author SHA1 Message Date
Shiyu Zhang
206b59c719 [runtime] Handle element in for-in fast path that uses PrototypeInfo cache
This can speed up the below micro-bench by 3x and improve JetStream2-tagcloud-SP case by ~2%.

Object.prototype.foo = function() {};
let array = ['a','b','c','d','e'];
let start = Date.now();
for (let i = 0; i < 1e5; i++) {
	for (let j in array) {}
}
console.log(Date.now() - start);

Contributed by tao.pan@intel.com

Change-Id: I44c948c2e4c28b8e42192f36802a5ea0f82bbe25
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2049903
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Shiyu Zhang <shiyu.zhang@intel.com>
Cr-Commit-Position: refs/heads/master@{#66362}
2020-02-20 08:37:38 +00:00
Shiyu Zhang
6f3cf7aaae Reland "Reland "[runtime] Cache prototype chain enumerable keys in PrototypeInfo""
This is a reland of 3b7535636f

Original change's description:
> Reland "[runtime] Cache prototype chain enumerable keys in PrototypeInfo"
> 
> This is a reland of 5253d7bf15
> 
> Original change's description:
> > [runtime] Cache prototype chain enumerable keys in PrototypeInfo
> > 
> > This CL adds a prototype_chain_enum_cache to cache the enumeration of a
> > prototype and its entire chain on the PrototypeInfo. It can improve for-in
> > performance via simply merging the receiver enumeration with this cache.
> > 
> > It improves the score of JetStream2-tagcloud-SP case by ~9% on IA Chromebook.
> > 
> > Contributed by tao.pan@intel.com
> > 
> > Change-Id: Ib40bfe41e772672337155584672f06fa1ba1e70d
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1870844
> > Commit-Queue: Shiyu Zhang <shiyu.zhang@intel.com>
> > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#65224}
> 
> Change-Id: I93b74727c46abbaab163324c50fbd977fcc9bb36
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1955232
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Shiyu Zhang <shiyu.zhang@intel.com>
> Cr-Commit-Position: refs/heads/master@{#65377}

Change-Id: If4b4631e1b8a3d2df748b6be8500f838836a3291
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2008253
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65919}
2020-01-22 15:37:46 +00:00
Toon Verwaest
09278f79f2 Revert "Reland "[runtime] Cache prototype chain enumerable keys in PrototypeInfo""
This reverts commit 3b7535636f.

Reason for revert: breaks in multiple places:
https://bugs.chromium.org/p/chromium/issues/detail?id=1029368
https://bugs.chromium.org/p/chromium/issues/detail?id=1029361


Original change's description:
> Reland "[runtime] Cache prototype chain enumerable keys in PrototypeInfo"
> 
> This is a reland of 5253d7bf15
> 
> Original change's description:
> > [runtime] Cache prototype chain enumerable keys in PrototypeInfo
> > 
> > This CL adds a prototype_chain_enum_cache to cache the enumeration of a
> > prototype and its entire chain on the PrototypeInfo. It can improve for-in
> > performance via simply merging the receiver enumeration with this cache.
> > 
> > It improves the score of JetStream2-tagcloud-SP case by ~9% on IA Chromebook.
> > 
> > Contributed by tao.pan@intel.com
> > 
> > Change-Id: Ib40bfe41e772672337155584672f06fa1ba1e70d
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1870844
> > Commit-Queue: Shiyu Zhang <shiyu.zhang@intel.com>
> > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#65224}
> 
> Change-Id: I93b74727c46abbaab163324c50fbd977fcc9bb36
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1955232
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Shiyu Zhang <shiyu.zhang@intel.com>
> Cr-Commit-Position: refs/heads/master@{#65377}

TBR=verwaest@chromium.org,shiyu.zhang@intel.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I5b0d544e802ffda6a6804931087f37cb112805ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1962273
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65418}
2019-12-11 16:03:15 +00:00
Zhang, Shiyu
3b7535636f Reland "[runtime] Cache prototype chain enumerable keys in PrototypeInfo"
This is a reland of 5253d7bf15

Original change's description:
> [runtime] Cache prototype chain enumerable keys in PrototypeInfo
> 
> This CL adds a prototype_chain_enum_cache to cache the enumeration of a
> prototype and its entire chain on the PrototypeInfo. It can improve for-in
> performance via simply merging the receiver enumeration with this cache.
> 
> It improves the score of JetStream2-tagcloud-SP case by ~9% on IA Chromebook.
> 
> Contributed by tao.pan@intel.com
> 
> Change-Id: Ib40bfe41e772672337155584672f06fa1ba1e70d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1870844
> Commit-Queue: Shiyu Zhang <shiyu.zhang@intel.com>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#65224}

Change-Id: I93b74727c46abbaab163324c50fbd977fcc9bb36
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1955232
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Shiyu Zhang <shiyu.zhang@intel.com>
Cr-Commit-Position: refs/heads/master@{#65377}
2019-12-09 06:40:56 +00:00
Toon Verwaest
21ad38ef83 Revert "[runtime] Cache prototype chain enumerable keys in PrototypeInfo"
This reverts commit 5253d7bf15.

Reason for revert: Elements don't properly invalidate the cache.

Original change's description:
> [runtime] Cache prototype chain enumerable keys in PrototypeInfo
> 
> This CL adds a prototype_chain_enum_cache to cache the enumeration of a
> prototype and its entire chain on the PrototypeInfo. It can improve for-in
> performance via simply merging the receiver enumeration with this cache.
> 
> It improves the score of JetStream2-tagcloud-SP case by ~9% on IA Chromebook.
> 
> Contributed by tao.pan@intel.com
> 
> Change-Id: Ib40bfe41e772672337155584672f06fa1ba1e70d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1870844
> Commit-Queue: Shiyu Zhang <shiyu.zhang@intel.com>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#65224}

TBR=verwaest@chromium.org,shiyu.zhang@intel.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ic5d476bc8b334241b2accb8344749fcf7dcf5e09
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1943153
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65259}
2019-11-29 11:42:29 +00:00
Zhang, Shiyu
5253d7bf15 [runtime] Cache prototype chain enumerable keys in PrototypeInfo
This CL adds a prototype_chain_enum_cache to cache the enumeration of a
prototype and its entire chain on the PrototypeInfo. It can improve for-in
performance via simply merging the receiver enumeration with this cache.

It improves the score of JetStream2-tagcloud-SP case by ~9% on IA Chromebook.

Contributed by tao.pan@intel.com

Change-Id: Ib40bfe41e772672337155584672f06fa1ba1e70d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1870844
Commit-Queue: Shiyu Zhang <shiyu.zhang@intel.com>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65224}
2019-11-28 04:32:08 +00:00
Camillo Bruni
ec348ef152 [keys] Fix for-in with only non-enumerable properties in dictionary mode
Bug: v8:8163
Change-Id: I2aacbb13dc16772b173d56051a84399b8c34d4f2
Reviewed-on: https://chromium-review.googlesource.com/1224417
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55872}
2018-09-13 14:55:34 +00:00
whesse@chromium.org
9991a4b226 Fix issue 785. For-in now works on strings: for (var i in "asdf") now works
all the time, not just the first time it is run.
Review URL: http://codereview.chromium.org/3037008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5095 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-19 12:45:21 +00:00
christian.plesner.hansen@gmail.com
9bed566bdb Changed copyright header from google inc. to v8 project authors.
Added presubmit step to check copyright.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@242 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-09 20:08:45 +00:00
christian.plesner.hansen
c42f5829a1 Included mjsunit JavaScript test suite and C++ unit tests.
In the shell sample don't print the result of executing a script, only
evaluating expressions.

Fixed issue when building samples on Windows using a shared V8
library.  Added visibility option on Linux build which makes the
generated library 18% smaller.

Changed build system to accept multiple build modes in one build and
generate seperate objects, libraries and executables for each mode.

Removed deferred negation optimization (a * -b => -(a * b)) since this
visibly changes operand conversion order.

Improved parsing performance by introducing stack guard in preparsing.
Without a stack guard preparsing always bails out with stack overflow.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-22 13:33:59 +00:00