Commit Graph

333 Commits

Author SHA1 Message Date
Ryan Macnak 4c9b53fafe [vm] Assert Object::Allocate has the correct safepoint state.
Add missing transitions to tests.

Change-Id: Ib0f820b4c32c13f7caf2149280b124b505856837
Reviewed-on: https://dart-review.googlesource.com/72553
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-04 20:02:47 +00:00
Ryan Macnak 14db718ed5 [vm] Add missing safepoint transitions.
Mostly tests; 1 non-test bug in propagating an error through Dart_SetReturnValue.

This is progress towards asserting thread->excution_state() == kThreadInVM in Object::Allocate.

Change-Id: I6a59549868ab317b3c0d32aa42f3661289cbf456
Reviewed-on: https://dart-review.googlesource.com/71720
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-08-28 16:40:17 +00:00
Martin Kustermann df2d187f74 [VM] Move the ObjectPoolWrapper out of the Assembler
Issue https://github.com/dart-lang/sdk/issues/33274

Change-Id: I2e295a357939bc7c966c0658c344fcc4268669c1
Reviewed-on: https://dart-review.googlesource.com/71166
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-08-23 08:00:15 +00:00
Samir Jindel d8a4a3896a [vm] Multiple entrypoints: backend/assembler support.
Test Plan:

Will be tested by following revisions which introduce optimizations that invoke the
new entrypoint.

Change-Id: I56d714bceb92c44a13c46d52457154b82577aa8c
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/67345
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-08-16 17:15:32 +00:00
Martin Kustermann 575a8f8381 [VM] Extend subtype-test mechanism with support for generic methods
Until now the subtype-test cache mechanism did not work (i.e. could
return the wrong result) for partially instantiated generic closures.

Additionally, closures which close over generic methods were always
handled in runtime.  This caused a servere performance regression for
any code hitting this (e.g. code which uses `package:stack_trace`).

Fixes https://github.com/dart-lang/sdk/issues/34051
Fixes https://github.com/dart-lang/sdk/issues/34054

Change-Id: Idb73e6f348c2fe0c737f42c57009f5f7a636c9a6
Reviewed-on: https://dart-review.googlesource.com/68369
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-08-08 13:40:58 +00:00
Martin Kustermann 6e81d74fcc [VM] Optimize generation of type testing stubs in JIT mode.
This CL introduces, similar to RawClass::direct_subclasses_, a
RawClass::direct_implementors field which is kept up-to-date.

The generation of type testing stubs uses this cached
reverse-relationship information for faster cid-range calculation (time
spent in type testing stub generation is decreased by an order of
magnitude).

This CL also enable type testing stubs for any instantiated type.

This seems to improve

  * analysis-server-cold-analysis by 6%
  * analysis-server-warm-analysis by 11%

as well as other non-analysis benchmarks in JIT mode.

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

Change-Id: If01ee06ac08251b2ed27f79d6b82ad7354c8336e
Reviewed-on: https://dart-review.googlesource.com/66576
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-07-28 20:22:05 +00:00
Peter von der Ahé db45d049db Update VM CC test to new void rules
Change-Id: Icf8db6ab4dd701b449af5998d3ed10cc3d5b2e6f
Reviewed-on: https://dart-review.googlesource.com/65503
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-07-18 09:48:19 +00:00
Alexander Aprelev ea837c91a0 Transition tests to EvaluateCompiledExpression.
This is follow-up to https://dart-review.googlesource.com/c/sdk/+/58660.

Change-Id: Ic0ae58eb34dabe6e0902f37c8e817f949ed4ac64
Reviewed-on: https://dart-review.googlesource.com/60705
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-06-19 02:41:00 +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
Martin Kustermann 0a8b236159 [VM] Make the encoding of variable descriptors use variable indices
This decouples the scope building from knowing about frame layout.

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

Change-Id: I9058b242fb24f859f54d6e3660a5972df86d39e6
Reviewed-on: https://dart-review.googlesource.com/59093
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-06-11 09:55:54 +00:00
Martin Kustermann a603635b85 [VM] Decouple frontend from frame layout
So far the frontend (parser, flow graph builder, ssa construction) were
aware of the actual frame layout.

