Commit Graph

15405 Commits

Author SHA1 Message Date
Alexander Markov d0f9c9c1a7 [vm/compiler/bytecode] Infer receiver type in bytecode functions
Before: BuildTableBuffer(RunTime): 10.759671901226596 us.
After: BuildTableBuffer(RunTime): 9.78219236600898 us.
(--enable-interpreter, best of 5 runs)

Issue: https://github.com/dart-lang/sdk/issues/36429
Issue: https://github.com/dart-lang/sdk/issues/36342
Change-Id: If645fb6767a35e39ff1a75fcf91d0a03c3b16987
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101720
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-05-08 18:10:06 +00:00
Alexander Markov e9bec21d13 [vm/bytecode] Cleanup after switching to compact bytecode instructions
Change-Id: Ie6ecdd88e8d1740c53cfb3fbc4b43f9e41c592b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101491
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-08 17:33:15 +00:00
Alexander Markov 6fe73e4544 [vm/bytecode] Support compact bytecode instructions in VM (part 2/3)
While adding support for new compact bytecode instructions,
VM also keeps support for old bytecode instructions to preserve
backwards compatibility and allow soft transition.

This change is separate from bytecode generator changes in order
to test VM with old bytecode generator.

Corresponding bytecode generator changes:
https://dart-review.googlesource.com/c/sdk/+/99400

Change-Id: Icf5ceee7d51f27ffe3f79d0eae81e0ddc0a7e855
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101062
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-08 17:33:15 +00:00
Alexander Markov 1cc4003e5a [vm/interpreter] Support misaligned bytecodes (compact bytecodes 1/3)
This is a preliminary refactoring to prepare for compact
variable-length encoding of bytecode instructions.

Change-Id: I7b15926ab5a6222fbcd1f0090adc0b7222359b07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99960
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-08 17:33:15 +00:00
Stevie Strickland 13fa51ed54 [vm] Make Library::FindPragma a static method.
It already is a static method in implementation, so this way
we don't duplicate the work of looking up the library. In addition,
it checks has_pragma, so we don't need to check before calling it.

Change-Id: I88281cf22615e30157c842c570bd0f6b499a6a3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101821
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-05-08 14:49:45 +00:00
Alexander Aprelev cbff5cff2f [vm/reload] Fix scenario when class removed during hot reload stays unpatched.
Fixes https://github.com/dart-lang/sdk/issues/36838

Change-Id: I73aa25e4ab5d7fac13fcc6953fa6c3a6c4c10ab4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101625
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-07 23:13:27 +00:00
Alexander Aprelev f1dcb7f2a9 Fix PRESUBMIT.py so it is python3-compatible.
Change-Id: I751220a9bfbfff61c281c6592477e11ab60877fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101700
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-05-07 20:53:06 +00:00
Chinmay Garde aa64d1d2e6 Allow building Dart with Fuchsia SDK enabled buildroots.
The Fuchsia SDK can now be consumed by non-Fuchsia buildroots to produce
Fuchsia artifacts.

The Fuchsia SDK comes with a JSON manifest that describes the various SDK
"parts". GN targets are stamped for each of these parts. The location of these
GN targets can be configured. That location is set to |fuchsia_sdk_root| in
each buildroot. This variable is defined in //build/fuchsia/sdk.gni in each
buildroot. For buildroots that don't care or know about the Fuchsia SDK, that
file may not exist. This is why, the import of that file is guarded behind
the is_fuchsia flag. When the Fuchsia SDK is enabled, that file will define
values for two required variable |using_fuchsia_sdk| and |fuchsia_sdk_root|.

The first flag defines if the SDK is being used. If unset (but defined), the
builds are in-tree. Eventually we want only SDK builds. |fuchsia_sdk_root|
is set to the spot in the buildroot where the GN targets for the SDK parts
are stamped.

