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

Issue 27802002: Disconnects code objects from infrequently used unoptimized functions. (Closed)

Created:
7 years, 2 months ago by zra
Modified:
7 years, 2 months ago
Reviewers:
srdjan, hausner
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Ivan Posva
Visibility:
Public.

Description

Disconnects code objects from infrequently used unoptimized functions. Every 30 seconds (configurable by --code-collection-interval), before a MarkSweep collection, this change halves a function's usage count if it is unoptimized. If the function's usage count reaches 0 as a result of this halving, it sets the function's code pointers to null. Then, if the code object isn't marked during the MarkSweep, it will be collected. This change also checks for null code pointers in various places, and recompiles/reconnects code if needed. R=srdjan@google.com Committed: https://code.google.com/p/dart/source/detail?r=29209

Patch Set 1 #

Total comments: 10

Patch Set 2 : #

Patch Set 3 : #

Total comments: 13

Patch Set 4 : #

Patch Set 5 : #

Total comments: 4

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+419 lines, -28 lines) Patch
M runtime/vm/assembler_x64.cc View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M runtime/vm/code_generator.cc View 1 2 3 1 chunk +16 lines, -4 lines 0 comments Download
M runtime/vm/flow_graph_compiler_arm.cc View 1 2 3 4 2 chunks +13 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 2 3 4 2 chunks +14 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_compiler_mips.cc View 1 2 3 4 2 chunks +15 lines, -5 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 2 3 4 2 chunks +14 lines, -2 lines 0 comments Download
M runtime/vm/object.h View 1 2 4 chunks +15 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 3 chunks +30 lines, -0 lines 0 comments Download
M runtime/vm/pages.h View 1 2 3 4 5 4 chunks +16 lines, -0 lines 0 comments Download
M runtime/vm/pages.cc View 1 2 3 4 5 4 chunks +66 lines, -2 lines 0 comments Download
M runtime/vm/stub_code.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/stub_code_arm.cc View 1 2 3 4 2 chunks +36 lines, -2 lines 0 comments Download
M runtime/vm/stub_code_ia32.cc View 1 2 3 4 2 chunks +37 lines, -2 lines 0 comments Download
M runtime/vm/stub_code_mips.cc View 1 2 3 4 2 chunks +38 lines, -2 lines 0 comments Download
M runtime/vm/stub_code_x64.cc View 1 2 3 4 2 chunks +37 lines, -2 lines 0 comments Download
A tests/standalone/code_collection_test.dart View 1 2 3 4 5 1 chunk +68 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
zra
Most of the new action is in page.cc. The other changes are for recompiling, etc., ...
7 years, 2 months ago (2013-10-18 00:26:26 UTC) #1
srdjan
More comments offline https://codereview.chromium.org/27802002/diff/1/runtime/vm/flow_graph_compiler_ia32.cc File runtime/vm/flow_graph_compiler_ia32.cc (right): https://codereview.chromium.org/27802002/diff/1/runtime/vm/flow_graph_compiler_ia32.cc#newcode1116 runtime/vm/flow_graph_compiler_ia32.cc:1116: __ j(NOT_EQUAL, &is_connected, Assembler::kNearJump); Add comment ...
7 years, 2 months ago (2013-10-18 17:16:07 UTC) #2
hausner
DBC https://codereview.chromium.org/27802002/diff/1/runtime/vm/pages.cc File runtime/vm/pages.cc (right): https://codereview.chromium.org/27802002/diff/1/runtime/vm/pages.cc#newcode399 runtime/vm/pages.cc:399: void CodeDropperVisitor::VisitObject(RawObject* raw_obj) { You should also check ...
7 years, 2 months ago (2013-10-18 17:46:17 UTC) #3
srdjan
https://codereview.chromium.org/27802002/diff/1/runtime/vm/pages.cc File runtime/vm/pages.cc (right): https://codereview.chromium.org/27802002/diff/1/runtime/vm/pages.cc#newcode406 runtime/vm/pages.cc:406: (fn.usage_counter() > 0)) { Use !fn.HasOptimizedCode()
7 years, 2 months ago (2013-10-18 18:04:32 UTC) #4
zra
As discussed, when code is detached, I now patch the code to be non-entrant. Then, ...
7 years, 2 months ago (2013-10-22 16:13:23 UTC) #5
srdjan
https://codereview.chromium.org/27802002/diff/195001/runtime/vm/code_generator.cc File runtime/vm/code_generator.cc (right): https://codereview.chromium.org/27802002/diff/195001/runtime/vm/code_generator.cc#newcode1425 runtime/vm/code_generator.cc:1425: if (target_function.CurrentCode() == Code::null()) { if (target_function.HasCode()) { .... ...
7 years, 2 months ago (2013-10-23 15:58:13 UTC) #6
zra
https://codereview.chromium.org/27802002/diff/195001/runtime/vm/code_generator.cc File runtime/vm/code_generator.cc (right): https://codereview.chromium.org/27802002/diff/195001/runtime/vm/code_generator.cc#newcode1425 runtime/vm/code_generator.cc:1425: if (target_function.CurrentCode() == Code::null()) { On 2013/10/23 15:58:13, srdjan ...
7 years, 2 months ago (2013-10-23 17:39:36 UTC) #7
zra
https://codereview.chromium.org/27802002/diff/195001/runtime/vm/flow_graph_compiler_arm.cc File runtime/vm/flow_graph_compiler_arm.cc (right): https://codereview.chromium.org/27802002/diff/195001/runtime/vm/flow_graph_compiler_arm.cc#newcode1378 runtime/vm/flow_graph_compiler_arm.cc:1378: __ EnterStubFrame(); On 2013/10/23 17:39:37, zra wrote: > On ...
7 years, 2 months ago (2013-10-23 23:27:51 UTC) #8
srdjan
LGTM with comments. Please run test suite with a short collection interval and unoptimized code ...
7 years, 2 months ago (2013-10-24 16:33:30 UTC) #9
zra
Running tests. https://codereview.chromium.org/27802002/diff/355001/runtime/vm/pages.cc File runtime/vm/pages.cc (right): https://codereview.chromium.org/27802002/diff/355001/runtime/vm/pages.cc#newcode28 runtime/vm/pages.cc:28: DEFINE_FLAG(int, code_collection_interval, 500000, On 2013/10/24 16:33:30, srdjan ...
7 years, 2 months ago (2013-10-24 20:53:09 UTC) #10
zra
On 2013/10/24 20:53:09, zra wrote: > Running tests. Running with optimization disabled and a code ...
7 years, 2 months ago (2013-10-24 21:04:26 UTC) #11
zra
7 years, 2 months ago (2013-10-24 21:26:29 UTC) #12
Message was sent while issue was closed.
Committed patchset #6 manually as r29209 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698