This CL makes the indices we assign to [LocalVariable]s logical
indices, assigning:

  * M parameters the indices      1 ... M
  * N local variables the indices 0 -1 ... -(N-1)

The scope building, flow graph builder and ssa construction operate on
those logical indices.

When emitting actual code, the backend will translate those indices into
actual FP relative indices. This allows us to be more flexible in the
backend which frame layout we choose.

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

Change-Id: I9a504bf97821c257aafd2b3430df9f4c9da4b442
Reviewed-on: https://dart-review.googlesource.com/57321
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-06-07 11:35:58 +00:00
Ryan Macnak ade0e93090 [vm] Normalize external string finalizers.
- Remove a level of indirection when accessing code units.
 - Require a finalizer when constructing an external string.

Change-Id: I3f65246bf0ac50ffad900e2c338623a7684a9d3d
Reviewed-on: https://dart-review.googlesource.com/54300
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-06-04 23:44:39 +00:00
Alexander Markov c3b5939965 [vm] Remove --limit-ints-to-64-bits option and old _Bigint class
Closes https://github.com/dart-lang/sdk/issues/33306

Change-Id: I7088d8b7143edbe24f5cefe4be037ad2006e0625
Reviewed-on: https://dart-review.googlesource.com/58101
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-06-04 20:10:40 +00:00
Samir Jindel 39c93a2b19 Revert "Revert "[vm/kernel] Expression execution through Kernel."
This reverts commit b5154dd01e.

Original revision is in patchset 1.

Change-Id: Ic0776011c6fdbd64c025086535351474a9a88b6e
Reviewed-on: https://dart-review.googlesource.com/54407
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-05-15 12:03:22 +00:00
Samir Jindel b5154dd01e Revert "[vm/kernel] Expression execution through Kernel.
This reverts commit afd0a52a5a.

Reason for revert: Breaks kernel-a32 and kernel-rbc bots

Original change's description:
> [vm/kernel] Expression execution through Kernel.
> 
> Change-Id: Id90c91cb3b71f9ce703e21fe48147b86a7764d34
> Reviewed-on: https://dart-review.googlesource.com/42562
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Samir Jindel <sjindel@google.com>

TBR=aam@google.com,rmacnak@google.com,sjindel@google.com

Change-Id: If1ecad6145aeab81d5d3581798a628ead0265c38
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/54420
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-05-09 12:41:00 +00:00
Samir Jindel afd0a52a5a [vm/kernel] Expression execution through Kernel.
Change-Id: Id90c91cb3b71f9ce703e21fe48147b86a7764d34
Reviewed-on: https://dart-review.googlesource.com/42562
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-05-09 10:27:52 +00:00
Vyacheslav Egorov a06b1d96cb Revert "[VM] Reduce Smi size to 32 bit on 64 bit platforms"
This reverts commit cf78da8a48.

Reason for revert: introduces significant performance regression (~30%) on analyzer benchmarks (warm-analysis) without clearly visible hot-spot.

Original change's description:
> [VM] Reduce Smi size to 32 bit on 64 bit platforms
> 
> This reduces small tagged integers on 64 bit platforms from 63 bits to
> 31 bits plus one tag bit.
> This is a step on the way to compile-time-optional compressed pointers
> on 64 bit platforms.  See more about this at go/dartvmlearnings
> This causes a slowdown for some uses of integers that don't fit in 31
> signed bits, but because both x64 and ARM64 have unboxed 64 bit
> integers now the performance hit should not be too bad.
> 
> This is a reapplication of
> https://dart-review.googlesource.com/c/sdk/+/46244
> It was reverted due to a compilation error on 32 bit
> ARM with DBC.
> 
> R=​vegorov@google.com
> 
> Change-Id: I943de1768519457f0e5a61ef0b4ef204b6a53281
> Reviewed-on: https://dart-review.googlesource.com/51321
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,erikcorry@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I8c5b909ec38663b5f5b05f69ef488c97341f8f3d
Reviewed-on: https://dart-review.googlesource.com/54000
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-05-07 13:56:10 +00:00
Ryan Macnak 7e54844fe7 [vm] Fix build for gcc 7.3.0.
Change-Id: I02ead73679c3a6e1e5c9313f78c5f02ad6ca79b0
Reviewed-on: https://dart-review.googlesource.com/53521
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-03 17:59:44 +00:00
Erik Corry cf78da8a48 [VM] Reduce Smi size to 32 bit on 64 bit platforms
This reduces small tagged integers on 64 bit platforms from 63 bits to
31 bits plus one tag bit.
This is a step on the way to compile-time-optional compressed pointers
on 64 bit platforms.  See more about this at go/dartvmlearnings
This causes a slowdown for some uses of integers that don't fit in 31
signed bits, but because both x64 and ARM64 have unboxed 64 bit
integers now the performance hit should not be too bad.

