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

Issue 1858143003: Get rid of UnsafeCurrent in Sampler (Closed)

Created:
4 years, 8 months ago by lpy
Modified:
4 years, 8 months ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Get rid of UnsafeCurrent in Sampler Currently we are using UnsafeCurrent in async signal handler to acquire the isolate of VM thread, but we want to get rid of that since it prevents V8 from being thread agnostic. This patch replaces UnsafeCurrent with a static map, where we store a map of samplers for threads, and makes it accessible by signal handler. BUG=v8:4889 LOG=n Committed: https://crrev.com/62fb4775fea0d56d8a175baf1d902213f6752168 Cr-Commit-Position: refs/heads/master@{#35541}

Patch Set 1 #

Total comments: 1

Patch Set 2 : #

Patch Set 3 : Use atomic-utils.h #

Patch Set 4 : Update check-static-initializers.sh #

Total comments: 6

Patch Set 5 : Address fadi's comments #

Total comments: 28

Patch Set 6 : Address alph's comment #

Total comments: 9

Patch Set 7 : #

Total comments: 8

Patch Set 8 : Address aplh's comments. #

Patch Set 9 : #

Total comments: 5

Patch Set 10 : #

Total comments: 4

Patch Set 11 : Address Yang's comments #

Patch Set 12 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+186 lines, -24 lines) Patch
M src/isolate.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -8 lines 0 comments Download
M src/profiler/sampler.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -0 lines 0 comments Download
M src/profiler/sampler.cc View 1 2 3 4 5 6 7 8 9 10 15 chunks +178 lines, -16 lines 0 comments Download

Messages

