Commit Graph

9906 Commits

Author SHA1 Message Date
Vyacheslav Egorov c9bcfe877b [vm] Fix byte displacement printing in x86 disassembler
Use int8_t type instead of char - which does not have a defined signedness.

Change-Id: I14d43419d3e59cea71fb27f15bb1f72e450baca6
Reviewed-on: https://dart-review.googlesource.com/76563
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-09-25 22:42:36 +00:00
Zach Anderson 34425a870e [vm] Set implicit function accessor when the functions are created
Rather than during class finalization.

before:
$ ./out/ReleaseX64/run_vm_tests GenKernelKernelLoadKernel
GenKernelKernelLoadKernel(RunTime): 35558

after:
$ ./out/ReleaseX64/run_vm_tests GenKernelKernelLoadKernel
GenKernelKernelLoadKernel(RunTime): 27650

Change-Id: I2a89f75c3082d7e8fbe20f4e832a609cffae43d8
Reviewed-on: https://dart-review.googlesource.com/76420
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-25 19:14:41 +00:00
Régis Crelier 4cf2d3990b [VM runtime] Store Smi instance type in type test cache when using the interpreter.
Instances of type Smi are handled in generated code and not looked up in
type test cache. The interpreter does not implement this special handling and
relies on the cache for Smi instances as well.

Change-Id: I3a8501efcbadfcbe848871ad0f6ada444414be43
Reviewed-on: https://dart-review.googlesource.com/76305
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-09-25 15:47:37 +00:00
Matthew Dempsky 8debb4e9db [fuchsia] Add zx_vmo_replace_as_executable calls
In the future, newly created VMOs on Fuchsia will not be mappable as
executable by default. In preparation for that, start using
zx_vmo_replace_as_executable to mark Fuchsia's VMOs as executable as
needed.

SEC-42

TEST=CQ

Change-Id: I9df86bbb33b02042260727d64e74b7146eb1d1a6
Reviewed-on: https://dart-review.googlesource.com/76304
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-25 04:55:02 +00:00
Ben Konyi b6284b41e3 Revert "[VM] Dart_Initialize no longer crashes after Dart_Cleanup"
This reverts commit 519ee905f9.

Reason for revert: Seeing multiple crashes on Windows

Original change's description:
> [VM] Dart_Initialize no longer crashes after Dart_Cleanup
> 
> Change-Id: I3cfdab9553aad045f024b6f9aec0b40b08234007
> Reviewed-on: https://dart-review.googlesource.com/75786
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

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

Change-Id: I33ad79dbc3fcf44f93612ff63bd2d8431f6067c8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/76342
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-09-25 02:17:37 +00:00
Ryan Macnak 94481adbd4 [vm] Only include debugger/profiler slots in RawCode in product mode.
Saves 5 words per Code in product mode JIT.

Change-Id: I799a9c3bc1f4492d329c588ba1ea98f5b8baa304
Reviewed-on: https://dart-review.googlesource.com/75421
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-25 01:30:53 +00:00
Ben Konyi 519ee905f9 [VM] Dart_Initialize no longer crashes after Dart_Cleanup
Change-Id: I3cfdab9553aad045f024b6f9aec0b40b08234007
Reviewed-on: https://dart-review.googlesource.com/75786
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-09-25 01:20:24 +00:00
Alexander Markov 53497549ab [vm] Specialize 'new List()' on kernel AST
In VM, 'new List' is equivalent to either 'new _GrowableList' or
'new _List' depending on the number of arguments.
This change does the transformation early (on kernel AST), in order
to have specialized representation in TFA and in bytecode.

Change-Id: I46f0db8cc19efb3a53fdbe971ac26bdd2736fbda
Reviewed-on: https://dart-review.googlesource.com/76283
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-25 00:38:57 +00:00
Ryan Macnak 9106228a55 [vm, dwarf] Set default_is_stmt to true for compatability with dsymutil.
dsymutil is unable to merge line number programs will different values of default_is_stmt, and either it or the linker is implicitly adding one where this value is true.