This is a reapplication of
https://dart-review.googlesource.com/c/sdk/+/46244
It was reverted due to a compilation error on 32 bit
ARM with DBC.

R=vegorov@google.com

Change-Id: I943de1768519457f0e5a61ef0b4ef204b6a53281
Reviewed-on: https://dart-review.googlesource.com/51321
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-04-25 12:31:33 +00:00
Alexander Aprelev 23ae4fa098 Revert "[VM] Reduce Smi size to 32 bit on 64 bit platforms"
This reverts commit 0e9a77a360 as it introduces regression in Flutter build: https://build.chromium.org/p/client.flutter/builders/Mac%20Engine/builds/2573/steps/build%20ios_debug_arm/logs/stdio

Revert d58b0e2d44

Change-Id: I1c4a9384d4fa8cc809412b1d22409221771acda0
Reviewed-on: https://dart-review.googlesource.com/50600
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-04-10 23:39:01 +00:00
Erik Corry 0e9a77a360 [VM] Reduce Smi size to 32 bit on 64 bit platforms
This reduces small tagged integers on 64 bit platforms from 63 bits to
31 bits plus one tag bit.
This is a step on the way to compile-time-optional compressed pointers
on 64 bit platforms.  See more about this at go/dartvmlearnings
This causes a slowdown for some uses of integers that don't fit in 31
signed bits, but because both x64 and ARM64 have unboxed 64 bit
integers now the performance hit should not be too bad.

This reapplies the change reviewed at
https://dart-review.googlesource.com/c/sdk/+/46244

R=kustermann@google.com

Change-Id: I605c21506ec7d4c69fa7049bc419b3ee370685fc
Reviewed-on: https://dart-review.googlesource.com/50202
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
2018-04-09 12:45:57 +00:00
Erik Corry b7ade14add Revert "[VM] Reduce Smi size to 32 bit on 64 bit platforms."
This reverts commit 19b4349487.
Reason for revert: Failure on VM test with -hot-reload-test-mode

R=kustermann@google.com

Change-Id: I1c40b537be8c934b1ff34465bca0a35c1376ab71
Reviewed-on: https://dart-review.googlesource.com/49862
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-04-06 12:01:58 +00:00
Erik Corry 19b4349487 [VM] Reduce Smi size to 32 bit on 64 bit platforms.
This reduces small tagged integers on 64 bit platforms from 63 bits to 31 bits
plus one tag bit.
This is a step on the way to compile-time-optional compressed pointers on 64
bit platforms.  See more about this at go/dartvmlearnings
This causes a slowdown for some uses of integers that don't fit in 31 signed
bits, but because both x64 and ARM64 have unboxed 64 bit integers now the
performance hit should not be too bad.

R=kustermann@google.com

Change-Id: I035ed84c29b64f0432cd2d24193eb1c6303c14b0
Reviewed-on: https://dart-review.googlesource.com/46244
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-04-06 10:07:53 +00:00
Ben Konyi 090d9e9231 [ VM / Dart 2 ] Reland: Fixed StackTraceFormat test to expect file URIs in stacks generated by the Dart frontend.
This reverts commit a81f4babcc.

