Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Issue 2504153002: [TypeFeedbackVector] Root literal arrays in function literals slots (Closed)

Created:
4 years, 1 month ago by mvstanton
Modified:
4 years ago
CC:
v8-reviews_googlegroups.com, Michael Hablich
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[TypeFeedbackVector] Root literal arrays in function literals slots Literal arrays and feedback vectors for a function can be garbage collected if we don't have a rooted closure for the function, which happens often. It's expensive to come back from this (recreating boilerplates and gathering feedback again), and the cost is disproportionate if the function was inlined into optimized code. To guard against losing these arrays when we need them, we'll now create literal arrays when creating the feedback vector for the outer closure, and root them strongly in that vector. BUG=v8:5456 Review-Url: https://codereview.chromium.org/2504153002 Cr-Commit-Position: refs/heads/master@{#41893} Committed: https://chromium.googlesource.com/v8/v8/+/93df094081f04c629c3df2e40318de90ce5e0fb9

Patch Set 1 #

Patch Set 2 : Added test. #

Patch Set 3 : Starting to pass the literals array around. #

Patch Set 4 : Passing the snapshot. #

Patch Set 5 : debug fix. #

Patch Set 6 : Ports. #

Patch Set 7 : Compile and port fix. #

Patch Set 8 : Code comments. #

Patch Set 9 : REBASE. #

Total comments: 8

Patch Set 10 : REBASE. #

