Commit Graph

2345 Commits

Author SHA1 Message Date
Zach Anderson b4b02a6bde [vm] Include bytecode in core-jit and app-jit snapshots
when the --enable_interpreter flag is passed to gen_snapshot/dart.

Change-Id: I6e9481e1793e4c97fd6b14b56e55aafcb044fc23
Reviewed-on: https://dart-review.googlesource.com/c/78150
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-10-08 19:51:10 +00:00
Ryan Macnak 41a9c38433 [vm, compiler] Shrink deopt stub and runtime call sequences.
dart2js release
AOT X64 Instructions(CodeSize): 10171456 -> 10090272 (-0.798%)
AOT ARM Instructions(CodeSize): 10814976 -> 10708512 (-0.984%)
AOT ARM64 Instructions(CodeSize): 11751328 -> 11646464 (-0.892%)
JIT X64 Instructions(CodeSize): 14296224 -> 13593536 (-4.92%)
JIT ARM Instructions(CodeSize): 16034352 -> 15685664 (-2.17%)
JIT ARM64 Instructions(CodeSize): 17207968 -> 16901504 (-1.78%)

Bug: https://github.com/dart-lang/sdk/issues/26033
Change-Id: Ic41a80fe8a90973811e74471e13f3edb6e4bffb6
Reviewed-on: https://dart-review.googlesource.com/c/77987
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-10-08 17:44:43 +00:00
Ryan Macnak b2d22be0f3 [vm, arm64] Take advantage of Fuchsia's lack of signal handlers.
Change-Id: I5cac30574a697a91116658cab5289d80f316f4b1
Reviewed-on: https://dart-review.googlesource.com/c/77901
Reviewed-by: Zach Anderson <zra@google.com>
2018-10-08 16:59:20 +00:00
Alexander Aprelev 08f6b34f78 Revert "[vm] Assert that we are not trying to construct old(reloaded) class constructor."
This reverts commit ff3a841e2d as it
breaks quite a few reload buildbots tests.

Change-Id: I6e1d0bc6b69d4349e2ee47cb3419ec90ea129384
Reviewed-on: https://dart-review.googlesource.com/c/78380
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-10-05 22:06:18 +00:00
Alexander Aprelev ff3a841e2d [vm] Assert that we are not trying to construct old(reloaded) class constructor.
Construction of old class constructor is not possible since we didn't keep its fields, its structure.

Change-Id: I1e2239c0aa1012737e94c8ba42b0fc07a732b61d
Reviewed-on: https://dart-review.googlesource.com/c/77986
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-10-05 15:52:31 +00:00
Alexander Markov 54a1738f87 [vm/compiler] Allocate result of BIT_NOT constant evaluation in Heap::kOld
Fixes https://github.com/dart-lang/sdk/issues/34683

Change-Id: I6f7b797e495f2af61fa27eecca3a3e6aadfdc3b5
Reviewed-on: https://dart-review.googlesource.com/c/78188
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-10-05 01:30:12 +00:00
Aart Bik a6f4b8d879 [vm/compiler] Fix crashes in AOT X64 DEBUG compiler.
Rationale:
The method ConstructReplacementFor() in range analysis would unconditionally
replace an UnaryInt64Op with an UnaryUint32Op, regardless of whether it contains
an NEGATE or NOT. None of the backends supports a NEGATE UnaryUint32Op,
however (I added a missing assert to X64 for the future, even though we currently
found the issue in the constructor already). Note that alternatively we could implement
NEGATE UnaryUint32Op for all platforms.

Note:
A similar issue was found for TRUNCDIV with a second fuzz test, which is fixed
in same CL with a more general approach.

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


Change-Id: I370268620008e5d4cb605c0bd11e423d8fcd5327
Reviewed-on: https://dart-review.googlesource.com/c/78148
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2018-10-04 23:10:45 +00:00
Alexander Markov a97ddf8ce1 [vm/bytecode] Fix sporadic crashes when running with bytecode.
Several tests crashed sporadically as bytecode Code object was not
properly scanned by GC.

Change-Id: I4810c46552a9f1990f1304f7c502b3408df8ed88
Reviewed-on: https://dart-review.googlesource.com/c/78141
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-10-04 20:01:25 +00:00
Alexander Markov 46983c2de9 [vm/aot/tfa] Detect if a method/setter is called from this
This information could useful in AOT to omit unchecked entry points.