Change-Id: I604612c8d6a21efb07b323610e80b596abc1a6dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101540
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Chinmay Garde <chinmaygarde@google.com>
2019-05-07 00:43:33 +00:00
Matthew Dempsky a53c12d07a [vm] Use std::unique_ptr with Message
Message is a C++ type with a simple ownership model appropriate for
std::unique_ptr. This CL applies the following changes:

1. All uses of "new Message(...)" are replaced with
"Message::New(...)", which is effectively
"std::make_unique<Message>(...)". (The latter was only added in C++14,
but Dart still compiles in C++11 mode.)

2. All owning Message* are replaced with std::unique_ptr<Message>. The
notable exception is MessageQueue, which still uses raw Message*
internally to simplify the linked list handling.

3. All "delete message;" statements are removed.

4. Uses of "NULL" replaced with "nullptr" as necessary.

Change-Id: I05b5804289f2a225bfa05d3c1631129358fed373
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101222
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Matthew Dempsky <mdempsky@google.com>
2019-05-06 21:01:39 +00:00
Alexander Markov c3285a77d6 [vm/bytecode/compiler] Make sure the first successor in branches corresponds to fallthrough
Forward jumps in bytecode usually go to the 'else' part (skipping 'then')
or exit loops. In order to generate Branch instructions in flow graph
which would represent ifs and loop conditions more naturally the first ('true')
successor of a BranchInstr should correspond to fallthrough in bytecode, and not the
target of a Jump bytecode instructions.

This results in a slightly better register allocation.

Golem shows overall improvement +0.4620% on x64 and +0.8395% on arm64.

Issue: https://github.com/dart-lang/sdk/issues/36429
Change-Id: I1ea581ef9f5998eb960914680d0e867c57639f1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101361
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-05-06 17:50:57 +00:00
Alexander Markov e1d6decd7b [vm/bytecode/compiler] Mark _simpleInstanceOf calls with Token::kIS
'is' checks which are represented as _simpleInstanceOf() calls
are sometimes recognized by Token::kIS and not by a target of a call.

Before: TypeChecks.IsCheck(RunTime): 279.63057234726693 us.
After: TypeChecks.IsCheck(RunTime): 200.77956524794217 us.
(best of 5 runs)

Issue: https://github.com/dart-lang/sdk/issues/36429
Change-Id: I5a22222c59c33d2fa8262383a597c2c013ab61b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101322
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-05-06 17:42:53 +00:00
Stevie Strickland b4814384ff [vm/compiler] Add optional opcode arg to ILMatcher::TryMatch.
When provided, the opcode is implicitly inserted before each provided
MatchCode, which simplifies test cases that contain kMoveGlob or
kMoveParallelMoves before all other types of entries.

Change-Id: I51119fb66176cb54e1588687aa53b8d4ce80d9b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101290
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2019-05-06 11:29:28 +00:00
Stevie Strickland 9486e99114 [vm/compiler] Forward typed data view constructor arguments.
Also adds tests for load optimizer fixes in 836c04f.

Bug: https://github.com/dart-lang/sdk/issues/36570
Change-Id: Ie8ea7f944bc789b4c0894f9d96010113fb3ec4b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99466
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-05-06 10:12:48 +00:00
Ben Konyi 1ef3818f79 [ VM / Service ] Added resolved_url field to frames in _CpuProfileTimeline response
The resolved_url field for Dart frames will contain the resolved url for
the script associated with the frame's function. This field is NULL for
native methods.

Fixes #36718

Change-Id: I8f15c9d02eb6d3628706338a8a1dd0e76e51eb9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100725
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
2019-05-03 22:27:08 +00:00
Aart Bik 8bc1b2b41c [dart/fuzzer] Restrict libFuzzer to linux
Rationale:
Mac and possibly Windows build don't love fuzzing yet.
Change-Id: Ided9734285197e51145102532e1f59550e261bcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101342
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-05-03 20:37:48 +00:00
Zichang Guo f06c42d2b6 [vm,debugger] remove column number check in GetBreakpointLocation
Once breakpointLocation has been resolved into token position, line breakpoint and column breakpoint should be the same. Then check only token position to remove possible duplicates.

