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

Issue 311903004: Fixes to run "Hello, world!" on arm64 hardware. (Closed)

Created:
6 years, 6 months ago by zra
Modified:
6 years, 6 months ago
Reviewers:
regis
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Fixes to run "Hello, world!" on arm64 hardware. Primarily, in Dart code, instead of using R31 as our stack pointer, on entry we copy it into a second register (R18) and use that as our stack pointer after moving R31 to the Dart stack limit. On calling back into C++ from Dart code, R31 is restored, and R18 is cached in the callee-saved register R26. R=regis@google.com Committed: https://code.google.com/p/dart/source/detail?r=36930

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+561 lines, -483 lines) Patch
M runtime/vm/assembler_arm64.h View 20 chunks +29 lines, -29 lines 0 comments Download
M runtime/vm/assembler_arm64.cc View 3 chunks +3 lines, -10 lines 0 comments Download
M runtime/vm/assembler_arm64_test.cc View 163 chunks +353 lines, -327 lines 0 comments Download
M runtime/vm/constants_arm64.h View 6 chunks +14 lines, -14 lines 0 comments Download
M runtime/vm/cpuinfo.h View 1 chunk +5 lines, -2 lines 0 comments Download
M runtime/vm/cpuinfo_linux.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M runtime/vm/disassembler_arm64.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/intermediate_language_arm64.cc View 1 chunk +1 line, -3 lines 0 comments Download
M runtime/vm/isolate.h View 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/object_arm64_test.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M runtime/vm/runtime_entry_arm64.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/simulator_arm64.h View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/simulator_arm64.cc View 1 2 32 chunks +81 lines, -71 lines 0 comments Download
M runtime/vm/stub_code_arm64.cc View 15 chunks +60 lines, -21 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
zra
6 years, 6 months ago (2014-06-03 16:56:17 UTC) #1
regis
LGTM, but see my question about the system possibly trashing the stack. https://codereview.chromium.org/311903004/diff/1/runtime/vm/simulator_arm64.cc File runtime/vm/simulator_arm64.cc ...
6 years, 6 months ago (2014-06-03 17:38:22 UTC) #2
zra
https://codereview.chromium.org/311903004/diff/1/runtime/vm/simulator_arm64.cc File runtime/vm/simulator_arm64.cc (right): https://codereview.chromium.org/311903004/diff/1/runtime/vm/simulator_arm64.cc#newcode679 runtime/vm/simulator_arm64.cc:679: if ((instr != NULL) && (reg == R31) && ...
6 years, 6 months ago (2014-06-03 18:09:49 UTC) #3
zra
Committed patchset #3 manually as r36930 (presubmit successful).
6 years, 6 months ago (2014-06-03 18:38:36 UTC) #4
regis
6 years, 6 months ago (2014-06-03 18:52:15 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/311903004/diff/1/runtime/vm/stub_code_arm64.cc
File runtime/vm/stub_code_arm64.cc (right):

https://codereview.chromium.org/311903004/diff/1/runtime/vm/stub_code_arm64.c...
runtime/vm/stub_code_arm64.cc:823: __ LoadFromOffset(CSP, R5,
Isolate::stack_limit_offset(), PP);
On 2014/06/03 18:09:49, zra wrote:
> CSP is updated here to be the isolate's stack limit. Except for the frame
setup
> code above, the Dart stack pointer SP will never go below the system stack
> pointer. I could move this up before we use the stack to save the callee-saved
> registers, but since this arrangement hasn't caused problems, I thought it
would
> be best to perturb the frame setup code as little as possible.

I had missed this write to CSP. This is good. I would still protect the stack up
to this point by subtracting the frame size from CSP before the EnterFrame
above. An estimated size is good enough, i.e. a constant multiple of 16 and
larger than the size of all registers you are pushing.

To be safe, you should do the same in all tests copying CSP to SP. Maybe you
could have a new EnterFrame flavor (EnterSafeFrame?) that takes a size to
reserve. You could use it here too.

Powered by Google App Engine
This is Rietveld 408576698