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

Issue 1156593002: Cache current thread in a reserved register and use it in LoadIsolate (Closed)

Created:
5 years, 7 months ago by koda
Modified:
5 years, 7 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Ivan Posva
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Cache current thread in a reserved register and use it in LoadIsolate Add THR register that caches the current thread in generated code. Shuffle some registers around as needed to free one up. Note: Assembler::LoadIsolate now always loads the *current* isolate whenever the code is executed, rather than the isolate in which the code was compiled (no existing code was affected by this slight change in semantics). Rewrite some ia32 stubs to use one less register, and for some ia32 bigint intrinsics, explicitly save THR (like CTX in the past, see r44699). Next steps: - pass current thread rather than isolate in NativeArguments - ditto for exception handler jump - migrate fields vm_tag, top_exit_frame_info, etc. to thread R=srdjan@google.com Committed: https://github.com/dart-lang/sdk/commit/fd890f4097a8c52652e0e3bf3ba22f77d69904f0

Patch Set 1 #

Patch Set 2 : Ready for review. #

Patch Set 3 : Added more comments. #

Total comments: 4

Patch Set 4 : Address review comments. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+290 lines, -187 lines) Patch
M runtime/vm/assembler_arm.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/assembler_arm64.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/assembler_arm64_test.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M runtime/vm/assembler_arm_test.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M runtime/vm/assembler_ia32.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/assembler_ia32.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/assembler_ia32_test.cc View 1 chunk +6 lines, -3 lines 0 comments Download
M runtime/vm/assembler_mips.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/assembler_mips_test.cc View 1 1 chunk +6 lines, -3 lines 0 comments Download
M runtime/vm/assembler_test.cc View 3 chunks +10 lines, -8 lines 0 comments Download
M runtime/vm/assembler_x64.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/assembler_x64_test.cc View 2 chunks +3 lines, -0 lines 0 comments Download
M runtime/vm/constants_arm.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/constants_arm64.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/constants_ia32.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/constants_mips.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/constants_x64.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/dart_entry.h View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/dart_entry.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M runtime/vm/flow_graph_allocator.cc View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 chunk +1 line, -0 lines 3 comments Download
M runtime/vm/flow_graph_compiler_arm.cc View 6 chunks +21 lines, -21 lines 0 comments Download
M runtime/vm/intermediate_language_arm.cc View 3 chunks +5 lines, -5 lines 0 comments Download
M runtime/vm/intrinsifier_arm.cc View 1 2 3 15 chunks +28 lines, -27 lines 0 comments Download
M runtime/vm/intrinsifier_ia32.cc View 13 chunks +63 lines, -25 lines 0 comments Download
M runtime/vm/isolate.h View 1 1 chunk +5 lines, -1 line 0 comments Download
M runtime/vm/stub_code_arm.cc View 1 8 chunks +29 lines, -23 lines 0 comments Download
M runtime/vm/stub_code_arm64.cc View 1 3 chunks +7 lines, -1 line 0 comments Download
M runtime/vm/stub_code_ia32.cc View 1 18 chunks +50 lines, -45 lines 0 comments Download
M runtime/vm/stub_code_mips.cc View 1 3 chunks +7 lines, -0 lines 0 comments Download
M runtime/vm/stub_code_x64.cc View 1 8 chunks +19 lines, -13 lines 0 comments Download
M runtime/vm/thread.h View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (1 generated)
koda
5 years, 7 months ago (2015-05-22 02:39:40 UTC) #2
srdjan
lgtm https://codereview.chromium.org/1156593002/diff/40001/runtime/vm/intrinsifier_arm.cc File runtime/vm/intrinsifier_arm.cc (right): https://codereview.chromium.org/1156593002/diff/40001/runtime/vm/intrinsifier_arm.cc#newcode27 runtime/vm/intrinsifier_arm.cc:27: // The FP register should not be modified, ...
5 years, 7 months ago (2015-05-26 20:10:44 UTC) #3
koda
https://codereview.chromium.org/1156593002/diff/40001/runtime/vm/intrinsifier_arm.cc File runtime/vm/intrinsifier_arm.cc (right): https://codereview.chromium.org/1156593002/diff/40001/runtime/vm/intrinsifier_arm.cc#newcode27 runtime/vm/intrinsifier_arm.cc:27: // The FP register should not be modified, because ...
5 years, 7 months ago (2015-05-26 20:29:12 UTC) #4
koda
Committed patchset #4 (id:60001) manually as fd890f4097a8c52652e0e3bf3ba22f77d69904f0 (presubmit successful).
5 years, 7 months ago (2015-05-26 20:46:18 UTC) #5
Florian Schneider
https://codereview.chromium.org/1156593002/diff/60001/runtime/vm/flow_graph_compiler.cc File runtime/vm/flow_graph_compiler.cc (right): https://codereview.chromium.org/1156593002/diff/60001/runtime/vm/flow_graph_compiler.cc#newcode1514 runtime/vm/flow_graph_compiler.cc:1514: | MaskBit(PP); You need to add THR to the ...
5 years, 7 months ago (2015-05-27 08:09:09 UTC) #6
koda
https://codereview.chromium.org/1156593002/diff/60001/runtime/vm/flow_graph_compiler.cc File runtime/vm/flow_graph_compiler.cc (right): https://codereview.chromium.org/1156593002/diff/60001/runtime/vm/flow_graph_compiler.cc#newcode1514 runtime/vm/flow_graph_compiler.cc:1514: | MaskBit(PP); On 2015/05/27 08:09:09, Florian Schneider wrote: > ...
5 years, 7 months ago (2015-05-27 13:41:43 UTC) #7
Florian Schneider
On 2015/05/27 13:41:43, koda wrote: > https://codereview.chromium.org/1156593002/diff/60001/runtime/vm/flow_graph_compiler.cc > File runtime/vm/flow_graph_compiler.cc (right): > > https://codereview.chromium.org/1156593002/diff/60001/runtime/vm/flow_graph_compiler.cc#newcode1514 > ...
5 years, 7 months ago (2015-05-27 13:57:36 UTC) #8
srdjan
5 years, 7 months ago (2015-05-27 15:09:39 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/1156593002/diff/60001/runtime/vm/flow_graph_c...
File runtime/vm/flow_graph_compiler.cc (right):

https://codereview.chromium.org/1156593002/diff/60001/runtime/vm/flow_graph_c...
runtime/vm/flow_graph_compiler.cc:1514: | MaskBit(PP);
On 2015/05/27 13:41:42, koda wrote:
> On 2015/05/27 08:09:09, Florian Schneider wrote:
> > You need to add THR to the blocked_mask here as well. Otherwise the parallel
> > move resolver may use it as scratch register.
> 
> Thanks for catching this. That all tests still passed in debug mode makes me
> worried about our test coverage. Any suggestions for how to write a good
> regression test?
> 
> For the record, this is the fix:
> https://codereview.chromium.org/1158943002/

You may want to run all tests with --optimization-counyter-threshold=10 (we do
it on bots) which would stress the register allocation more, and maybe catch the
issue.

Powered by Google App Engine
This is Rietveld 408576698