Change-Id: I68d55ff46f97bfdeb83ca71fcc9a1069f460a107
Reviewed-on: https://dart-review.googlesource.com/76306
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-24 23:21:15 +00:00
asiva 355c73d4ee [VM] Remove support for option --no-preview-dart-2
- option --no-preview-dart-2 will now result in an error
- change aot-assembly build rule to generate AOT snapshot using Dart 2
- generate coresnapshot using Dart 2 (this snapshot is not used yet, next CL which switch the isolate create code to use this snapshot)
- by pass all Dart1 test runs in the status file
- change the default compiler setting in test.py to use dartk
- have test.py not pick up any configuration for --no-preview-dart-2

Change-Id: Ia136943ebfd0fed0c52683b330745b3e2c7a7ce6
Reviewed-on: https://dart-review.googlesource.com/75820
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-09-24 20:38:08 +00:00
Vyacheslav Egorov e9586a5d14 [vm] Update workaround for Android Kernel bug (b089d4f).
Previous workaround was only compilable by GCC - new one is compilable
with both but is less robust because theoretically compiler can simply
use registers r0-r2 as temporaries whenever it desires.

Bug: https://github.com/flutter/flutter/issues/22172

Change-Id: Ic73fde8d3342c1455ab01ed8b7d4b267aebda136
Reviewed-on: https://dart-review.googlesource.com/76021
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-09-24 20:16:08 +00:00
Alexander Markov 62d154f6a3 [vm/bytecode] Record null-initialized fields in bytecode
If a field is initialized with null (either explicitly or implicitly),
field store can be omitted in bytecode. In such case, bytecode should
still convey the information about this initialization to VM for
field guards to work correctly.

Change-Id: I1fd45b858c3c521b97fa5dbffe0e15b1ea75d92f
Reviewed-on: https://dart-review.googlesource.com/76060
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-09-24 17:56:35 +00:00
Zach Anderson dba8b37d38 [vm] Benchmark for reading kernel bytecode
Change-Id: I07617a553193495fcc4fc0ce4a6382996ee7dc51
Reviewed-on: https://dart-review.googlesource.com/75821
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-09-24 15:54:49 +00:00
Alexander Markov 654c4babc8 [vm/bytecode] Fix a couple of assertions when running with bytecode
Also, add more tests to dartkb bots.

Change-Id: I6fbcbe73d6b9065ec03e64bf150b4ebd742e4d28
Reviewed-on: https://dart-review.googlesource.com/75981
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-09-21 22:54:39 +00:00
Ryan Macnak 93dcfaa289 [vm, gc] Concurrent marking.
Fall back to parallel marking
 - on IA32 (barrier unimplemented)
 - when write_protect_code is enabled (protection dependency on marking state unimplemented)

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: If093f24e4dc6bf29f407cc45e95bb2274fc53dcf
Reviewed-on: https://dart-review.googlesource.com/71389
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-21 21:30:33 +00:00
Zach Anderson e06ef81efa [vm] Unconditionally generate interpreter stubs
This allows building a core-jit snapshot that can support running with
--enable-interpreter even when the core-jit snapshot is not generated
with --enable-interpreter.

Change-Id: If6ce787baa9f11fef929ee496b54d68598cba520
Reviewed-on: https://dart-review.googlesource.com/75989
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-21 21:00:40 +00:00
Régis Crelier 012b7050e5 [VM interpreter] Use a helper to test entry frame pc marker.
Change-Id: I6256f0337d2ab84722d32d4e6af97b966c619162
Reviewed-on: https://dart-review.googlesource.com/75987
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-09-21 20:10:45 +00:00
Aart Bik 20342cea27 [vm/compiler] added compilation trace tracer
Rationale:
When building with "--precompile trace.txt", the current
version silently processes the file without any feedback
on misspelled names, errors, or the like. This flag adds
the ability to get some feedback.
Change-Id: Iccf4b53c7091aac8be5e207eaf00273ceeeda4f3
Reviewed-on: https://dart-review.googlesource.com/75790
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-21 18:01:20 +00:00
Alexander Markov 19e2040f35 [vm] Cleanup the ability to specify entry points via JSON and text files
Entry points files (both JSON and text) are replaced with
@pragma("vm:entry-point") annotations.