Change-Id: I88f0d004640dd1a994b211ab2a698fd2f87afeca
Reviewed-on: https://dart-review.googlesource.com/49540
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-04-04 21:28:16 +00:00
Ben Konyi a81f4babcc Revert "[ VM / Dart 2 ] Fixed StackTraceFormat test to expect file URIs in stacks generated by the Dart frontend."
This reverts commit ae130bc187.

Reason for revert: snprintf doesn't like positional format strings on Windows.

Original change's description:
> [ VM / Dart 2 ] Fixed StackTraceFormat test to expect file URIs in stacks generated by the Dart frontend.
> 
> Change-Id: I26f09e094e934485575e55a6a60a8fccfbd94aa7
> Reviewed-on: https://dart-review.googlesource.com/47520
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,zra@google.com,asiva@google.com

Change-Id: Idbc15d59bcc7ff3534010f6c93cebdcc89c935fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/47640
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-03-21 20:20:45 +00:00
Ben Konyi ae130bc187 [ VM / Dart 2 ] Fixed StackTraceFormat test to expect file URIs in stacks generated by the Dart frontend.
Change-Id: I26f09e094e934485575e55a6a60a8fccfbd94aa7
Reviewed-on: https://dart-review.googlesource.com/47520
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-03-21 20:03:46 +00:00
Ryan Macnak 558a931409 [vm] Move some string utils from runtime/vm to runtime/platform.
Change-Id: I552086445a7e07792f9da85afa5edf23b6c450d5
Reviewed-on: https://dart-review.googlesource.com/44402
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-03-01 02:07:46 +00:00
Martin Kustermann cf1de7d46c [VM] Replace hand-written assembly prologues with IR
As part of the prologue changes we get rid of the empty context as well.

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

Change-Id: I707e23c631bcfbbad6c91c4963d0c10f7a0be625
Reviewed-on: https://dart-review.googlesource.com/25320
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-13 16:04:34 +00:00
Siva Annamalai af550c9b6c Revert "Revert "1. Remove unused dart debugger API entrypoints which are not used anymore""
This reverts commit e76ea5b604.

1. Remove unused dart debugger API entrypoints which are not used anymore
   as this API has been deprecated and dartium was the last user.

2. Some unit tests are using some of these API entrypoints, so moved them
   over to a test file which will be linked into run_vm_tests

Change-Id: I5a486b98e4b97eb4df2e58d9cc0ba603e96c2e32
Reviewed-on: https://dart-review.googlesource.com/11180
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-10-04 20:19:22 +00:00
Alexander Aprelev ce427ac14f Revert "Revert "Introduce StaticCallNode::kNoRebind and use that in implicit closures.""
This reverts commit ade37f931e.

This re-lands RebindRule change with fixes for the "-mdebug--hot-reload" test failures.

Original commit is reverted in patch set 1.
Fixes are in following patch sets.

Bug:
Change-Id: I49375af9b891323fe05c670d77cbf880964aae54
Reviewed-on: https://dart-review.googlesource.com/9361
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2017-09-28 19:43:32 +00:00
Dmitry Stefantsov ade37f931e Revert "Introduce StaticCallNode::kNoRebind and use that in implicit closures."
This reverts commit 97393fd961.

TBR=aam@google.com

Change-Id: I8fc5f644e994faa20aa8b5c54f8d6227a054e39d
Reviewed-on: https://dart-review.googlesource.com/9220
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-28 08:44:48 +00:00
Alexander Aprelev 97393fd961 Introduce StaticCallNode::kNoRebind and use that in implicit closures.
Change-Id: I6219462fed278dbb90361c2084eed886c9245097

Revert "Revert "Introduce inline cache reload rule attribute to static call AST node and ICData.""

This reverts commit 162283c2f3.

This re-lands the change with original revert in Patch set 1, actual bug fix in next patch set.

Bug:
Change-Id: I6219462fed278dbb90361c2084eed886c9245097
Reviewed-on: https://dart-review.googlesource.com/8760
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-28 03:26:22 +00:00
Ryan Macnak 5efa08b663 Reapply "[reload] Add facility to check for program elements changed in the last reload but not executed."
- Weaken assert for identity reloads to account for lazy finalization.
 - Store actual field end positions instead of computing from a terminating semicolon.
 - Consider unfinalized classes to be unchanged if they have same sequence of tokens.