Change-Id: I1c54720e46d578dc64f67306abdf4619a34ae122
Reviewed-on: https://dart-review.googlesource.com/c/77921
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-10-04 11:26:44 +00:00
Alexander Markov 6d0601a72b [vm/bytecode] Add bytecodes for int operations and '== null'
DeltaBlue performance in pure interpreted mode
(--enable-interpreter --compilation-counter-threshold=-1):
Before: DeltaBlue(RunTime): 269198.732 us.
After:  DeltaBlue(RunTime): 158216.34376923076 us. (-41.23%)

Change-Id: I9dea8d7949421986ee6fbdeae046fe4ef6d3227f
Reviewed-on: https://dart-review.googlesource.com/c/77231
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-10-03 15:45:36 +00:00
asiva 30aa464f77 [VM] Remove 'corelib' and 'dart-io' sources generation into C++ arrays
- Remove all code that generates the corelib and dart:io library sources into C++ arrays and link them into dart_bootstrap
- Remove the executable dart_bootstrap and all uses of it
- Remove bootstrap_nolib.cc and builtin_nocore.cc
- Remove the Dart 1 code in core lib bootstrap path

Change-Id: Ifd33496204285a08b42fe09e39428e7a92b416b6
Reviewed-on: https://dart-review.googlesource.com/c/77241
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-10-02 23:27:05 +00:00
Zach Anderson 07a2130724 [vm] Set translation helper allocation space in kernel loader
This mainly prevents Strings that will eventually be turned into
symbols anyway from being allocated in new space.

Picks up a couple percent during kernel loading.
Possibly avoids triggering a scavenge?

Change-Id: Ide3dca13306981131e6152004e068c2154f9fc4c
Reviewed-on: https://dart-review.googlesource.com/77484
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-10-01 22:18:34 +00:00
Alexander Markov c78f67cc7e [vm/aot] Use TFA to detect dynamic, non-this and tear-off uses
TFA is improved to detect if a method was called using dynamic selector,
was ever called not via this, and whether the tear-off was taken.
This information is used to remove parameter type checks in AOT.

Less accurate selector-based analysis, which was used previously to get
this information, is now used only if TFA is disabled.

Also, precompiler is improved to omit method extractors and implicit
closure functions if analysis proved that tear-off is not taken.

Flutter gallery snapshot size: -0.8%

Change-Id: Iec01257dfdc78104752104df14e2ce078d326a96
Reviewed-on: https://dart-review.googlesource.com/77005
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-09-28 23:49:09 +00:00
Alexander Markov deb0645654 [vm/bytecode] Cleanup unused bytecode instructions
Change-Id: I956525dbeb3fdcb4b65a5530dbb59a96b4a02e81
Reviewed-on: https://dart-review.googlesource.com/77224
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-28 21:23:22 +00:00
Alexander Markov 2aac05fe10 [vm/bytecode] Add specialized JumpIf* instructions
This change adds JumpIfEqStrict, JumpIfNeStrict, JumpIfTrue, JumpIfFalse,
JumpIfNull, JumpIfNotNull bytecode instructions. These instructions
supercede If*/Jump instruction patterns.

Change-Id: Icf9dc624001ce64d4b21409864591d693ead51d3
Reviewed-on: https://dart-review.googlesource.com/77011
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-28 16:29:23 +00:00
asiva c9f5c3a79e [VM] Delete access to Dart 1 parser.
- delete access to Dart 1 parser
- Skip codegen unit tests as they use the Dart 1 parser

Change-Id: I24f3986fac9c496e231c723c6eaa0704e6a616f5
Reviewed-on: https://dart-review.googlesource.com/77009
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-27 23:08:20 +00:00
asiva 76470aca47 [VM] use coresnapshot when initializing an Isolate
- use core snapshot when initializing an isolate (CorelibIsolateStartup benchmark moves from 39s to 2s)
- remove use_dart_frontend flag from the isolate specific flags
- the script snapshot API functions now return an error

Change-Id: Ia562e007fdbfd1d3ebd8e1a0c8feee238bada00b
Reviewed-on: https://dart-review.googlesource.com/76709
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-27 00:55:07 +00:00
Ryan Macnak 808ed6238b [vm, compiler] Make register allocator instead of assembler put the write barrier value into a fixed register.
Unlike the assembler, the register allocator is in a position to avoid a move. Use the call result register since it is the most popular value source.

