Commit Graph

20 Commits

Author SHA1 Message Date
Samir Jindel 8cbb11cc55 [vm/ffi] FFI callbacks on ARM32.
Please see go/dart-ffi-callbacks for design context and motivation.

Change-Id: Ie5edcb8837157c679954a670fb19d545e22fec69
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try, vm-kernel-win-debug-ia32-try, vm-ffi-android-debug-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101828
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-06-03 14:36:04 +00:00
Vyacheslav Egorov 9e81e4bfe5 [vm/compiler] Move BlockBuilder from graph_intrinsifier.cc to a header.
This helper class can be used for building IL in SSA form. It was
previously used to build intrinsic IL, but it can also be used to
build IL for tests.

This move required introducing a constant that describes offset
of the last parameter from SP value on entry (kLastParamFrom

This CL also changes the meaning of ParameterInstr(index, SPREG) to be
[SP + index + kLastParamSlotFromEntrySp], where previously it was
something like [SP + (index - 1) + kLastParamSlotFromEntrySp].

Change-Id: Ib75ecb3a94f9cde74d6f91028d3cbea8f5e4bc42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98336
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-04-03 15:42:56 +00:00
Ryan Macnak 89ce54fe0e [vm] Visit the pool pointer slot of optimized frames; visit the object slots of exit frames.
We've been getting away with skipping this slot because
 - ObjectPools are allocated into old space and never move, and
 - the ObjectPools are also reachable from the PC marker in the caller's frame.

However, ObjectPools will become movable during compacting GCs.

Bug: https://github.com/dart-lang/sdk/issues/30978
Change-Id: Ied3a1588365fe5362ad7f1d2d446a7a59df6ced6
Reviewed-on: https://dart-review.googlesource.com/10680
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-10-12 03:47:15 +00:00
Ryan Macnak 9f2668c998 Set TARGET_OS_* from GN, falling back to HOST_OS_*.
Use TARGET_OS_* instead of HOST_OS_* to decide on the assembly variant to use. Allows, say, a gen_snapshot compiled for a Mac to target Android when generating AOT as assembly.

R=fschneider@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2757783003 .
2017-03-20 14:48:28 -07:00
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07:00
Ryan Macnak 85cdc0eac2 Don't assume we want the iOS ABI if running simarm on Mac and the EABI otherwise.
Allow controlling the target ABI by defining TARGET_ABI_IOS or TARGET_ABI_EABI.  If neither is defined, default to the previous behavior.

Make Linux, Mac, Android and iOS agree on the value of PreferredCodeAlignment for all architectures.

BUG=http://dartbug.com/26464
R=zra@google.com

Review URL: https://codereview.chromium.org/1982613003 .
2016-05-17 15:03:54 -07:00
Ryan Macnak d422888b46 Use the iOS ABI when running SIMARM on Mac or targeting iOS.
Linux / iOS
R7   preserved / FP
R9   preserved / volatile
R11  FP / preserved

BUG=http://dartbug.com/24683
R=zra@google.com

Review URL: https://codereview.chromium.org/1421253004 .
2015-10-27 14:36:38 -07:00
Ryan Macnak 91bc8005fe Don't touch x18 on ARM64 - it is globally reserved on iOS.
Move SP on ARM64 to x19.

Use a mask instead of a range for determining the globally blocked registers.

R=regis@google.com

Review URL: https://codereview.chromium.org/1417433002 .
2015-10-19 14:17:07 -07:00
Florian Schneider bac82e2592 VM: New calling convention for generated code.
Instead of calling code object directly, call indirectly and
pass the code object in a register. The object pool is then loaded from
the code object. This is another preparation step for making generated code
relocatable.

All non-ia32 platforms:
No entry patching.

ARM:
PC marker (now code object) moves to the same place as on x64 (below saved PP, above saved FP).
R9 is now used as PP, R10 as CODE_REG.

BUG=
R=koda@google.com, rmacnak@google.com

Committed: https://github.com/dart-lang/sdk/commit/1d343e5a7b75168fb6c9f86b64c55173cdbdc9b2

Review URL: https://codereview.chromium.org//1192103004 .
2015-09-19 13:21:09 +02:00
Florian Schneider 7af7a2db87 Revert "VM: New calling convention for generated code."
This reverts commit 1d343e5a7b.

Because of Windows test failures.

BUG=
TBR=whesse@google.com

Review URL: https://codereview.chromium.org//1343373003 .
2015-09-16 13:46:05 +02:00
Florian Schneider 1d343e5a7b VM: New calling convention for generated code.
Instead of calling code object directly, call indirectly and
pass the code object in a register. The object pool is then loaded from
the code object. This is another preparation step for making generated code
relocatable.

All non-ia32 platforms:
No entry patching.

ARM:
PC marker (now code object) moves to the same place as on x64 (below saved PP, above saved FP).
R9 is now used as PP, R10 as CODE_REG.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1192103004 .
2015-09-16 13:05:58 +02:00
koda@google.com c1008f15c0 Save top StackResource in entry frame.
This avoids relying on stack address order, which enables us to benefit from AddressSanitizer's detect_stack_use_after_return feature.

R=iposva@google.com

Review URL: https://codereview.chromium.org//944783002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43927 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-20 20:46:31 +00:00
fschneider@google.com 876193b31a Make CTX allocatable by the register allocator.
This change makes CTX available by not caching the current
context while in Dart code. Instead the current context
is held in a local variable (:saved_current_context_var) and
is passed as argument in CTX at calls.

This also simplifies a lot of code in the debugger: As a result,
Isolate::top_context is not needed anymore since the current context
can always be extracted from a Dart frame.

R=vegorov@google.com

Review URL: https://codereview.chromium.org//678763004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41422 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 15:42:38 +00:00
johnmccutchan@google.com 762b9a400c Set VMTag from stubs when transitioning between Dart and Native
R=asiva@google.com, zra@google.com

Review URL: https://codereview.chromium.org//200693002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34065 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-18 21:26:07 +00:00
asiva@google.com c0ddb83c3b ARM and MIPS changes which correspond to the initial change submitted in
https://codereview.chromium.org/63093003/

R=regis@google.com, zra@google.com

Review URL: https://codereview.chromium.org//62953014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30124 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-08 19:40:07 +00:00
asiva@google.com eaebf15f43 Fix for issue 14790 - Crash when using dartium devtools
The stack frame iteration during GC was missing one slot in stub frames that
did not save the pool pointer.

- This change makes all stub frames uniform, i.e they always save/restore the pool pointer. This ensures that we will traverse all slots on the stack.

- A new constant called kFirstObjectSlotFromFp has been added which is used as the slot to start stack traversal.

(The ARM and MIPs changes will be in a different CL)

R=iposva@google.com, regis@google.com, zra@google.com

Review URL: https://codereview.chromium.org//63093003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30088 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-08 00:25:40 +00:00
zra@google.com a783459837 Preserves callee-saved FPU registers on ARM
Preserves callee-saved FPU registers on ARM when
going from C++ to Dart code. Adds assertions to
the simulator to make sure this is being done
correctly.

R=regis@google.com

Review URL: https://codereview.chromium.org//23549013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27072 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 18:23:43 +00:00
regis@google.com 9e867eb4a1 Make deoptimization architecture dependent (it depends on the frame layout).
R=srdjan@google.com, zra@google.com

Review URL: https://codereview.chromium.org//15110003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22719 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-14 23:23:54 +00:00
regis@google.com 53347a3337 Remove stack_frame_<arch>.cc files.
The architecture specific information is in stack_frame_<arch>.h files.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//14925005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22470 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 18:06:21 +00:00
regis@google.com 880af693cf Introduce architecture specific headers describing Dart stack frames.
The actual cleanup will follow in another cl.

R=asiva@google.com

Review URL: https://codereview.chromium.org//14831004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22394 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 21:42:16 +00:00