This change removes obsolete:
* --embedder_entry_points_manifest option in gen_snapshot;
* --entry-points option in gen_kernel and frontend_server;
* --print_precompiler_entry_points VM option;
* 'entry_points' argument in Dart_Precompile() API.

Change-Id: I503f50f51df27e8e9635388c013058686b3b6ff1
Reviewed-on: https://dart-review.googlesource.com/75793
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-21 16:51:48 +00:00
Zach Anderson 51f2dac483 Reland: [vm] Adds a benchmark for Dart_LoadLibraryFromKernel
Adds missing free(), and skips on Windows.

Change-Id: Ie187172b1b9b276477e10d10f2b7f492f009ebfd
Reviewed-on: https://dart-review.googlesource.com/75920
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-21 15:48:17 +00:00
Samir Jindel 82c784a60f Revert "[vm] Adds a benchmark for Dart_LoadLibraryFromKernel"
This reverts commit fee8efa3d6.

Reason for revert: Breaks many VM bots.

Original change's description:
> [vm] Adds a benchmark for Dart_LoadLibraryFromKernel
> 
> Change-Id: I71c9d6a1cd9d07f554bbeb02c682de2c771ddb3e
> Reviewed-on: https://dart-review.googlesource.com/75787
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=alexmarkov@google.com,zra@google.com,asiva@google.com

Change-Id: If8c3f3aca36f1a65c57592961e7adc449c4c7e78
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/75860
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-09-21 10:48:42 +00:00
Zach Anderson fee8efa3d6 [vm] Adds a benchmark for Dart_LoadLibraryFromKernel
Change-Id: I71c9d6a1cd9d07f554bbeb02c682de2c771ddb3e
Reviewed-on: https://dart-review.googlesource.com/75787
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-20 22:32:34 +00:00
Alexander Markov 46ec629096 [vm/bytecode] Trigger JIT-compilation from interpreter
Performance on Richards benchmark (no bytecode in platform, release build):

Interpreter (--enable-interpreter --compilation-counter-threshold=-1)
Richards(RunTime): 177228.34433333334 us.

Interpreter + bytecode compilation with default threshold 10 (--enable-interpreter)
Richards(RunTime): 930.8050725919032 us.
Varies from run to run, spikes up to 4178.005912317328 (no OSR yet, only background compilation).

Bytecode compilation (--use-bytecode-compiler)
Richards(RunTime): 830.1371626556016 us

Default pipeline:
Richards(RunTime): 880.1557113946327 us.

Numbers on Richards benchmark (platform with bytecode, release build):

Interpreter (--enable-interpreter --compilation-counter-threshold=-1)
Richards(RunTime): 354553.6346666667 us.

Interpreter + compilation with default threshold 10 (--enable-interpreter)
Richards(RunTime): 934.7108855140189 us.

Bytecode compilation (--use-bytecode-compiler)
Richards(RunTime): 822.74178403949 us.


Change-Id: Ic13e9f7c7d98f2930e6de4c4f74bac4d28478249
Reviewed-on: https://dart-review.googlesource.com/75781
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-20 20:57:08 +00:00
Régis Crelier e95d944f5f [VM interpreter] Propagate error from invoked compiled function to interpreter caller.
Change-Id: Ie72cbca424ff843f16a276c6877bd7d428aa8e8c
Reviewed-on: https://dart-review.googlesource.com/75424
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-09-20 17:07:01 +00:00
Alexander Markov 3263550e86 [vm] Decouple bytecode reading from compilation
This way requests to compile won't end prematurely after reading
bytecode if interpreter is enabled.