Patch Set 11 : REBASE. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+737 lines, -664 lines) Patch
M src/arm/interface-descriptors-arm.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/arm64/interface-descriptors-arm64.cc View 1 2 3 4 5 6 1 chunk +4 lines, -2 lines 0 comments Download
M src/ast/ast.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +27 lines, -0 lines 0 comments Download
M src/ast/ast-numbering.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M src/builtins/arm/builtins-arm.cc View 1 2 3 4 5 4 chunks +2 lines, -17 lines 0 comments Download
M src/builtins/arm64/builtins-arm64.cc View 1 2 3 4 5 4 chunks +2 lines, -14 lines 0 comments Download
M src/builtins/ia32/builtins-ia32.cc View 1 2 3 4 4 chunks +2 lines, -17 lines 0 comments Download
M src/builtins/mips/builtins-mips.cc View 1 2 3 4 5 4 chunks +2 lines, -17 lines 0 comments Download
M src/builtins/mips64/builtins-mips64.cc View 1 2 3 4 5 4 chunks +2 lines, -17 lines 0 comments Download
M src/builtins/x64/builtins-x64.cc View 1 2 3 4 4 chunks +2 lines, -14 lines 0 comments Download
M src/code-stubs.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M src/code-stubs.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +9 lines, -5 lines 0 comments Download
M src/compiler.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +12 lines, -19 lines 0 comments Download
M src/compiler/ast-graph-builder.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -1 line 0 comments Download
M src/compiler/bytecode-graph-builder.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -2 lines 0 comments Download
M src/compiler/js-create-lowering.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +9 lines, -3 lines 0 comments Download
M src/compiler/js-generic-lowering.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -0 lines 0 comments Download
M src/compiler/js-operator.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -1 line 0 comments Download
M src/compiler/js-operator.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +6 lines, -4 lines 0 comments Download
M src/contexts.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -3 lines 0 comments Download
M src/contexts.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +8 lines, -27 lines 0 comments Download
M src/crankshaft/hydrogen.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -2 lines 0 comments Download
M src/debug/liveedit.cc View 1 2 3 4 5 6 7 8 9 5 chunks +75 lines, -31 lines 0 comments Download
M src/factory.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -0 lines 0 comments Download
M src/factory.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +31 lines, -0 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M src/full-codegen/full-codegen.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M src/full-codegen/full-codegen.cc View 1 2 3 4 5 6 7 8 9 4 chunks +14 lines, -2 lines 0 comments Download
M src/heap/object-stats.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -20 lines 0 comments Download
M src/ia32/interface-descriptors-ia32.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M src/interface-descriptors.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M src/interpreter/bytecode-array-builder.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M src/interpreter/bytecode-array-builder.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M src/interpreter/bytecode-generator.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -2 lines 0 comments Download
M src/interpreter/bytecodes.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M src/interpreter/interpreter.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +13 lines, -5 lines 0 comments Download
M src/mips/interface-descriptors-mips.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/mips64/interface-descriptors-mips64.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 8 9 10 7 chunks +7 lines, -18 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 7 8 9 10 8 chunks +49 lines, -57 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +13 lines, -2 lines 0 comments Download
M src/objects-printer.cc View 1 2 3 4 5 6 7 8 9 3 chunks +12 lines, -0 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -3 lines 0 comments Download
M src/runtime/runtime-interpreter.cc View 1 2 3 4 1 chunk +8 lines, -3 lines 0 comments Download
M src/runtime/runtime-scopes.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +20 lines, -6 lines 0 comments Download
M src/type-feedback-vector.h View 1 2 3 4 5 6 7 8 10 chunks +44 lines, -4 lines 0 comments Download
M src/type-feedback-vector.cc View 1 2 3 4 5 6 7 12 chunks +81 lines, -6 lines 0 comments Download
M src/type-feedback-vector-inl.h View 1 2 3 4 5 6 7 2 chunks +27 lines, -1 line 0 comments Download
M src/x64/interface-descriptors-x64.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M test/cctest/heap/test-heap.cc View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -208 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/BasicLoops.golden View 1 2 3 4 5 6 7 2 chunks +5 lines, -5 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/BreakableBlocks.golden View 1 2 3 4 5 6 7 4 chunks +4 lines, -4 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden View 1 2 3 4 3 chunks +6 lines, -6 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden View 1 2 3 4 5 6 7 8 9 10 18 chunks +23 lines, -23 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/CompoundExpressions.golden View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ConstVariableContextSlot.golden View 1 2 3 4 4 chunks +8 lines, -8 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ContextParameters.golden View 1 2 3 4 5 chunks +8 lines, -8 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ContextVariables.golden View 1 2 3 4 7 chunks +10 lines, -10 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/CountOperators.golden View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -6 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/DeclareGlobals.golden View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Delete.golden View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/FunctionLiterals.golden View 1 2 3 4 3 chunks +6 lines, -6 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/LetVariableContextSlot.golden View 1 2 3 4 4 chunks +8 lines, -8 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Modules.golden View 1 2 3 4 5 6 7 8 9 5 chunks +5 lines, -5 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ObjectLiterals.golden View 1 2 3 4 5 6 7 8 9 10 9 chunks +16 lines, -16 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/TopLevelObjectLiterals.golden View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -3 lines 0 comments Download
M test/cctest/test-feedback-vector.cc View 1 2 3 4 5 6 7 1 chunk +16 lines, -0 lines 0 comments Download
M test/cctest/test-heap-profiler.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A test/mjsunit/strong-rooted-literals.js View 1 2 3 4 1 chunk +40 lines, -0 lines 0 comments Download
M test/unittests/compiler/js-create-lowering-unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +14 lines, -3 lines 0 comments Download
M test/unittests/interpreter/bytecode-array-builder-unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 67 (53 generated)
mvstanton
Hi Benedikt, hi Igor, Here is the TypeFeedbackVector CL that roots the literals array for ...
4 years ago (2016-12-07 22:42:03 UTC) #9
Benedikt Meurer
I find this FIXED_ARRAY kind name very confusing. How about giving it a more descriptive ...
4 years ago (2016-12-08 04:59:30 UTC) #12
mvstanton
Hi Benedikt, Thanks, good advice...I changed it to CREATE_CLOSURE. Best! --Michael
4 years ago (2016-12-08 13:50:06 UTC) #30
Benedikt Meurer
Sorry, I was unable to finish a full review by now, still need to wrap ...
4 years ago (2016-12-10 17:20:37 UTC) #37
Benedikt Meurer
Ok, sorry for the delay (family sickness pushed back on my work activity). I think ...
4 years ago (2016-12-11 17:58:09 UTC) #38
Benedikt Meurer
lgtm
4 years ago (2016-12-19 10:53:22 UTC) #39
mvstanton
Thanks Benedikt, comments below. We'll push forward on unifying the vector and literals array soon...thx ...
4 years ago (2016-12-21 13:09:14 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2504153002/370001
4 years ago (2016-12-21 13:09:39 UTC) #55
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/31167)
4 years ago (2016-12-21 13:13:30 UTC) #57
mvstanton
Hi Michael, Thanks for the discussion and quick look at heap-stats.cc. As we discussed, since ...
4 years ago (2016-12-21 13:33:13 UTC) #60
Michael Lippautz
On 2016/12/21 13:33:13, mvstanton wrote: > Hi Michael, > Thanks for the discussion and quick ...
4 years ago (2016-12-21 13:59:21 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2504153002/370001
4 years ago (2016-12-21 14:03:58 UTC) #63
commit-bot: I haz the power
Committed patchset #11 (id:370001) as https://chromium.googlesource.com/v8/v8/+/93df094081f04c629c3df2e40318de90ce5e0fb9
4 years ago (2016-12-21 14:06:37 UTC) #66
Michael Hablich
4 years ago (2016-12-22 10:26:02 UTC) #67
Message was sent while issue was closed.
A revert of this CL (patchset #11 id:370001) has been created in
https://codereview.chromium.org/2597163002/ by hablich@chromium.org.

The reason for reverting is: Speculative revert because of blocked roll:
https://codereview.chromium.org/2596013002/.

Powered by Google App Engine
This is Rietveld 408576698