This pattern will also be needed to get the write barrier slot into a fixed register for card-marking, since X64 and ARM don't have a TMP2.

dart2js aot product:
X64 Instructions(CodeSize): 9049952 -> 8994240 (-0.62%)
ARM Instructions(CodeSize): 9772096 -> 9711696 (-0.62%)
ARM64 Instructions(CodeSize): 10185056 -> 10122496 (-0.61%)

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: Id2e9dd7b3d86069a9da3ba4e141720511ce6399e
Reviewed-on: https://dart-review.googlesource.com/76307
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-26 23:55:27 +00:00
Alexander Markov 5d10974a89 [vm/bytecode] Use _simpleInstanceOf for certain 'is' checks in bytecode
DeltaBlue benchmark, platform with bytecode, pure interpreter mode
(--enable-interpreter --compilation-counter-threshold=-1), best of 5 runs:
Before: DeltaBlue(RunTime): 391061.47400000005 us.
After: DeltaBlue(RunTime): 285747.36557142856 us.

Change-Id: I875f227cf19e0f75687c13910b1d957ee595652b
Reviewed-on: https://dart-review.googlesource.com/76708
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-26 21:50:41 +00:00
Régis Crelier 79d639a3a8 [VM interpreter/bytecode] Modify argument order for AssertAssignable bytecode.
The new argument order matches the runtime call and requires less copying.
Simplify Function::HasCode()
Remove obsolete workaround when updating type test cache.

Change-Id: I57c988f97ee2259a22730f445f336cd2a085959e
Reviewed-on: https://dart-review.googlesource.com/76584
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-26 21:15:16 +00:00
Alexander Markov d9fb4b03a6 [vm/compiler] Fix recent regressions due to inaccurate type merging
This is the follow-up fix for
https://github.com/dart-lang/sdk/commit/f81709c3e34438201682237e4faf6cb886094129

As part of that change, merging of known cid and abstract type in
LoadFieldInstr::ComputeType() was done less precisely, loosing a chance
to calculate a more accurate abstract type if cid is known.

This change fixes the problem by resetting abstract type if cid is known.
Similar change is also applied to LoadStaticFieldInstr::ComputeType().

Change-Id: I2b7dfa961e26c0ea98e66aaf9b9afb235dfa5684
Reviewed-on: https://dart-review.googlesource.com/76723
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-26 20:27:25 +00:00
Alexander Markov 15c64b4b77 [vm/aot] Remove 'rounds' from precompiler
This is a follow-up for the review comment
https://dart-review.googlesource.com/c/sdk/+/76562/4/runtime/vm/compiler/aot/precompiler.cc#212

Change-Id: I22ba55f6bb9e64fef917dea29cdf1ed61d02ee11
Reviewed-on: https://dart-review.googlesource.com/76582
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-26 17:36:33 +00:00
Alexander Markov f81709c3e3 [vm/aot] Use field types inferred in TFA and remove inference in precompiler.cc
Type inference for final fields in precompiler.cc is limited and
does not properly handle constant objects.

This change hooks up field types inferred by TFA and removes the
inference in precompiler.cc.

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

Change-Id: Ida65cd211074623928bb2a7d48dc58d5e53511b8
Reviewed-on: https://dart-review.googlesource.com/76562
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-25 23:26:09 +00:00
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
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
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
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
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
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
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
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
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 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
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
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
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
Régis Crelier ce75b485ad [VM bytecode] Allow library of symbol to be null.
This fixes a cast failure introduced in
https://dart-review.googlesource.com/c/sdk/+/74322

Change-Id: If4688df152cba1457a9e102d1a68ce09cdfa5872
Reviewed-on: https://dart-review.googlesource.com/74498
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-09-12 01:33:50 +00:00
Régis Crelier a2fae0125f [VM interpreter] Mark activation frames as interpreted instead of crashing.
This is a first step in supporting bytecode in the debugger.

Change-Id: Ieb06b8b534fcc7f0291457cd6912d772b8ee247a
Reviewed-on: https://dart-review.googlesource.com/74012
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-09-12 00:33:30 +00:00