Change-Id: Ic06cae98ea65bc4656ef491fbd306d34b0e1ef4c
Reviewed-on: https://dart-review.googlesource.com/75628
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-20 16:22:33 +00:00
Jens Johansen 867c5271be Debugging dart in methods with dynamic type arguments
Before this CL, debugging code like this:
```
import "dart:developer";

main() {
  Foo foo = new Foo();
  foo.bar<dynamic, dynamic>(1, 2);
}

class Foo {
  bar<A, B>(A a, B b) {
    debugger();
    print("a: $a; b: $b");
  }
}
```

and trying to print for instance `a` or `b` when the debugger is stopped
in `bar` (e.g. `p a`) would yield a wrong result. I.e., this happends
when debugging methods taking type arguments, but where the type
arguments are all `dynamic`.

This also surfaces when hovering variables in e.g. VSCode with the
Dart Code plugin.

Fixes: #34353.
Change-Id: Iddf1ed119700fea61a0e29eb6ad763a8d2b657a0
Reviewed-on: https://dart-review.googlesource.com/74583
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-09-20 06:33:27 +00:00
Alexander Markov a386c07281 [vm/aot] Add extra call specialization pass
The extra call specialization pass after constant propagation is able to
replace more calls in AOT, as constant propagation removes unreachable
code and subsequent type propagation infers more accurate types.

Performance improvement (armv8):
DartMicroBench.IntPower3 196.4%
DartMicroBench.IntPower2 273.1%

Change-Id: I7076608f828484c4045e7a7b605ed8ff7981a868
Reviewed-on: https://dart-review.googlesource.com/75564
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-19 20:49:28 +00:00
Aart Bik a890d95a26 [vm/compiler] Avoid !(x>y) -> x<=y on fp operands.
Rationale:
Two closely related bugs found with fuzz testing!
NaN must be preserved. We may improve comparisons
on fp in the long run, but this CL avoids the
incorrect optimization.

Bug: https://github.com/dart-lang/sdk/issues/34467
     https://github.com/dart-lang/sdk/issues/34466

Change-Id: Ie3667632eea2583098cf5f86a723ab4304d5d6c5
Reviewed-on: https://dart-review.googlesource.com/75242
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-19 19:58:09 +00:00
Alexander Markov bc79674bc1 [vm/aot] Fix inferred type of implicitly initialized final fields
Bug: https://github.com/flutter/flutter/issues/21957
Change-Id: I63e1b6787761aaf7acfda653775518755ffcb0b5
Reviewed-on: https://dart-review.googlesource.com/75382
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-19 17:54:57 +00:00
Alexander Markov d44ffba254 [vm/tfa] Stop accepting non-empty entry points json files
Entry points JSON files are deprecated (replaced with pragmas).
So TFA should not require them. As a sanity check, it will complain
if an entry points JSON file is not empty.

