Commit graph

45 commits

Author SHA1 Message Date
Samir Jindel 0ea0409401 [vm/ios] Don't use __clear_cache on iOS, it's not always available.
Change-Id: Ia80b543587b3dc265c4a4d97befff73d915ad2be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110560
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-08-01 14:14:39 +00:00
Samir Jindel c6f3d972b8 [vm] Support flushing icache on all ARM platforms.
Change-Id: Id6987dca1e284179096de3b74e7b537ca93bd2bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109701
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-07-19 15:56:09 +00:00
Liam Appelbe a6eb2cd309 [vm] Support for simarm_x64
Third sub-CL of https://dart-review.googlesource.com/c/sdk/+/100644
The first was here https://dart-review.googlesource.com/c/sdk/+/103487
The second was here https://dart-review.googlesource.com/c/sdk/+/104286

This is the last major CL to support simarm_x64. Now that the other two
CLs have put the required infrastructure in place, this CL actually
adds the new mode..

Bug: https://github.com/dart-lang/sdk/issues/36839
Change-Id: Ie2f850bf33544f2462f37854e762191c78b1bde6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105500
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-06-21 04:00:35 +00:00
William Hesse ed6d7e23f1 Fix build failure introduced in https://dart-review.googlesource.com/c/sdk/+/77013
A rename of an identifier "InitOnce" was missed.

Change-Id: I7b6bfea07ec3eaecf0486c5d20c33d4c6ff1d81a
Reviewed-on: https://dart-review.googlesource.com/77320
Reviewed-by: Jonas Termansen <sortie@google.com>
2018-10-01 08:30:42 +00:00
Ben Konyi 07852532e3 [ VM ] Additional cleanup in Dart_Initialize and Dart_Cleanup
Change-Id: I6dc02b3d9de16cc176eb97613bc0c7f0bb9b16eb
Reviewed-on: https://dart-review.googlesource.com/77013
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2018-09-28 23:18:59 +00:00
Ryan Macnak 8da46d35f5 [vm] Move heap-related code to its own subdirectory (cf. compiler).
Remove some dead includes.

Change-Id: I31f3e739e5ee46dcbba5d6a2f091491b46402943
Reviewed-on: https://dart-review.googlesource.com/60146
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-06-20 00:39:49 +00:00
Michael Goderbauer 29d6e96370 Use softfp on 32bit ARM for iOS
Change-Id: I20ef6c998649aa041639feab93d49166570c53f4
Reviewed-on: https://dart-review.googlesource.com/52524
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-24 23:07:38 +00:00
Vyacheslav Egorov 8a179fb953 [VM, Compiler] Move compiler to a separate folder.
New folder structure (nested under vm/):

- compiler/
-   jit/         - JIT specific code
-   aot/         - AOT specific code
-   backend/     - all middle-end and back-end code (IL, flow graph)
-   assembler/   - assemblers and disassemblers
-   frontend/    - front ends (AST -> IL, Kernel -> IL)

compiler/README.md would be the documentation root for the compiler
pipeline

Bug: https://github.com/dart-lang/sdk/issues/30575
Change-Id: I2dfd9688793bff737f7632ddc77fca766875ce36
Reviewed-on: https://dart-review.googlesource.com/2940
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-09-04 15:15:18 +00:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Erik Corry aa6353b6da Dart SDK Spelling b, c, and d.
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2850783002 .
2017-05-01 08:28:10 +02:00
Ryan Macnak 683077944b Conservatively disable use of integer division on Android ARM64 devices.
R=jsimmons@google.com

Review-Url: https://codereview.chromium.org/2800883002 .
2017-04-05 12:45:01 -07: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
Ryan Macnak 877284947b Rename TARGET_OS_* to HOST_OS_*.
Like HOST_ARCH_*, HOST_OS_* describes the OS the VM is running on, which may be different from the OS the VM is generating code for during AOT compilation.

Currently we conflate the two when emitting AOT as assembly, and we get away with it because Flutter only uses assembly for targeting iOS and one can only target iOS from a Mac, but we expect to use assembly for Android as well so native tools can unwind Dart frames.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2750843003 .
2017-03-15 13:11:05 -07:00
Ryan Macnak edb9c4205e Adjust ARM feature detection to note the Xiaomi MI5 also fails to support integer division in A32 code.
flutter/flutter#6901

R=zra@google.com

Review URL: https://codereview.chromium.org/2507113004 .
2016-11-17 14:42:17 -08:00
Ryan Macnak a01c637522 Make arm32 cpu detection recognize the DragonBoard as arm64.
R=zra@google.com

