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

Issue 1037453002: Split Thread/Isolate instances, but still maintain 1:1 relationship. (Closed)

Created:
5 years, 9 months ago by koda
Modified:
5 years, 9 months ago
Reviewers:
siva, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Split Thread/Isolate instances, but still maintain 1:1 relationship. The life cycle of Thread is still coupled with the life cycle of Isolate, but the added indirection allows the migration work to proceed, at negligible performance impact. This is a small step towards making Thread different from Isolate and allow a many-to-one relationship. In particular, in prepares for being able to have the sweeper have some minimal separate state from the main thread (eliminating the current fake-isolate hack). Concretely, it moves the thread-local storage key into the Thread class, but for now, keeps a "main_thread" in Isolate for quick access in native/runtime_entry. Also moves cha_ field to Thread (the first of many fields that will move). To summarize, this CL enables the next steps: - moving other fields from Isolate to Thread without circular include-dependencies - replacing sweeper's fake Isolate with a helper Thread (referencing the original Isolate) Also add 'volatile' to local variables that clang thinks could be clobbered. R=asiva@google.com Committed: https://code.google.com/p/dart/source/detail?r=44703

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -57 lines) Patch
M runtime/vm/base_isolate.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/compiler.cc View 1 2 3 4 5 7 chunks +7 lines, -7 lines 4 comments Download
M runtime/vm/dart.cc View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/isolate.h View 1 2 3 4 5 5 chunks +16 lines, -9 lines 2 comments Download
M runtime/vm/isolate.cc View 1 7 chunks +15 lines, -15 lines 0 comments Download
M runtime/vm/native_entry.h View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/runtime_entry.h View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/thread.h View 1 2 3 4 5 1 chunk +24 lines, -24 lines 1 comment Download
A runtime/vm/thread.cc View 1 2 3 4 1 chunk +30 lines, -0 lines 0 comments Download
M runtime/vm/vm_sources.gypi View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
koda
5 years, 9 months ago (2015-03-24 20:31:53 UTC) #1
siva
LGTM. As discussed offline we need to make the Thread structure associated to the underlying ...
5 years, 9 months ago (2015-03-25 21:26:34 UTC) #2
koda
https://codereview.chromium.org/1037453002/diff/100001/runtime/vm/compiler.cc File runtime/vm/compiler.cc (right): https://codereview.chromium.org/1037453002/diff/100001/runtime/vm/compiler.cc#newcode181 runtime/vm/compiler.cc:181: Isolate* volatile isolate = Isolate::Current(); On 2015/03/25 21:26:34, siva ...
5 years, 9 months ago (2015-03-25 21:49:48 UTC) #3
koda
Committed patchset #6 (id:100001) manually as r44703 (presubmit successful).
5 years, 9 months ago (2015-03-25 22:41:44 UTC) #4
Ivan Posva
5 years, 9 months ago (2015-03-26 14:36:53 UTC) #6
Message was sent while issue was closed.
Thanks,
-Ivan

https://codereview.chromium.org/1037453002/diff/100001/runtime/vm/compiler.cc
File runtime/vm/compiler.cc (right):

https://codereview.chromium.org/1037453002/diff/100001/runtime/vm/compiler.cc...
runtime/vm/compiler.cc:181: Isolate* volatile isolate = Isolate::Current();
On 2015/03/25 21:49:47, koda wrote:
> On 2015/03/25 21:26:34, siva wrote:
> > What is the rationale for adding the 'volatile' keyword?
> 
> Without it, some compilers issue a warning about this local possibly being
> clobbered between the setjmp/longjmp. However, I believe this warning is
> unfounded, since the spec says this only happens if the local is actually
> modified between the setjmp and longjmp, which is not the case here.
> 
> We already have a similar issue in flow_graph_inliner.cc:
>
https://github.com/dart-lang/bleeding_edge/blob/master/dart/runtime/vm/flow_g...

Please make this local a const, which it really is. That should remove the
warnings without the unclear meaning of volatile here.

https://codereview.chromium.org/1037453002/diff/100001/runtime/vm/compiler.cc...
runtime/vm/compiler.cc:282: Isolate* volatile isolate = Isolate::Current();
ditto

https://codereview.chromium.org/1037453002/diff/100001/runtime/vm/thread.h
File runtime/vm/thread.h (right):

https://codereview.chromium.org/1037453002/diff/100001/runtime/vm/thread.h#ne...
runtime/vm/thread.h:45: static ThreadLocalKey thread_key;
thread_key_

Powered by Google App Engine
This is Rietveld 408576698