Change-Id: Ie64121ab4cdd0c330f81a8cb71a671e1df82f136
Reviewed-on: https://dart-review.googlesource.com/75423
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-19 01:41:30 +00:00
Régis Crelier 30f0026022 [VM runtime] Fix type test: C is a subtype of C<FutureOr> (fixes #34482).
In other words, C<dynamic> <: C<FutureOr<dynamic>>,
because dynamic <: FutureOr<dynamic>.

Add regression test.

Change-Id: I64bcb3b6926143d3176f0afcd1f28d30582309fa
Reviewed-on: https://dart-review.googlesource.com/75400
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-09-19 01:35:40 +00:00
Aart Bik 4eb879133a Revert "[vm/compiler] Restrict !(x>y) -> (x<=y) to integral x,y"
This reverts commit 0471d7e3a1.

Reason for revert: crashes are happening on the Nullable test
                   I will fix this in the follow-up CL that was
                   already pending

Original change's description:
> [vm/compiler] Restrict !(x>y) -> (x<=y) to integral x,y
> 
> Rationale:
> Bug found with fuzz testing! For FP, behavior around
> NaN must be preserved.
> 
> Bug: https://github.com/dart-lang/sdk/issues/34466
> 
> 
> Change-Id: Ia4ed831fc130e58318edb838bd46e30b93f62ff3
> Reviewed-on: https://dart-review.googlesource.com/75208
> Commit-Queue: Aart Bik <ajcbik@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,alexmarkov@google.com,sjindel@google.com,asiva@google.com,ajcbik@google.com

Change-Id: Ie2e233a612cbe00478475d086eec87ff2b3d652b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/34466
Reviewed-on: https://dart-review.googlesource.com/75383
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2018-09-18 19:20:33 +00:00
Ryan Macnak 0d71b8aa40 Revert "[vm] Add a timeline stream for recording the zone high watermark."
This ended up not being helpful, and just makes the timeline harder to read.

This reverts commit 8590919ca6.

Change-Id: I0063dea0c4f6b37bf66a54df9b1c20a73dea40d9
Reviewed-on: https://dart-review.googlesource.com/75209
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-18 17:06:03 +00:00
Aart Bik 0471d7e3a1 [vm/compiler] Restrict !(x>y) -> (x<=y) to integral x,y
Rationale:
Bug found with fuzz testing! For FP, behavior around
NaN must be preserved.

Bug: https://github.com/dart-lang/sdk/issues/34466


Change-Id: Ia4ed831fc130e58318edb838bd46e30b93f62ff3
Reviewed-on: https://dart-review.googlesource.com/75208
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-17 23:39:12 +00:00
Vyacheslav Egorov 6cc9d5325b [vm] Use vmovdr instead of vmovsr when loading from Float64List
vmovsr can't access halfs of D16 and above.

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

Bug: 34462
Change-Id: I55042ff4e143b5a8d1ac6f4e6f5b888ec8d588ab
Reviewed-on: https://dart-review.googlesource.com/75021
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-17 23:34:47 +00:00
Vyacheslav Egorov c8e26d68cb [vm/compiler] Improve allocation sinking precision.
When we added support for sinking allocation of contexts
we forgot to update IsSafeUse method - meaning that non-escaping
objects stored into sinkable contexts would not be considered
sinkable.

This change rectifies the problem. With this change the method

test_vm_field() {
  var obj;
  inner() => obj.x = 42;
  var a = new V();
  obj = a;
  var t1 = a.x;
  var t2 = inner();
  return a.x + t1 + t2;
}

Compiles down to

test_vm_field() => 84;

Before this change we would not sink allocation of V.

R=alexmarkov@google.com

Change-Id: If431e58fe1d958b31ea597e35cba3856558a0cca
Reviewed-on: https://dart-review.googlesource.com/75222
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-09-17 23:24:45 +00:00
Ryan Macnak 0c80630577 [vm] Fix ia32/x64 gcc build.
(The simulators are broken at runtime.)

Change-Id: I10089cad44fca57145cfdd598342279f07c6d7fd
Reviewed-on: https://dart-review.googlesource.com/75205
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-17 22:27:43 +00:00
Ryan Macnak c1ea77a3a0 [vm] Extend --trace_deoptimization to cover the lazy deopt causes.
Change-Id: I09843815297fe13ca2f6880e794cc26c76dc6267
Reviewed-on: https://dart-review.googlesource.com/75126
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-17 22:18:12 +00:00
Ryan Macnak 29d36dd8d0 [vm, kernel] Fast-path for reading non-generic types.
Change-Id: I24d598aa66efa414b04e364bf5dce10bdc917904
Reviewed-on: https://dart-review.googlesource.com/75122
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-17 20:28:23 +00:00
Ryan Macnak 57df49576d [vm] Fix -O0 build.
Change-Id: I16a887a14838787a9f9fe15fd34d3ca6295a5d33
Reviewed-on: https://dart-review.googlesource.com/75203
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-17 18:09:14 +00:00
Alexander Markov 050561fd82 [vm] Relax recently added assertion in Dart 1 mode
This CL relaxes assertion added recently in
c6c4748185 as it could fail in Dart 1
mode.

This should fix 'checked vm tests' step on debug bots which still runs
tests in Dart 1 mode.

Change-Id: Ifdd6e27087b44822ce9cd5be48750af1c7d45a8e
Reviewed-on: https://dart-review.googlesource.com/75201
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-17 17:36:00 +00:00
Alexander Markov 76091c13db [vm/bytecode] Add PushNull, PushTrue, PushFalse and PushInt bytecodes
These bytecode instructions are added in order to shrink constant pools
and reduce time spent for reading constant pool entries.

Change-Id: I8522f73dc7a6236969ac0422c6cb89b945559b2d
Reviewed-on: https://dart-review.googlesource.com/75125
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-15 17:55:46 +00:00
Alexander Markov c6c4748185 [vm/bytecode] Bytecode compilation
Change-Id: I09192e4e929a397920c217b605580f8c4880e7c2
Reviewed-on: https://dart-review.googlesource.com/74002
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-09-14 22:02:29 +00:00
Ryan Macnak 78d9a281d3 [vm, arm] Globally block LR for register allocation.
Flutter Gallery release:
Instructions(CodeSize): 5668368 -> 5670880 (+0.044%)

Fixes #34411

Bug: https://github.com/dart-lang/sdk/issues/34411
Change-Id: I5281ac9609ec5953cdaa881226f7034a5697d0ce
Reviewed-on: https://dart-review.googlesource.com/74923
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-14 21:58:29 +00:00
Alexander Aprelev 078be2cb61 [vm] Add library private key to the Class hash function for reload.
This reduces isolate reload time on a given sample from ~2 seconds to ~200 milliseconds.
Remove ASSERT - you can have replacement finalized when original was non-finalized

Bug: https://github.com/dart-lang/sdk/issues/34461
Change-Id: I39dc5d67e97bd7c0d654cd751b6829b00337e967
Reviewed-on: https://dart-review.googlesource.com/74961
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-14 20:45:45 +00:00
Vyacheslav Egorov 229d793602 [vm/compiler] Support materializing unboxed variables when entering catch.
Previously we tried to rely on the assumption that all variables would be
boxed - so the machinery for setting correct catch-entry state only
supported tagged values and constants. However this both leads to worse code
and is not entirely correct assumption.

This also:

- renames various confusingly named classes: we move away from talking
about "catch entry state" to "catch entry moves" - because we only
record a subset of moves that needs to be performed and that does
not describe the whole state;
- refactors a bunch of associated code to be more readable and maintainable;
- adds documentation about catch implementation in optimized code
to runtime/docs/compiler;

Fixes https://github.com/flutter/flutter/issues/21685.

Change-Id: I03ae361a1bb7710acbd9f661ae014e663a163c59
Reviewed-on: https://dart-review.googlesource.com/74860
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-14 17:39:12 +00:00
Ryan Macnak 91cbb57cd5 [vm] Behave more gracefully for kernel-based Scripts that lack source (i.e., from a core snapshot).
Change-Id: Ie3a40a4ceb85e450f47f46a019626a0b553c14c7
Reviewed-on: https://dart-review.googlesource.com/74661
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-12 19:51:43 +00:00
Régis Crelier a6a48f2e52 [VM runtime] Follow up to new NativeEntryData class.
Demote newly introduced VM class NativeEntryData from a VM instance class
to a simple TypedData wrapper class.

Change-Id: I44aacee33500c93eb283d2d349cd7a24dd94de65
Reviewed-on: https://dart-review.googlesource.com/74323
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-12 18:49:06 +00:00
Vyacheslav Egorov e7bde9195b [vm/compiler] Don't try to load receiver in tear-offs of static no-such-method forwarders.
Such forwarders can arise as a result of hot-reload (e.g. IsolateReload_TearOff_Remove).

Change-Id: Id3c5ef28c44415f3388bd2d0c24ebac5845e912f
Reviewed-on: https://dart-review.googlesource.com/74581
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-09-12 18:06:45 +00:00
Vyacheslav Egorov 89fa4739de [vm/compiler] Disable multiple entry-points
Implementation is missing few bits in the register allocator
and causing GC crashes.

Bug: https://github.com/dart-lang/sdk/issues/34435
Change-Id: I4779797351c6853b87a5fef663324973e8a64c99
Reviewed-on: https://dart-review.googlesource.com/74641
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-09-12 17:12:10 +00:00