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

Issue 1785403002: [runtime] split up loops with HandleScopes (Closed)

Created:
4 years, 9 months ago by Camillo Bruni
Modified:
4 years, 9 months ago
Reviewers:
Igor Sheludko, Yang
CC:
v8-reviews_googlegroups.com, Yang
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[runtime] split up loops with HandleScopes HandleScopes in for-loops are rather expensive and pose a significant overhead to some builtin/runtime-functions. The FOR_WITH_HANDLE_SCOPE macro is used to only create a new HandleScope every 1024th iteration. BUG= Committed: https://crrev.com/25d36eacf20f72bf6ba19b1475c0e4f56f95d1a2 Cr-Commit-Position: refs/heads/master@{#34856}

Patch Set 1 #

Patch Set 2 : adding loop var type #

Total comments: 1

Patch Set 3 : addressing nits and fixing break-issue #

Patch Set 4 : making windose happy #

Total comments: 1

Patch Set 5 : only introduce FOR_WITH_HANDLE_SCOPE for builtins and runtime functions #

Total comments: 3

Patch Set 6 : fix left-over variable #

Total comments: 2

Patch Set 7 : addressing comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -70 lines) Patch
M src/builtins.cc View 1 2 3 4 5 13 chunks +35 lines, -42 lines 0 comments Download
M src/isolate.h View 1 2 3 4 5 6 1 chunk +14 lines, -0 lines 0 comments Download
M src/isolate.cc View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M src/runtime/runtime-literals.cc View 1 1 chunk +14 lines, -13 lines 0 comments Download
M src/runtime/runtime-regexp.cc View 1 2 chunks +5 lines, -6 lines 0 comments Download
M src/runtime/runtime-scopes.cc View 1 2 chunks +2 lines, -3 lines 0 comments Download
M src/runtime/runtime-strings.cc View 1 2 3 4 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 30 (11 generated)
Camillo Bruni
PTAL While micro-benchmarking StringSplit I found that not creating a new HandleScope on every iteration ...
4 years, 9 months ago (2016-03-11 17:49:18 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1785403002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1785403002/20001
4 years, 9 months ago (2016-03-11 19:06:14 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_win_nosnap_shared_compile_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_nosnap_shared_compile_rel/builds/11792)
4 years, 9 months ago (2016-03-11 19:13:04 UTC) #6
Igor Sheludko
lgtm with a nit: https://codereview.chromium.org/1785403002/diff/20001/src/builtins.cc File src/builtins.cc (right): https://codereview.chromium.org/1785403002/diff/20001/src/builtins.cc#newcode1155 src/builtins.cc:1155: FOR_WITH_HANDLE_SCOPE(isolate, int, j = 0, ...
4 years, 9 months ago (2016-03-14 08:36:16 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1785403002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1785403002/40001
4 years, 9 months ago (2016-03-14 09:29:26 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/12297)
4 years, 9 months ago (2016-03-14 09:32:13 UTC) #12
Yang
https://codereview.chromium.org/1785403002/diff/60001/src/isolate.h File src/isolate.h (right): https://codereview.chromium.org/1785403002/diff/60001/src/isolate.h#newcode184 src/isolate.h:184: loop_var_type init; \ Like discussed offline, we can probably ...
4 years, 9 months ago (2016-03-14 13:44:18 UTC) #13
Camillo Bruni
Apparently I forgot to disable handle scope zapping, after that the results aren't that clear ...
4 years, 9 months ago (2016-03-14 16:05:56 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1785403002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1785403002/80001
4 years, 9 months ago (2016-03-16 11:46:29 UTC) #16
Camillo Bruni
PTAL again. As discussed offline, I removed the macro from non-critical paths and left it ...
4 years, 9 months ago (2016-03-16 11:47:24 UTC) #17
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_linux64_rel_ng on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_rel_ng/builds/2994) v8_linux_arm64_rel on ...
4 years, 9 months ago (2016-03-16 11:48:59 UTC) #19
Yang
https://codereview.chromium.org/1785403002/diff/80001/src/isolate.h File src/isolate.h (right): https://codereview.chromium.org/1785403002/diff/80001/src/isolate.h#newcode190 src/isolate.h:190: for (; limit_check && loop_var < for_with_handle_limit; increment) { ...
4 years, 9 months ago (2016-03-16 12:16:10 UTC) #20
Yang
https://codereview.chromium.org/1785403002/diff/80001/src/isolate.h File src/isolate.h (right): https://codereview.chromium.org/1785403002/diff/80001/src/isolate.h#newcode190 src/isolate.h:190: for (; limit_check && loop_var < for_with_handle_limit; increment) { ...
4 years, 9 months ago (2016-03-16 12:16:41 UTC) #21
Camillo Bruni
https://codereview.chromium.org/1785403002/diff/80001/src/isolate.h File src/isolate.h (right): https://codereview.chromium.org/1785403002/diff/80001/src/isolate.h#newcode190 src/isolate.h:190: for (; limit_check && loop_var < for_with_handle_limit; increment) { ...
4 years, 9 months ago (2016-03-16 15:54:53 UTC) #22
Yang
LGTM with a comment. https://codereview.chromium.org/1785403002/diff/100001/src/isolate.h File src/isolate.h (right): https://codereview.chromium.org/1785403002/diff/100001/src/isolate.h#newcode185 src/isolate.h:185: loop_var_type for_with_handle_limit = 0; \ ...
4 years, 9 months ago (2016-03-17 08:56:45 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1785403002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1785403002/120001
4 years, 9 months ago (2016-03-17 12:17:58 UTC) #26
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 9 months ago (2016-03-17 12:41:43 UTC) #27
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/25d36eacf20f72bf6ba19b1475c0e4f56f95d1a2 Cr-Commit-Position: refs/heads/master@{#34856}
4 years, 9 months ago (2016-03-17 12:43:02 UTC) #29
Camillo Bruni
4 years, 9 months ago (2016-03-17 14:37:55 UTC) #30
Message was sent while issue was closed.
https://codereview.chromium.org/1785403002/diff/100001/src/isolate.h
File src/isolate.h (right):

https://codereview.chromium.org/1785403002/diff/100001/src/isolate.h#newcode185
src/isolate.h:185: loop_var_type for_with_handle_limit = 0;                     
         \
On 2016/03/17 at 08:56:45, Yang wrote:
> Wouldn't it be better to have
> loop_var_type for_with_handle_limit = loop_var
> here? In case loop_var is not initialized to 0.

ah right, that makes sense.

Powered by Google App Engine
This is Rietveld 408576698