Review URL: https://codereview.chromium.org/2497273003 .
2016-11-14 16:55:25 -08:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Ryan Macnak 4d81fee396 Special case the Pixel as not supporting integer division for 32-bit ARM.
R=zra@google.com

Review URL: https://codereview.chromium.org/2477453006 .
2016-11-04 15:43:18 -07:00
Zachary Anderson e29da6037b Small cleanups and linter fixes.
Review URL: https://codereview.chromium.org/2455983002 .
2016-10-27 05:02:20 -07:00
Zachary Anderson 80f358dede Adds targets for simarmv6 and armv6
related #25562

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1624593002 .
2016-01-22 13:07:48 -08:00
Chinmay Garde dfd7c0b221 Fix CPU features detection and stack alignment assert on iOS
R=zra@google.com

Review URL: https://codereview.chromium.org/1413643004 .
2015-10-27 14:23:36 -07:00
Chinmay Garde 52d8128b4e Avoid compilation errors when the dart_target_arch is TARGET_ARCH_ARM
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1424783002 .
2015-10-26 15:39:14 -07:00
Zachary Anderson ccc7786362 Adds a special case for Marvell Armada 370/XP ARM CPUs
It reports availability of integer division instructions, but these
instructions trigger SIGILL faults.

BUG=https://github.com/dart-lang/sdk/issues/24466
R=regis@google.com

Review URL: https://codereview.chromium.org/1391313002 .
2015-10-07 15:56:41 -07:00
Ivan Posva 8f1506e817 - Determine whether the simulator is being used in globals.h
- Make sure to switch on HOST_ARCH_ and on USING_SIMULATOR
  where appropriate.
- Avoid allocating in new generation when running in the VM isolate.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1156053006
2015-05-29 14:35:29 -07:00
zra@google.com c90248c51d Adds comments about ARM versions.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45242 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 16:42:32 +00:00
zra@google.com 86bfd7cb30 Adds a simarmv5te build and test target.
Also:
- Removes command line flags to choose simulated arm version.
  I think we should use build targets instead, like in this change,
  to make building and testing more obvious.
- Skips pkg tests on all simulators.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45181 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 20:44:43 +00:00
zra@google.com b253b7c2ba A few fixes for ARMv5TE.
This CL:
- Adds SupportsHardwareDivision() to FlowGraphCompiler.
  In FlowGraphOptimizer, if SupportsHardwareDivision()
  is false, Smi and Mint division operations are not
  inlined.
- Reduces the supported addressing modes for ldrd, strd.
  For ARMv6 and up, the address only needs to be 4-byte
  aligned, for ARMv5TE and below the address must be
  8-byte aligned. So, on ARMv5TE, we can split these
  each into two instructions, which is easier to do if
  the addressing modes are restricted to base + offset,
  which is all we were using anyway.
- Uses the smull instruction on ARMv5TE and ARMv6. I don't
  remember why it was disabled, and the docs say
  it is supported. Verified working on ARMv5TE hardware.
- Fixes a bug in OSR frame entry caused by the
  difference between the PC read offset in store vs.
  other instructions.
- Fixes assembler tests that have a float return for
  targets without vfp.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44788 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-30 20:46:52 +00:00
zra@google.com 210085919e Allows arm cpu feature detection to detect arm64 cpus.
This is probalby of limited utility since we have an
arm64 port, but it could be interesting for performance
experiments, etc.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40678 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-25 14:37:57 +00:00
zra@google.com c816b999bf Adds recognition of the model string for the DGBox.
Even though it is an ARMv5TE like the mindstorm, I'm
creating a separate case for it since store_pc_read_offset_
may need to be different.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39566 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 20:38:09 +00:00
zra@google.com 5d3f4708ec Fixes to support ARMv5 lego mindstorm.
1. Deopts on division when neither vfp nor idiv are present.
   In a subsequent CL, I can add a leaf runtime call for this.

2. Uses a different PC read offset in STR and STM instructions.
   On ARMv5 and earlier, the PC read offset is 8 except in STR
   and STM instructions, where it is implementation defined. On
   lego mindstorm it is 12. This requires changing
   kEntryPointToPcMarkerOffset to be a function.

3. Uses a dummy struct to compute the size of a compressed
   pc descriptor to avoid alignment issues. sizeof(PcDescriptorRec)
   is 16 on ia32 and arm. Subtracting sizeof(int16_t) gives 14,
   which creates alignment problems on ARM, i.e. poor performance on
   ARMv6 and later, and wrong results on ARMv5 and earlier.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39250 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 15:42:00 +00:00