Total messages: 36 (10 generated)
fmeawad
https://codereview.chromium.org/1858143003/diff/1/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/1/src/profiler/sampler.cc#newcode266 src/profiler/sampler.cc:266: bool is_block) Try to the the v8 base version ...
4 years, 8 months ago (2016-04-05 21:25:52 UTC) #2
fmeawad
https://codereview.chromium.org/1858143003/diff/60001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/60001/src/profiler/sampler.cc#newcode263 src/profiler/sampler.cc:263: template <typename T> I do not think you need ...
4 years, 8 months ago (2016-04-06 20:07:57 UTC) #3
fmeawad
https://codereview.chromium.org/1858143003/diff/60001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/60001/src/profiler/sampler.cc#newcode263 src/profiler/sampler.cc:263: template <typename T> On 2016/04/06 20:07:56, fmeawad wrote: > ...
4 years, 8 months ago (2016-04-06 20:13:34 UTC) #4
lpy
Thanks, I updated the CL. +alph@ for review. PTAL. https://codereview.chromium.org/1858143003/diff/60001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/60001/src/profiler/sampler.cc#newcode282 src/profiler/sampler.cc:282: ...
4 years, 8 months ago (2016-04-06 20:19:58 UTC) #6
alph
https://codereview.chromium.org/1858143003/diff/80001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/80001/src/profiler/sampler.cc#newcode243 src/profiler/sampler.cc:243: class ThreadSamplersPair { Is it possible to use std::pair? ...
4 years, 8 months ago (2016-04-06 22:21:26 UTC) #7
lpy
Thanks, I updated the CL. PTAL. https://codereview.chromium.org/1858143003/diff/80001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/80001/src/profiler/sampler.cc#newcode243 src/profiler/sampler.cc:243: class ThreadSamplersPair { ...
4 years, 8 months ago (2016-04-06 23:51:38 UTC) #8
alph
Some more comments. Thanks for extracting this part from the large patch! https://codereview.chromium.org/1858143003/diff/80001/src/profiler/sampler.cc File src/profiler/sampler.cc ...
4 years, 8 months ago (2016-04-07 00:40:10 UTC) #10
lpy
Thanks, I updated the CL. PTAL. https://codereview.chromium.org/1858143003/diff/100001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/100001/src/profiler/sampler.cc#newcode245 src/profiler/sampler.cc:245: explicit AtomicGuard(AtomicValue<int>* atomic, ...
4 years, 8 months ago (2016-04-07 15:13:54 UTC) #11
alph
https://codereview.chromium.org/1858143003/diff/100001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/100001/src/profiler/sampler.cc#newcode798 src/profiler/sampler.cc:798: for (HashMap::Entry *p = SamplerThread::thread_id_to_samplers_.Start(); On 2016/04/07 15:13:54, lpy ...
4 years, 8 months ago (2016-04-07 22:38:17 UTC) #12
lpy
Thanks for the feedback, I made some updates. PTAL. https://codereview.chromium.org/1858143003/diff/120001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/120001/src/profiler/sampler.cc#newcode245 src/profiler/sampler.cc:245: ...
4 years, 8 months ago (2016-04-07 23:19:19 UTC) #13
lpy
https://codereview.chromium.org/1858143003/diff/160001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/160001/src/profiler/sampler.cc#newcode276 src/profiler/sampler.cc:276: #if V8_OS_MACOSX The reason I used this macro, is ...
4 years, 8 months ago (2016-04-08 00:24:40 UTC) #15
fmeawad
https://codereview.chromium.org/1858143003/diff/160001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/160001/src/profiler/sampler.cc#newcode276 src/profiler/sampler.cc:276: #if V8_OS_MACOSX On 2016/04/08 00:24:39, lpy wrote: > The ...
4 years, 8 months ago (2016-04-08 16:08:48 UTC) #16
fmeawad
https://codereview.chromium.org/1858143003/diff/160001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/160001/src/profiler/sampler.cc#newcode276 src/profiler/sampler.cc:276: #if V8_OS_MACOSX On 2016/04/08 16:08:48, fmeawad wrote: > On ...
4 years, 8 months ago (2016-04-08 16:10:16 UTC) #17
lpy
On 2016/04/08 16:10:16, fmeawad wrote: > https://codereview.chromium.org/1858143003/diff/160001/src/profiler/sampler.cc > File src/profiler/sampler.cc (right): > > https://codereview.chromium.org/1858143003/diff/160001/src/profiler/sampler.cc#newcode276 > ...
4 years, 8 months ago (2016-04-08 16:22:16 UTC) #18
alph
lgtm https://codereview.chromium.org/1858143003/diff/160001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/160001/src/profiler/sampler.cc#newcode471 src/profiler/sampler.cc:471: if (sampler == NULL || (!sampler->IsProfiling() && !sampler->IsRegistered())) ...
4 years, 8 months ago (2016-04-12 21:27:45 UTC) #19
lpy
Thanks for the review. +jochen@ for review. https://codereview.chromium.org/1858143003/diff/160001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/160001/src/profiler/sampler.cc#newcode471 src/profiler/sampler.cc:471: if (sampler ...
4 years, 8 months ago (2016-04-12 21:40:02 UTC) #21
jochen (gone - plz use gerrit)
Yang, could you have a look please?
4 years, 8 months ago (2016-04-14 13:51:29 UTC) #23
jochen (gone - plz use gerrit)
can you please use a lazy initializer instead of adding a static initializer? and can ...
4 years, 8 months ago (2016-04-14 13:58:11 UTC) #24
lpy
On 2016/04/14 13:58:11, jochen - slow wrote: > can you please use a lazy initializer ...
4 years, 8 months ago (2016-04-14 22:30:36 UTC) #25
Yang
lgtm https://codereview.chromium.org/1858143003/diff/180001/src/profiler/sampler.cc File src/profiler/sampler.cc (right): https://codereview.chromium.org/1858143003/diff/180001/src/profiler/sampler.cc#newcode471 src/profiler/sampler.cc:471: if (sampler == NULL || (!sampler->IsProfiling() && !sampler->IsRegistered())) ...
4 years, 8 months ago (2016-04-15 05:35:53 UTC) #26
lpy
Thank you for the review. I updated the CL. Anyone else I should ask for ...
4 years, 8 months ago (2016-04-15 05:57:53 UTC) #27
jochen (gone - plz use gerrit)
lgtm
4 years, 8 months ago (2016-04-15 12:04:41 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1858143003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1858143003/220001
4 years, 8 months ago (2016-04-15 16:59:49 UTC) #31
commit-bot: I haz the power
Committed patchset #12 (id:220001)
4 years, 8 months ago (2016-04-15 18:06:51 UTC) #33
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/62fb4775fea0d56d8a175baf1d902213f6752168 Cr-Commit-Position: refs/heads/master@{#35541}
4 years, 8 months ago (2016-04-15 18:08:41 UTC) #35
Michael Achenbach
4 years, 8 months ago (2016-04-16 06:30:36 UTC) #36
Message was sent while issue was closed.
A revert of this CL (patchset #12 id:220001) has been created in
https://codereview.chromium.org/1897673002/ by machenbach@chromium.org.

The reason for reverting is: [Sheriff] Breaks tsan:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20TSAN/builds/8999.

Powered by Google App Engine
This is Rietveld 408576698