Also some variable renaming. A "bpt" could be class "Breakpoint" or class "BreakpointLocation" in different part of functions. Rename the variables to reduce confusion.

Bug: https://github.com/dart-lang/sdk/issues/35368
Change-Id: I0875b5b48300a800acacf55440b65d892f4e9301
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101060
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-05-03 20:05:28 +00:00
Matthew Dempsky 0707abbaf0 [vm] Remove unnecessary indirection in AlternativeGenerationList
Change-Id: I2f3da7d68cf1b9b568e3841cd8b7c8a79d467e3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101063
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Matthew Dempsky <mdempsky@google.com>
2019-05-03 18:43:22 +00:00
Ben Konyi bdc91968a2 [ VM / Service ] Updated JSONWriter::PrintValue(double) to use double_conversion instead of Printf.
Fixes #31737

Change-Id: If70b7b6bdd1e977bda310a2b0566dcd48c6b3c6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101101
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-03 18:07:27 +00:00
Vyacheslav Egorov 836c04f3d2 [vm/compiler] Ensure aliasing between *[C|S] and X[C'|S'] for S < S'.
Previously when computing aliasing during load propagation we only
propagated aliasing from X[C'|S'] to *[C''|S''] for S' < S''.

The code incorrectly assumed that this propagation is symmetric (which
it is not) and expected that *[C|S] would be cross aliased with X[C'|S']
when *[C|S] is visited.

Now we split symmetric and non-symmetric parts of the aliasing

computation: X[C'|S'] propagates aliasing to X[C''|S''] for S' < S'' -
which is symmetric. Separately if X is an aliased instance we propagate
aliasing from X[C'|S'] to *[C|S] for all sizes S.
Change-Id: Iccd4c73a18ffd3f60fd179df43a6b117e0844b64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101281
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-05-03 14:18:28 +00:00
Stevie Strickland 0130ffed1b [vm/compiler] Check for errors when loading test scripts.
Change-Id: Iccec96b86ac9bca5bb53e8dc0fb2aa30fde24fd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101261
Auto-Submit: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-05-03 13:54:23 +00:00
Ryan Macnak 5393ce7d35 [vm, service] Fix parameter handling for profiler timeline RPCs.
Add missing required parameter "tags" to internal invocation in Dart_WriteProfileToTimeline.

Add service tests for accessing the profiler samples as timeline events.

Fix the profiler for threads spawned from the Mac eventhandler. Compare 5d02929fa0.

Bug: https://github.com/dart-lang/sdk/issues/26416
Bug: https://github.com/dart-lang/sdk/issues/36830
Change-Id: I5b3cb8f3530da081057090879c6ab820deba1510
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100988
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-05-02 23:05:39 +00:00
Zichang Guo 482c36d9ae [vm/debugger] Remove script soucre look up in debugger
When resolving column breakpoint, debugger will lookup the character in the source of script to make sure the column has been specified within the range of a valid identifier.
With this CL, column breakpoint will be resolved previous safepoint position, if requested column falls within [saftpoint, next_safepoint/end of line(smaller one)]. For example, setting column breakpoint on left bracket of a function call might be resolved to function call now. Setting on the end of line will resolved to previous safepoint.

BUG: https://github.com/dart-lang/sdk/issues/36642
Change-Id: I16427772fde4c653da7629e3340282ef1d9046eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100404
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-05-02 18:43:55 +00:00
Aart Bik 98f67ff3d4 [dart/fuzzer] Mechanism for target functions
Rationale:
Runtime dispatch on various target functions.
Also adds new target function (which found an
issue) and prepares Dart VM setup.

https://github.com/dart-lang/sdk/issues/36818

