Commit graph

14 commits

Author SHA1 Message Date
Vyacheslav Egorov f496e538f4 [vm] Decouple assemblers from runtime.
This is the next step towards preventing compiler from directly peeking
into runtime and instead interact with runtime through a well defined
surface. The goal of the refactoring to locate all places where compiler
accesses some runtime information and partion those accesses into two
categories:

- creating objects in the host runtime (e.g. allocating strings, numbers, etc)
during compilation;
- accessing properties of the target runtime (e.g. offsets of fields) to
embed those into the generated code;

This change introduces dart::compiler and dart::compiler::target namespaces.

All code in the compiler will gradually be moved into dart::compiler namespace.
One of the motivations for this change is to be able to prevent access to
globally defined host constants like kWordSize by shadowing them in the
dart::compiler namespace.

The nested namespace dart::compiler::target hosts all information about
target runtime that compiler could access, e.g. compiler::target::kWordSize
defines word size of the target which will eventually be made different
from the host kWordSize (defined by dart::kWordSize).

The API for compiler to runtime interaction is placed into compiler_api.h.

Note that we still permit runtime to access compiler internals directly -
this is not going to be decoupled as part of this work.

Issue https://github.com/dart-lang/sdk/issues/31709

Change-Id: If4396d295879391becfa6c38d4802bbff81f5b20
Reviewed-on: https://dart-review.googlesource.com/c/90242
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-01-25 16:45:13 +00:00
Vyacheslav Egorov a9ce969e53 [vm] Decouple growable_array.h and zone.h from thread.h
- Introduce a slimmed down version of thread.h, which just depends on the
Zone and StackResource.
- Introduce a layering check that would prevent the coupling in the future.

This is the first step towards decoupling compiler from runtime.

There are multiple reasons to introduce the decoupling but the main
reason currently is to introduce a controlled surface through which
compiler reaches into runtime to catch any places where runtime word size
might influence the compiler and then enable building compiler that
targets 32-bit runtime but is embedded into a 64-bit runtime.

Issue https://github.com/dart-lang/sdk/issues/31709

Change-Id: Id63ebbaddca55dd097298e51c90d957a73fa476e
Reviewed-on: https://dart-review.googlesource.com/c/87182
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-01-11 20:47:10 +00:00
Ryan Macnak a651838652 [vm] Fix misc printf format bugs.
Bug: https://github.com/dart-lang/sdk/issues/35009
Change-Id: I6b509e1eb8e76e07f60a086c67358d65d2a1fae4
Reviewed-on: https://dart-review.googlesource.com/c/82460
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-01 16:37:22 +00:00
Aart Bik 7f88b64e0a [vm] buffer size based log flushing
Useful when debugging on Android, since adb logcat
truncates messages that are "too long" (and always
flushing would result in too many short messages).

Change-Id: I51978b4e352d65c9074ab1d830b042f68e06710d
Reviewed-on: https://dart-review.googlesource.com/70740
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2018-08-20 22:47:31 +00:00
Ryan Macnak 9b5a931b06 [vm] Replace most runtime/vm uses of OS::Print with OS::PrintErr.
Leave --print-snapshot-sizes on stdout because it is parsed by Flutter benchmarks.

Replace all runtime/bin uses of OS::Print with Log::Print.

Bug: https://github.com/dart-lang/sdk/issues/32134
Change-Id: I74aacfb410cdfa9270d06e7f6ab0534520c7c7ba
Reviewed-on: https://dart-review.googlesource.com/60021
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-06-13 19:51:40 +00:00
Régis Crelier 407f1f8ca1 [VM logging] Fix nesting of log blocker (second attempt).
Fix expectations of log blocker test, i.e. no swapping occurs anymore.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2999833002 .
2017-08-14 08:38:52 -07:00
Régis Crelier c762bd3145 Revert "[VM logging] Fix nesting of log blocker."
This reverts commit 1c268d35df.

BUG=

Review-Url: https://codereview.chromium.org/2995793002 .
2017-08-11 13:16:47 -07:00
Régis Crelier 1c268d35df [VM logging] Fix nesting of log blocker.
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2994143002 .
2017-08-11 12:43:37 -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 a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08: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
Daniel Andersson a1bc527306 Migrate logging infrastructure Isolate->Thread
This enables thread-safe logging (e.g., ISL_Print, which will soon be renamed to THR_Print), which is needed for concurrent
marking (DetachCode) and compilation.

Make finalization of GC marking tasks concurrent, now that it's thread-safe.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1314673008 .
2015-09-09 15:30:38 -07:00
johnmccutchan@google.com 20efd2f0c4 Add Log::VPrint and remove duplicated code.
BUG=
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43624 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 23:28:47 +00:00
johnmccutchan@google.com a6483aefd1 Per isolate Log with block support
BUG=
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43604 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 18:54:20 +00:00