Change-Id: I3fcd7fed924bfac47dc382702ce63207bb8aa031
Reviewed-on: https://dart-review.googlesource.com/8164
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-09-27 02:50:35 +00:00
Siva Annamalai e76ea5b604 Revert "1. Remove unused dart debugger API entrypoints which are not used anymore"
This reverts commit c30918f11e.

Bug:
Change-Id: I6d5f037868a967a9f4fcabc1ecb20f34e957036a
Reviewed-on: https://dart-review.googlesource.com/8403
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-09-26 02:20:55 +00:00
Alexander Aprelev 162283c2f3 Revert "Introduce inline cache reload rule attribute to static call AST node and ICData."
This reverts commit 68a727fa5c.

Revert "Fix ICData::New() invocation. Follow-up to 68a727fa5cf5."

This reverts commit ac06b1c8ea.

Revert "Fix last ICData::New() invocation. Follow-up to 68a727fa5cf5."

This reverts commit da26ffc4de.

Bug:
Change-Id: Ia2d4e6a3c3a3a329982c90aded11e72bf25a9a34
Reviewed-on: https://dart-review.googlesource.com/8402
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2017-09-26 02:08:17 +00:00
Siva Annamalai c30918f11e 1. Remove unused dart debugger API entrypoints which are not used anymore
as this API has been deprecated and dartium was the last user.

2. Some unit tests are using some of these API entrypoints, so moved them
   over to a test file which will be linked into run_vm_tests

Change-Id: I3343b23d082400da3c803cf81ea80dfaa5e426cf
Reviewed-on: https://dart-review.googlesource.com/7942
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2017-09-26 01:00:01 +00:00
Alexander Aprelev 68a727fa5c Introduce inline cache reload rule attribute to static call AST node and ICData.
Reload rule describes how inline cache has to be processed during hot reload, whether it should
be updated, reset or preserved.

Bug: dartbug.com/30639
Change-Id: I40b63ade786456ec48d4fa205a076654c2996bce
Reviewed-on: https://dart-review.googlesource.com/7586
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-25 20:18:58 +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
Ryan Macnak 466385ceb6 [vm, gc] Require a safepoint for heap iteration.
Assert a safepoint operation can only be started from a thread in the VM state. Fix several unit tests missing a native-to-vm transition.

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

Review-Url: https://codereview.chromium.org/2995543004 .
2017-08-07 17:51:25 -07:00
Zachary Anderson 952345ff84 Remove the debugger_ field from Isolate in a PRODUCT build.
This is the first in a series of CL in which I am removing fields from
classes that aren't used in PRODUCT mode. This CL removes the
debugger_ field from Isolate.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2981173002 .
2017-07-18 13:29:40 -07:00
Alexander Markov bc937b3b6b Reapply CL "Option to truncate integers to 64 bits, part 2"
This is the 2nd attempt to land the CL
abed3c2a70

Original review: https://codereview.chromium.org/2982823002
No extra changes were made. Large literals in the Dart core library
which caused failures during the previous attempt to land this CL have
been fixed separately.

Description of the CL:

In --limit-ints-to-64-bits mode:
* Integer constructors return Integer::null if integer is out of range.
* Error is reported for integer literals which are out of range.
* Dart API is revised to return errors if integers are out of range.

Bigint::IsDisabled() method is introduced to be able to enable/disable
Bigints independently of --limit-ints-to-64-bits mode in future.

Deprecated constructor Integer::NewFromUint64 is replaced with
Integer::New in certain cases.

R=regis@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2980223002 .
2017-07-17 12:20:17 -07:00
Alexander Markov 776aef9ff0 Revert "Option to truncate integers to 64 bits, part 2"
This reverts commit abed3c2a70.

TBR

Review-Url: https://codereview.chromium.org/2977143002 .
2017-07-14 14:40:58 -07:00
Alexander Markov abed3c2a70 Option to truncate integers to 64 bits, part 2
In --limit-ints-to-64-bits mode:
* Integer constructors return Integer::null if integer is out of range.
* Error is reported for integer literals which are out of range.
* Dart API is revised to return errors if integers are out of range.