Change-Id: I80e2d567087b435404331e2539f2cda19cadb04e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100989
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-05-02 18:12:19 +00:00
Ben Konyi ded5c3efd5 [ VM / Service ] Fixed HTTP requests with params not working correctly when auth codes are enabled
Change-Id: Ia6dbab2c8e46cdd1fce659f55ee16f3ad98e5d6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101021
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-05-02 17:38:49 +00:00
Aart Bik aceefaf846 [dart/vm]: fix bug in TextBuffer capacity
Rationale:
Ensuring capacity computation was off by one (due to trailing '\0')
if the initial buffer size was zero. Granted, this can only happen
after a Steal(), but since API did not exclude reuse after this
operation, it is better to just handle this than crash.

https://github.com/dart-lang/sdk/issues/36818

Change-Id: I4e404c4361da03e24364280fb01a308fbf7ace6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100991
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-05-01 22:26:41 +00:00
Ryan Macnak 58c6d78712 [vm] Check Zones are only [un]chained on the correct side of a safepoint transition.
Fix order in Dart_CreateIsolate and some tests.

Change-Id: Iceb748be3f7aa6b68ce7abb7f65a3c54ad63c1d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100795
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-05-01 00:36:14 +00:00
Matthew Dempsky 4ce3aa7af1 [vm] Replace ^= assignments with = where possible
Change-Id: I04ac2e9c4b8bb654b7c660e728be3867aa4e1513
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100923
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Matthew Dempsky <mdempsky@google.com>
2019-05-01 00:04:44 +00:00
Aart Bik ee1192e693 [dart/vm] Extended graph checker
Rationale:
Added more sanity checks on def-use and use-def
data structures in the IR, as well as some smi
sanity checks.
Change-Id: I3451cf45050dc305b35dd7da6f6b96d287de4887
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100727
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-30 22:36:52 +00:00
Aart Bik a32fee5d8e [dart/vm] GenericCheckBound (AOT) may throw
Rationale:
Previous CL inadvertently removed the may-throw tag
from the AOT version of check bound. But, unlike its
speculative counterpart, this non-speculative check
will throw when out of bounds. Optimizations like LICM
rely on this property for correctness. Found with fuzzing!

https://github.com/dart-lang/sdk/issues/36803

Change-Id: I05952f423ffa1917a08dbb6191d0d1533450bc9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100921
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-30 22:32:07 +00:00
Alexander Markov 3b22a7ae46 [vm/profiler] Fix native stack walker to properly skip PC = 0xFF..FF
Fixes flaky service/get_cpu_profile_timeline_rpc_test test failure on debug/simdbc64
(Error "../../runtime/vm/profiler_service.cc: 290: error: expected: start_ < end_".)

Fixes https://github.com/dart-lang/sdk/issues/31794
Possible fix for https://github.com/dart-lang/sdk/issues/28736

Change-Id: I0119830d966aa24713c8572e28e4fc67e6d0de49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100920
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-30 22:27:12 +00:00
Ryan Macnak ac4fd50446 [vm, compiler] Check for length overflow when eliminating write barriers for variable-length objects.
Bug: https://github.com/dart-lang/sdk/issues/36778
Change-Id: I03bd00dd5a035309807e16911dcd7602b4de5e44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100900
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-04-30 21:36:07 +00:00
Ben Konyi 5fbf7720f8 [ VM ] Updated splay-tree licenses, added V8 project authors to AUTHORS
Change-Id: I02e38f3b80617d0d4ddf398cb94e8ee027d68e0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100889
Reviewed-by: Zach Anderson <zra@google.com>
2019-04-30 19:50:46 +00:00
Ryan Macnak e803d02227 [vm] Update Isolate to C++11 style.
Change-Id: Iff2ea5366a99a42394e663852dcfee25ab7109d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100566
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-30 18:53:41 +00:00
Alexander Markov a8d034f3e1 [vm/reload] Make sure classes in saved class table are visited by GC
Previously, IsolateReloadContext::CheckpointClasses() was filling
local_saved_class_table with raw pointers to classes and at the same
time it was adding classes to the set which is based on Array.
After that local_saved_class_table was saved into saved_class_table_
were it becomes visible to GC. However, adding an element to the set
may trigger GC in the middle and pointers for already processed
classes in local_saved_class_table are not visited and are not updated
if GC moves a Class object.