iposva@google.com 14ecdbd66a - Separate the thread implementation used in bin/ and vm/
to allow us to make VM specific changes.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39172 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 23:19:53 +00:00
zra@google.com 0c562fdd16 For arm, chooses hard vs. soft fp ABI based on compiler.
We have been hard-coding hardfp in the gyp file. This makes
using softfp hard. This change detects hardfp by looking at
a predefined gcc macro, and otherwise uses softfp. This
change also adds a flag to simarm so that we can test softfp.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36337 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-19 23:13:25 +00:00
zra@google.com b39bcf7bf6 Allows unboxed doubles to be disabled.
This helps to support ARMv5TE. Also adds asserts to
ensure that neon and vfp instructions are not generated
when those features are disabled on ARM.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36262 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-16 17:17:52 +00:00
zra@google.com 7c91e88e6e Adds support for ARMv6.
When we detect ARMv6, instead of using movw and
movt, this change loads each individual byte.
Although this is not the best way to achieve this,
a modification to store large constants in the
object pool would be more invasive. Further,
this change will be easier to back-out once
ARMv6 is obsolete.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33442 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 19:17:36 +00:00
iposva@google.com 6a75657c76 - Sort out confusion between malloc/free and new/delete.
Review URL: https://codereview.chromium.org//182883002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33110 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-27 09:33:44 +00:00
zra@google.com fd366da1cf Updates refactoring of CPU feature detection
with fix that uses cpuid for Intel/Linux.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32980 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-24 19:28:30 +00:00
zra@google.com 3693beeb6b Reverts refactoring of CPU feature detection for
assertion failure in Dartium.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32560 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-11 16:05:43 +00:00
zra@google.com 6f2096face Refactors some CPU feature detection into new class CpuInfo, and uses new information in VM service.
This change rewrites the code from the ARM assembler for parsing /proc/cpuinfo on Linux and Android, and collects it into a CpuInfo class that can be used for other architectures as well. This code is in cpuinfo_*.cc. /proc/cpuinfo equivalents are used for Mac and Windows. CpuInfo is used by the VM service to report on the hardware dart is running on. In the future CpuInfo can also be used here to provide more information.

R=iposva@google.com, johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32468 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-08 22:27:27 +00:00
zra@google.com 974d4f1392 Use the methods recommended by ARM to flush ICache.
This allows us to remove selecting different versions of
inline assembly depending on ABI, thumb, etc. in our code.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28378 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-08 20:42:43 +00:00
iposva@google.com c3c942407b Fix dartbug.com/10415:
- Append 'on "$os_$arch"' to the version string on the VM.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22452 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 07:59:03 +00:00
asiva@google.com f05e3736d8 Fix issue 1968, replace usage of inline 'asm' constructs in 'stack alignment', 'jump to exception handler' and 'jump to error handler' code with calls to appropriate stubs.
Review URL: https://chromiumcodereview.appspot.com//10664004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9071 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 17:35:20 +00:00
turnidge@google.com 0ddd4c04e9 Dart_PropagateError, take 2.
This change hopefully takes care of the non-mac build issues.  The
checked mode failures are fixed in a separate cl.
Review URL: https://chromiumcodereview.appspot.com//9316071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3863 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 19:05:06 +00:00
turnidge@google.com ae88492093 Revert Dart_PropagateError until I can track down the problems in
checked mode tests.

Sorry for the hubbub.
Review URL: https://chromiumcodereview.appspot.com//9314053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3823 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 23:39:28 +00:00
turnidge@google.com 9da62c5fea Add Dart_PropagateError.
This function can be used in native functions to properly pass all
errors up the stack.

Set the long jump base in the Compiler instead of outside of the
compiler.  A bunch of errors that used to be propagated through the
sticky_error are now propagated through return values.  This includes
all of the DartEntry and DartLibraryCall functions.

In particular, we no longer use the long jump to cross dart frames.
Instead errors are propagated across dart frames using the same
mechanism that we use for unhandled exceptions.  I've added assertions
to make sure that we only use the long jump when it is "safe".
Review URL: https://chromiumcodereview.appspot.com//9169102

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3815 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 22:34:16 +00:00
regis@google.com 2d1f63af47 Port a couple more stubs to x64.
Fix integer implementation issues.
Enable all tests on x64.
Review URL: http://codereview.chromium.org//9114054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3307 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 20:07:54 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00