Bigint::IsDisabled() method is introduced to be able to enable/disable
Bigints independently of --limit-ints-to-64-bits mode in future.

Deprecated constructor Integer::NewFromUint64 is replaced with
Integer::New in certain cases.

R=zra@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2982823002 .
2017-07-14 13:24:53 -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
Diogenes Nunez 98fe465b85 Debug garbage collector does not correctly remove cross-gen garbage
Modifies the debug garbage collector (CollectAllGarbage()) to correctly
remove inter-generational garbage by evacuating all of new space.

Adds tests to check if this issue has been correctly resolved.

Updates the WeakProperty_PreserveCrossGen test to call for one new and
one old space collection instead of CollectAllGarbage(). Otherwise, all
weak properties are swept as garbage.

DETAILS:

ISSUE

Specifically, the following arrangements in a heap resulted
in garbage surviving a GC.

- Dead object in old space pointing to dead object in new space results
  in the new space object surviving.
  - A cycle between two dead objects, one in each space, results in the
    cycle surviving until all objects are in the old space.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2964503005 .
2017-06-30 16:03:47 -07:00
Diogenes Nunez 6ccd7e3cc3 Revert "Modifies the debug garbage collector (CollectAllGarbage()) to correctly remove inter-generational garbage by evacuating all of new space."
This reverts commit abf40fc8d2.

TBR=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2960063002 .
2017-06-27 15:51:08 -07:00
Diogenes Nunez abf40fc8d2 Modifies the debug garbage collector (CollectAllGarbage()) to correctly remove inter-generational garbage by evacuating all of new space.
Adds tests to check if this issue has been correctly resolved.

Updates the WeakProperty_PreserveCrossGen test to call for one new and one old space collection instead of CollectAllGarbage(). Otherwise, all weak properties are swept as garbage.

DETAILS:

ISSUE

Specifically, the following arrangements in a heap resulted
in garbage surviving a GC.

- Dead object in old space pointing to dead object in new space results
  in the new space object surviving.
- A cycle between two dead objects, one in each space, results in the
  cycle surviving until all objects are in the old space.

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2930943002 .
2017-06-27 14:00:45 -07:00
Erik Corry 029b1cb948 Spelling fixes e to i.
R=kevmoo@google.com
BUG=

Review-Url: https://codereview.chromium.org/2957593002 .
2017-06-24 13:41:39 +02:00
Aske Simon Christensen cec963f028 The current growth strategy for growable arrays allocates a backing array of size 2 at (empty) creation and doubles the size whenever the capacity is insufficient while adding elements.
I collected statistics for the sizes and capacities of growable arrays which are promoted to old-space or survive an old-space gc when running dart2js and Fasta. For these applications, the vast majority of arrays stay empty. More than half of the total object size of promoted backing arrays is backing for empty growable arrays.

Furthermore, since the overhead for an array is 3 words (header, type parameters and length), and object sizes are rounded up to an even number of words, we waste one word for all even-sized arrays.

This CL changes the growth strategy so that empty growable arrays are created with a shared, zero-sized array as backing, avoiding the allocation of a backing array if no elements are added. When the array needs to grow, it starts out at 3 and grows to double size plus one each time: 7, 15, 31, ...

A few places in the VM code need to handle these shared, zero-sized arrays specially. In particular, the Array::MakeArray function needs to allocate a new, empty array if its result is to be returned to Dart code.

Benchmarks suggest that the change improves memory usage by a few percent overall and does not significantly affect run time.

BUG=
R=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2949803002 .
2017-06-22 10:51:54 +02:00
Régis Crelier a62107cfaf Check for a passed-in type argument vector in the prolog of generic functions.
Do this in unoptimized code only, when --reify-generic-functions is specified.
This is still work in progress, and support in optimizer, in inliner, in DBC,
in kernel to ir, and other areas, will follow.
Many small fixes and added todos.

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

Review-Url: https://codereview.chromium.org/2941643002 .
2017-06-21 09:02:16 -07:00