Also, IsolateReloadContext::VisitObjectPointers was not visiting
classes in saved_class_table_ properly as it was interpreting it as
an array of saved_num_cids_ pointers (while it is an array of
ClassAndSize elements).

This change fixes flaky crashes in vm/dart/trigger_gc_in_native_test.

Change-Id: I25b2e50995cf580bc9347f06875d344f75a1a950
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100728
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-30 17:07:20 +00:00
Ryan Macnak 347b72c260 [vm] Bypass malloc for large Zone allocations to avoid jemalloc leaks.
Revert 9a07ad88f4.

Bug: https://github.com/flutter/flutter/issues/29007
Change-Id: I6a5f51f0c3a54d354ec5f8495677d46f94d8a1d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100568
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-30 16:17:18 +00:00
Samir Jindel 7757c3e948 [vm] Consolidate generic move code between ParallelMoveResolver and FFICall
Will be useful for FFI callbacks.

Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try
Change-Id: I7940d4a58a036e4cb868fc89311f659039f5d23f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100381
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-04-30 13:34:58 +00:00
Ryan Macnak 243373af1c [vm, x64] Tighten the monomorphic entry sequence.
Change-Id: Ie705e8978bd14cc767f70d7f551ea0eaffd5c823
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100621
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-30 01:10:27 +00:00
Alexander Markov 6e72fed210 [vm] Fix for flaky crashes in background compiler while Dart_SortClasses() is running
Background compiler could be running while Dart_SortClasses() clears all
code. It causes flaky crashes on vm/dart/appjit_bytecode_simple_test test
as background compiler may need to access bytecode, which can be read in
mutator thread only.

Also, background compiler may potentially add new code which would not be
compatible with rearranged class ids.

This CL stops background compiler in Dart_SortClasses() before code is
cleared to avoid these conflicts.

Change-Id: Ide30d469dc1c4b0e853a2244dc2ddfd5cb70d86a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100726
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-29 23:35:27 +00:00
Ryan Macnak 611dbeb387 [vm, fuchsia] Fix deps and stop suppressing -fvisibility=hidden.
Linking on Fuchsia is more constrained because libdart is a shared library on Fuchsia and a static library everywhere else.

Change-Id: If97385ee0b23b6ed75abd28b14dae5de123915f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100625
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-29 23:31:27 +00:00
Devon Carew 87a3256e8f Add lineOffset and columnOffset fields to the Script service protocol class.
Change-Id: I90c482fb3450bb6bbef5d5fa77ae736e6ed76b95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99191
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-04-29 22:52:17 +00:00
Alexander Markov 0b9060ec1d [vm] Fixes for flaky crashes when querying source or source location
There were no checks for missing source or source position, which
caused flaky crashes while running test mirrors/mirrors_reader_test.

Change-Id: I73497414ebe7b030ba308851038e0ef9e133aa48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100781
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-29 22:10:38 +00:00
Alexander Markov 6436104712 [vm/tests] Fix flaky crashes on vm/cc/GenKernelKernelMaxRSS test
vm/cc/GenKernelKernel* tests enabled interpreter by setting
FLAG_enable_interpreter in order to benchmark bytecode reading.
As a side effect, this enables interpretation of special functions
(like implicit getters) on other isolates such as kernel-service isolate.
They may even reach compilation threshold and unoptimized background
compilation is triggered. However, as isolate was created with
FLAG_enable_interpreter == false, unoptimized BackgroundCompiler was not
created, so it causes flaky crashes.

A less intrusive way to enable bytecode reading is to set
FLAG_use_bytecode_compiler.

Change-Id: Ie0601d43816b29c62fb0278ed4666d38fc4328c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100788
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-29 21:37:58 +00:00
Alexander Markov c4c357eb21 [vm/interpreter] Fix for flaky crashes in interpreter
Reload an instance after runtime call as it could be moved by GC.
Fixes flaky crashes on standalone_2/fragmentation_typed_data_test/3 test.

