Project: v8 Issues People Development process History Sign in
New issue
Advanced search Search tips
Issue 3664 Weak references in optimized code lead to opt/deopt cycles
Starred by 14 users Project Member Reported by u...@chromium.org, Oct 30 2014 Back to list
Status: Fixed
Owner:
Closed: May 2015
HW: ----
OS: All
Priority: 2
Type: Bug

Blocking:
issue 2935
issue 3665



Sign in to add a comment
"Complex List" test at http://samsaffron.github.io/ember-performance/?ember=1.8.0 runs
- 203.53ms with weak references (default flags)
- 185.11ms without weak references (--js-flags="--noweak-embedded-objects-in-optimized-code --noweak-embedded-maps-in-optimized-code")

--trace-deopt shows that many functions are deoptimized becaus of weak references.
 
Comment 1 by u...@chromium.org, Oct 30 2014
Blocking: v8:3665
Comment 2 by u...@chromium.org, Oct 30 2014
Blocking: v8:2935
Comment 3 by ulan@google.com, Nov 11 2014
Uploaded one possible solution for review: review:https://codereview.chromium.org/688853007/
Project Member Comment 5 by bugdroid1@chromium.org, Mar 6 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/1b00451f5748ece669127ce9986ad77e4285bdad

commit 1b00451f5748ece669127ce9986ad77e4285bdad
Author: ulan <ulan@chromium.org>
Date: Fri Mar 06 12:36:16 2015

Retain maps embedded in optimized code for several garbage collections.

This keeps dying maps alive for FLAG_retain_maps_for_n_gc garbage collections
to increase chances of them being reused for new objects in future and
decrease number of deoptimizations.

BUG= v8:3664 
LOG=N
TEST=cctest/test-heap/MapRetaining

Review URL: https://codereview.chromium.org/980523004

Cr-Commit-Position: refs/heads/master@{#27040}

[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/include/v8.h
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/src/flag-definitions.h
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/src/heap/heap.cc
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/src/heap/heap.h
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/src/heap/mark-compact.cc
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/src/heap/mark-compact.h
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/src/lithium.cc
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/src/objects-inl.h
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/src/objects.cc
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/src/objects.h
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/test/cctest/cctest.gyp
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/test/cctest/test-api.cc
[add] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/test/cctest/test-array-list.cc
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/test/cctest/test-heap.cc
[modify] http://crrev.com/1b00451f5748ece669127ce9986ad77e4285bdad/test/cctest/test-mark-compact.cc

Project Member Comment 6 by bugdroid1@chromium.org, Mar 17 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/d4cd05e6df74f83aa68973f2192014c685ba13a6

commit d4cd05e6df74f83aa68973f2192014c685ba13a6
Author: ulan <ulan@chromium.org>
Date: Tue Mar 17 10:52:00 2015

Retain maps that have live prototypes.

BUG= v8:3664 
LOG=NO

Review URL: https://codereview.chromium.org/1009343002

Cr-Commit-Position: refs/heads/master@{#27233}

[modify] http://crrev.com/d4cd05e6df74f83aa68973f2192014c685ba13a6/src/heap/mark-compact.cc
[modify] http://crrev.com/d4cd05e6df74f83aa68973f2192014c685ba13a6/test/cctest/test-heap.cc

Comment 7 by habl...@google.com, Apr 29 2015
Status: Assigned
Comment 8 by u...@chromium.org, May 29 2015
Status: Fixed
#5 and #6 made opt/deopt cycles less likely.

After https://codereview.chromium.org/1144223002 this problem is not affecting the Ember benchmark.


I am marking this as fixed, but will reopen if I see this problem occuring in other apps.
Labels: Priority-2
Sign in to add a comment