Commit Graph

21 Commits

Author SHA1 Message Date
Alexander Markov 5aead50245 [vm] Implement more efficient CAS in simarm/simarm64 modes, v.2
This CL includes db26c89347 (patch set #1)
with fix (patch set #2):
* Include simulator.h explicitly where it is required as it is no
  longer included implicitly through other header files.

Original review: https://codereview.chromium.org/2995803002/

When running on the simulator for arm/arm64, compare-and-swap operations
used in VM were synchronized with simulator using mutex.
It heavily impacts performance when doing parallel marking due to high
contention (see #30317).
This synchronization was implemented in order to make simulated
LDREX/STREX instructions aware of CAS performed in VM.

This CL drops this synchronization between VM and simulator:
CAS operations in VM become regular, and simulator remembers value loaded
with load-exclusive and performs CAS when doing store-exclusive to catch
any concurrent modifications.

Speeds up gen_snapshot of flutter benchmark complex_layout from 9.2s
to 8.0s on my MacBook.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2999853002 .
2017-08-14 11:10:29 -07:00
Alexander Markov 0ffe7148b8 Revert "[vm] Implement more efficient CAS in simarm/simarm64 modes"
This reverts commit db26c89347.

Review-Url: https://codereview.chromium.org/3000803003 .
2017-08-11 17:51:50 -07:00
Alexander Markov db26c89347 [vm] Implement more efficient CAS in simarm/simarm64 modes
When running on the simulator for arm/arm64, compare-and-swap operations
used in VM were synchronized with simulator using mutex.
It heavily impacts performance when doing parallel marking due to high
contention (see #30317).
This synchronization was implemented in order to make simulated
LDREX/STREX instructions aware of CAS performed in VM.

This CL drops this synchronization between VM and simulator:
CAS operations in VM become regular, and simulator remembers value loaded
with load-exclusive and performs CAS when doing store-exclusive to catch
any concurrent modifications.

Speeds up gen_snapshot of flutter benchmark complex_layout from 9.2s
to 8.0s on my MacBook.

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

Review-Url: https://codereview.chromium.org/2995803002 .
2017-08-11 17:36:10 -07: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
Zachary Anderson ac16656161 Remove MIPS support
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2858623002 .
2017-06-22 08:49:22 -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
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
John McCutchan b961fc01ad Fix bad commit of stale patch set of original CL "Make NoReloadScope thread safe" (https://codereview.chromium.org/2344193002/)
BUG=

Review URL: https://codereview.chromium.org/2344263002 .
2016-09-16 11:33:43 -07:00
Florian Schneider 8cd73fd94c Revert "Add new atomic operations and use them in two places."
This reverts commit 27863288db.

Cross ARM and Windows build failing.

TBR=rmacnak@google.com,

Review URL: https://codereview.chromium.org/2178693002 .
2016-07-22 15:54:24 -07:00
Florian Schneider 27863288db Add new atomic operations and use them in two places.
1. Setting the IC data array.  This may have caused corrupt IC data seen by the
 background compiler when cloning IC data.

2. Reading the thread_interrupt_disabled_ flag. This was reported as a race with TSAN.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2176803003 .
2016-07-22 15:40:54 -07:00
Vyacheslav Egorov ee0f608ce4 Dart Byte Code interpreter.
This version is Clang/GCC only and does not support Windows because it uses computed goto's.

Only unoptimized mode is supported.

Architecture is described in constants_dbc.h and stack_frame_dbc.h.

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

Review URL: https://codereview.chromium.org/1858283002 .
2016-04-18 23:02:01 +02:00
Ryan Macnak 6304582145 Shuffle fields to make simarm and arm agree on the offset of Heap::new_space_.top_.
Fix non-simulated mips build.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1883053002 .
2016-04-14 09:50:33 -07:00
Srdjan Mitrovic 1a9fc8b2fa Move CompilerStats from isolate to thread. Aggregate stats.
The mutator thread holds the aggregate values, the background compiler adds its value to it.

BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org/1841213003 .
2016-03-30 13:38:32 -07:00
Siva Annamalai bf5d8f6efc Change signature of atomic increment/decrement functions to return void.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1658983004 .
2016-02-03 09:15:35 -08:00
Siva Annamalai 7e05c6c1f0 Use atomic operations to increment/decrement memory usage counts as multiple threads could be allocating at the same time.
Review URL: https://codereview.chromium.org/1580813003 .
2016-01-29 12:46:22 -08:00
Siva Annamalai a7ebeb00fb Add a CompareAndSwapUint32 variant to AtomicOperations so that it is possible to a CAS of a 32 bit value.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1562253002 .
2016-01-06 17:08:31 -08:00
Daniel Andersson e7fb1c8516 Compatible atomics: volatile for LoadRelaxed, replace FetchAndAdd with FetchAndDecrement.
Using volatile on a word size location will generate a single move instruction without order guarantees and is supported on all compilers.

Replace FetchAndAdd with FetchAndDecrement, since the latter is sufficient and eaiser to implement portably (in particular on some Windows setups).

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

Review URL: https://codereview.chromium.org//1287853005 .
2015-08-13 09:21:38 -07:00
Daniel Andersson 071ea16620 Use memcpy for Atomic::LoadRelaxed.
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1285923003 .
2015-08-11 13:52:07 -07:00
Daniel Andersson 086329fd9c Safe and efficient stack-limit based interrupt checking in C++.
Remove potentially dangerous (but currently unused) Isolate::stack_limit() accessor.
Add method to test whether interrupts are scheduled, using relaxed memory ordering.
Document and test correct usage by adding a new unit test.

This will be used to periodically check for safepoints in C++ (which will then be equivalent to our generated code).

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1277473004 .
2015-08-11 12:37:57 -07:00
iposva@google.com 55357d2993 - Use the simulator to do atomic operations that could also
be executed in generated code.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41332 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 19:21:33 +00:00
iposva@google.com 50652300dc - Add AtomicOperations::CompareAndSwapWord
- Make AtomicOperations inlineable.
- Use atomic tag word updates from C++ where necessary.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39731 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-01 18:18:44 +00:00