Change-Id: I2724fa0f59ceb0477f4afc5a975c696d075ad368
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100785
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-29 20:23:48 +00:00
Aart Bik 6ef55cee3e [dart/vm] fix build breakage in assembler_dbc_test
https://github.com/dart-lang/sdk/issues/36796

Change-Id: I16a2cce5aa20cc29c47faf81699892a6370d3b55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100782
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-29 19:25:40 +00:00
Ryan Macnak 7d462b12b9 [vm, fuchsia] Add back -fvisibility=hidden suppressions.
Some targets still rely on implicit symbol exports.

This partially reverts commit e7175ac2ed.

Change-Id: I6dc585e6f15012882348dca11571d964c2b6f7c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100723
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-29 18:46:49 +00:00
Ben Konyi 24396182e1 [ VM / Service ] Handle case where user navigates to Observatory without a slash trailing the authentication code.
Previously, navigating to an observatory URI similar to http://127.0.0.1:8181/KUhS6KoCm24=
would result in a missing auth code error. This change explicitly checks
for this case and issues a redirect response to
http://127.0.0.1:8181/KUhS6KoCm24=/ so index.html can be sent properly
in the follow up request.

Fixes #36763

Change-Id: I8a73f2ef08f6bf1ca5aed4ddaaf97ae3489f7e23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100631
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-04-29 17:03:49 +00:00
Stevie Strickland 4028fec3b5 Reland "[vm] Finish adding support for ECMAScript 2018 features."
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.

This adds support for the following features:

* Interpreting patterns as Unicode patterns instead of
  BMP patterns
* the dotAll flag (`/s`) for changing the behavior
  of '.' to also match line terminators
* Escapes for character classes described by Unicode
  property groups (e.g., \p{Greek} to match all Greek
  characters, or \P{Greek} for all non-Greek characters).

The following TC39 proposals describe some of the added features:

* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes

These additional changes are included:

* Extends named capture group names to include the full
  range of identifier characters supported by ECMAScript,
  not just ASCII.
* Changing the RegExp interface to return RegExpMatch
  objects, not Match objects, so that downcasting is
  not necessary to use named capture groups from Dart

**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.

Change-Id: Ie62e6082a0e2fedc1680ef2576ce0c6db80fc19a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100641
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stevie Strickland <sstrickl@google.com>
2019-04-29 09:11:48 +00:00
Aart Bik e00b2b577e [dart/fuzzer] restrict length parameter in List fill
Rationale:
Easily causes out of memory. For AOT, can even break
asserts on compilation consants.

https://github.com/dart-lang/sdk/issues/36658

Change-Id: I662c1e50338db636e2b558ac3a2761659d8b2ad4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100635
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-27 00:00:14 +00:00
Alexander Markov f3b6028edc [vm/interpreter] Bump usage counters and trigger compilation of invoke-field
Without usage counters and compilation invoke-field dispatchers are
interpreted even if they are hot. As a result, DRT_GetFieldForDispatch
is heavily used and appears in profile.

Issues: FL-203, https://github.com/dart-lang/sdk/issues/36735
Change-Id: I3e04c16a7073de80c41257e0182b3f9592988e91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100633
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-26 21:44:55 +00:00
Aart Bik ec15148db2 [dart/fuzzer] no target on unsupported build targets
Rationale:
This if "hides" the dart_libfuzzer target for
build targets that do not support the fuzzer tool
(e.g. no asan, ia32, etc.). This makes "build all"
possible again, and yields "unknown target 'dart_libfuzzer'"
for unsupported case. Also updates README accordingly
and fixes some formatting.

https://github.com/dart-lang/sdk/issues/36774

Change-Id: I61d85ae00d13a0eda3818d40b992cd81f5ee0357
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100630
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-04-26 20:51:15 +00:00