Commit Graph

12113 Commits

Author SHA1 Message Date
Carlo Bernaschina ba5fe22984 Restore kPausePostRequest event handling
Fixes https://github.com/flutter/flutter/issues/10934#issuecomment-312134244

Related https://github.com/dart-lang/sdk/commit/94a9061925ed222cf3f954aabc3dd90f9e9f4ca0

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2979193002 .
2017-07-17 18:44:14 -07:00
Zachary Anderson 80f096fb6c Add missing config to libdart_jit
It was dropped by mistake by an earlier commit and broke the Flutter
build.

R=aam@google.com

Review-Url: https://codereview.chromium.org/2984503002 .
2017-07-17 15:35:58 -07:00
Alexander Markov 15e1136e3e Add comments for constants which replaced large integer literals
R=regis@google.com, zra@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2980243002 .
2017-07-17 13:28:39 -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
Vyacheslav Egorov c6815e8522 Reapply 0489249d29 with a fix for front_end tests.
Proper sequencing of _asyncStackTraceHelper in Kernel

This helper function was being called before its argument was
initialized so it was passing null.  Instead, it should be called
after its argument is initialized.

Because the initialization happens in Kernel code, it is simplest to
insert the call explicitly in Kernel code as well as part of the async
transformation.  This has the consequence that we now call the helper
function even when the flag causal_async_stacks is false.

Fixes issue #29771.
Fixes issue #30178
Fixes issue #30058

BUG=
R=aam@google.com, asiva@google.com

Review-Url: https://codereview.chromium.org/2936793003 .
Review-Url: https://codereview.chromium.org/2982943002 .
2017-07-17 20:56:28 +02:00
Alexander Markov a2388dd370 Avoid Bigint literals in Dart core library
This CL is a step towards preparation of Dart core library for 64-bit
integers in Dart. In the new --limit-ints-to-64-bits mode integer
literals which are out of range will be rejected, so such literals
should not be used in the core library.

R=zra@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2983633002 .
2017-07-17 08:04:59 -07:00
Zachary Anderson fa859c507f Add libdart PRODUCT targets for Fuchsia's dart_runner
R=rmacnak@google.com

dart:hello_dart.dartx memory footprint: 6292k -> 5572k
Review-Url: https://codereview.chromium.org/2975343002 .
2017-07-15 21:43:50 -07:00
Konstantin Shcheglov a9fbe224bc Add documentationComment for Class to Kernel. Parse it. Resynthesize in Analyzer.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2977133002 .
2017-07-15 09:53:48 -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
Peter von der Ahé 18a41eba08 Report messages instead of just printing.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2977013002 .
2017-07-14 14:07:44 +02:00
Carlo Bernaschina df8bf384eb Introduce external services registration
A new RPC is introduced `_registerService` which allow clients to
register new services that are accessible from all the other clients.

Each registered endpoint is identified by 3 strings:

 - `service`
   a non empty string which identifies the provided service
   (e.g. `HotReload`, `OpenFile`)
 - `alias`
   an alias for that particular endpoint used by clients to identify it
   (e.g. `Flutter`, `IntelliJ`)
 - `method` __generated__
   the RPC method that should be invoked from a client to request it

A new _stream_ `_Service` is introduce, and two related events:

 - `ServiceRegistered`
   which is triggered when a new client is registered.
   All the related information (`service`, `alias`, `method`) are sent.

 - `ServiceUnregistered`
   which is triggered when a client, which previously registered a
   service, disconnects.
   Just `service` and `method` are sent.

Related https://github.com/dart-lang/sdk/issues/30023

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

Review-Url: https://codereview.chromium.org/2980733003 .
2017-07-13 18:18:51 -07:00
Zachary Anderson f67adeaaf7 Without a service isolate callback, don't spawn a thread
The thread just exist immediately, so we should avoid the memory, etc.
churn of spawning the thread.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2982783002 .
2017-07-13 15:26:44 -07:00
Ryan Macnak be95b916dd GN: Change the default meaning of dart_target_arch from current_cpu to target_cpu.
Update args.gn for the simulator builds to compensate.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2980023002 .
2017-07-13 14:59:35 -07:00
Alexander Markov 32e226be02 Cleanup unused Dart API Dart_IdentityHash
There are a few problems with this function:
* It returns uint64_t instead of int64_t, which is different from
core Dart library function identityHashCode()
* Dart_IdentityHash truncates negative Mint and Bigint values to 0,
while negative Smi values are converted to uint64_t.

The Dart_IdentityHash function is not used, so we decided to remove it
instead of fixing these problems.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2980043002 .
2017-07-13 13:56:05 -07:00
Diogenes Nunez 699f84f941 Moves the top_ and end_ words of the Scavenger into mutator thread.
This is the first step to adding Thread Local Allocation Buffers to
the VM.

In this step, the mutator alone allocates to the new space, but keeps
track of the start and end of the space. This is akin to a single large
TLAB.

As a result, the generated code and the dbc simulator changed how they
allocate objects into the new space as well.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2980033002 .
2017-07-13 13:46:17 -07:00
Zach Anderson 0148dfce03 [Windows] Turn off TLS destructors in the Platform exception handler
R=alexmarkov@google.com

Review-Url: https://codereview.chromium.org/2981773002 .
2017-07-13 13:04:43 -07:00
Alexander Markov 1c343d35ac Fix bug in Dart API Dart_IntegerToUint64: crash on negative Mints
R=zra@google.com

Review-Url: https://codereview.chromium.org/2982753002 .
2017-07-13 12:19:25 -07:00
Alexander Markov 031533f04d Remove unused native methods ByteData_ToEndian<T>
It seems like these native methods are defined in C++ code but not used
from Dart code. This CL cleans them up.

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

Digging into history reveals that the following CL replaced
these native methods with Dart implementation:
https://codereview.chromium.org//860963002
Review-Url: https://codereview.chromium.org/2983433002 .
2017-07-13 10:08:45 -07:00
Ryan Macnak 324078ab30 [vm] Fail more helpfully when invoking a null native function.
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2944483003 .
2017-07-13 09:55:35 -07:00
Alexander Markov 2e5002d67a Add top-level exception handler on Windows to dump stack traces
R=zra@google.com

Review-Url: https://codereview.chromium.org/2976063002 .
2017-07-13 08:17:30 -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 c0d4e02693 Revert "Moves the top_ and end_ words of the Scavenger into mutator thread."
This reverts commit 710544a907.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2974403002 .
2017-07-12 14:30:06 -07:00
Diogenes Nunez 710544a907 Moves the top_ and end_ words of the Scavenger into mutator thread.
This is the first step to adding Thread Local Allocation Buffers to
the VM.

In this step, the mutator alone allocates to the new space, but keeps
track of the start and end of the space. This is akin to a single large
TLAB.
BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2951333002 .
2017-07-12 14:09:07 -07:00
Ryan Macnak f20b32b793 [vm] Enable mirrors in product mode. Allows building a product mode SDK.
Fixes https://github.com/dart-lang/sdk/issues/29972

R=zra@google.com

Review-Url: https://codereview.chromium.org/2972883002 .
2017-07-12 12:55:58 -07:00
Ryan Macnak ccadb4687c [observatory] Sort native allocation profiles by size.
R=bkonyi@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2977803002 .
2017-07-12 12:42:44 -07:00
Ryan Macnak ccb116b5c6 [profiler] Avoid allocating ~2 MB of handles when processing the sample buffer.
These handles dominated the results of the native allocation profile in hello_world.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2982603002 .
2017-07-12 10:52:15 -07:00
Alexander Markov f685e4a8dd Replace manual untagging of smi with proper Smi methods
R=vegorov@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2975073002 .
2017-07-12 10:37:55 -07:00
Ryan Macnak 5a02f3819b [vm] Support flow events in Dart_TimelineEvent.
Issue https://github.com/dart-lang/sdk/issues/30142

R=zra@google.com

Review-Url: https://codereview.chromium.org/2977663003 .
2017-07-12 10:18:10 -07:00
Ryan Macnak ba2deb7772 [vm] Get a reference backtrace if we encounter disabled code when writing an AOT snapshot.
R=regis@google.com

Review-Url: https://codereview.chromium.org/2981573002 .
2017-07-12 09:31:28 -07:00
Zachary Anderson b3200f4664 [Fuchsia] Routes timeline events to Fuchsia's tracing app
This CL routes timeline events to Fuchsia's tracing app when the
following arguments are passed to the VM:

--systrace_timeline
--timeline_recorder=systrace
--timeline_streams=[some streams here]

I'll add these arguments to the Flutter engine for Fuchsia after this
CL lands.

TO-367

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2977513002 .
2017-07-11 14:12:27 -07:00
Chris Bracken b9596a86e4 Fix typo: intput-file -> input-file
BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2975943002 .
2017-07-11 13:55:03 -07:00
Alexander Markov 97f19892d4 Revise assertions and fix bug in the implementation of shifts
Previously failing assertions in the implementations of
ShiftMintOpInstr::EmitNativeCode for various architectures are revised:
* Incorrect assertion !has_shift_count_check() is removed
* Assertion for shift >= 0 is restored
* Assertion for shift < 64 on X64 is moved to kSHL branch

Also, misleading ShiftMintopInstr::has_shift_count_check() method
is replaced with method IsShiftCountInRange() with opposite meaning.

On X64, bug in the implementation of right shifts with constant shift
amount >= 64 is fixed. Corresponding test case is added.

R=regis@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2974953002 .
2017-07-11 13:15:00 -07:00
Ryan Macnak b3b996b12c [vm] Don't track allocation stats during marking in product mode.
R=asiva@google.com, danunez@google.com

Review-Url: https://codereview.chromium.org/2975723003 .
2017-07-11 09:37:00 -07:00
Alexander Markov 8fb4aaa132 Temporarily back out newly introduced assertions to fix buildbots
These assertions where recently added as the part of implementation
of truncating integer arithmetic to 64 bits. They check invariants
for the existing implementation of shifts. So far, there are
several failures on IA32 and ARM.

Commenting out these assertions while investigating to make buildbots
green.

TBR

Review-Url: https://codereview.chromium.org/2975913002 .
2017-07-11 09:36:50 -07:00
Aske Simon Christensen ab7d9a5720 Omit JIT compiler from precompiled runtime on ARM, ARM64 and IA32.
Saves about a megabyte on the size of the precompiled runtime VM.

Next step will be to eliminate the assemblers and code stubs as well. This requires some more disentangling.

Until then, the X64 build still includes the compiler, since its assembler has a dependency on locations.cc, which is part of the compiler.

BUG= https://github.com/dart-lang/sdk/issues/30045
R=rmacnak@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2960413002 .
2017-07-11 12:01:49 +02:00
Peter von der Ahé ea63348aed Correct spelling of message.
R=jensj@google.com

Review-Url: https://codereview.chromium.org/2980573002 .
2017-07-11 11:59:32 +02:00
Jens Johansen b0de84343a [kernel] Only add metadata if there's at least one annotation.
Currently we run execute "library.AddFieldMetadata",
"library.AddFunctionMetadata" etc for all fields and methods,
even if they do not contain any annotations
(which is what will eventually be extracted from it if ever used).

This CL changes that to only execute the "AddXMetadata" if there
are any annotations.
This saves the VM from creating strings and fields that aren't really
used anyway, while - as before - returning an empty array when
answering a request for metadata for something without any.

BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2979653002 .
2017-07-11 10:40:49 +02:00
Jens Johansen fa1cf9e404 [kernel] Allow reflection on some fields; add metadata on fields too.
BUG=
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2973943002 .
2017-07-11 10:11:09 +02:00
Alexander Markov 47ad7a82b3 Silence truncating_ints_test in dart2js & dartium modes
Dart2js does not support --limit-ints-to-64-bits option which is
required by this test.
Dartium does not support VMOptions specification in the test.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974843002 .
2017-07-10 17:33:01 -07:00
Alexander Markov bd5427fd97 Temporarily comment out assertions to fix IA32 buildbots
TBR

Review-Url: https://codereview.chromium.org/2975793003 .
2017-07-10 17:23:48 -07:00
Siva Chandra f0ef900fd3 Fix setting breakpoints in parts of a library.
This fixes the regression caused by
1eaa3dd84b and reported in #29988.

When picking a class to set a breakpoint, instead of rejecting classes
not defined in the script, we now reject classes which do not belong to
the library to which the script belongs.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2965673004 .
2017-07-10 17:20:26 -07:00
Alexander Markov 7360dd42ee Option --limit-ints-to-64-bits should be included into product
The option should be present in PRODUCT mode because it is used
in the test runtime/tests/vm/dart/truncating_ints_test.dart
(in the VMOptions specification).

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2980553002 .
2017-07-10 15:44:25 -07:00
Alexander Markov 7a20b6b8d8 Option to truncate integers to 64 bits, part 1 (core VM changes)
This changeset revises --limit-ints-to-64-bits option to
change range of integers from unlimited to int64.
On overflow, integer arithmetic operations silently wrap around and
discard extra bits. No Bigints are allocated in case of overflow.

This changeset is the 1st part in the series of changes, it revises the implementation of integer arithmetic operations. More changes will follow.

R=regis@google.com, zra@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2974633003 .
2017-07-10 15:16:40 -07:00
Ben Konyi cc68a66f28 Updated native memory allocation profiling to use its own sample buffer instead of sharing a sample buffer with the CPU profiler, which did lead to samples being quickly overwritten even if the memory hadn't yet been freed. This will ensure allocations are accurately displayed in Observatory as the CPU profiler will no longer overwrite samples associated with native memory allocations.
BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2966593002 .
2017-07-10 10:31:45 -07:00
Florian Loitsch 5d4a786f44 Revert "Don't use LinkedList in the core libraries anymore."
This reverts commit fe17b5b2bc.

Review-Url: https://codereview.chromium.org/2974073002 .
2017-07-10 14:58:04 +02:00
Florian Loitsch fe17b5b2bc Don't use LinkedList in the core libraries anymore.
R=lrn@google.com

Review-Url: https://codereview.chromium.org/2975443002 .
2017-07-10 14:09:24 +02:00
Sigmund Cherem b71bd543a9 Reapply "Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service.""
Original CL had a bug that wasn't visible unless you delete your
out/ReleaseX64/patched_sdk folder.

Patchset #1 is the original CL, patchset #2 shows the fix.

This reverts commit 4aadfe09df.

BUG=

Review-Url: https://codereview.chromium.org/2976543002 .
2017-07-07 15:32:24 -07:00
Sigmund Cherem 4aadfe09df Revert "Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service."
Reason: broke VM bots, still investigating.

This reverts commit 610d081947.

TBR= paulberry@google.com

Review-Url: https://codereview.chromium.org/2979463002 .
2017-07-07 15:21:37 -07:00
Sigmund Cherem 610d081947 Tweak public APIs and use them in patch_sdk, dart2js, and kernel-service.
This CL tweaks the public APIs in package:front_end, and
starts using those APIs outside the package. For example, this
removes 9 uses of DillTarget, so it is not longer mentioned
outside pkg/front_end and the analyzer_target.

Actual changes:
 - in package:front_end

   * added kernel_generator_impl: new file contains code that
     used to be in kernel_generator. Code has some modifications:
     it uses a single canonical-root when loading summaries, and
     it supports generating both outlines and kernel in one go.

   * removed code that didn't belong here:
     a. most of calculating deps for .GN moved to patch_sdk
     b. vm-specific outcomes moved to kernel-service

   * updated how `native` is implemented, so we can more easily
     support dart2js and ddc

   * updated how we check where `int`, `bool`, etc can be implemented.

   * added support "hermetic mode" in modular builds
     ('chaseDependencies = false' option)

   * moved `trim` step out of fasta, and for now call it only within
     the public API. This is not yet exposed, and I stopped covering it in
     most tests (now only covered in shaker tests). The plan is to add
     tests for the public API covering this in the future.

   * removed `uriToSource` when serializing outlines

   * added unit tests for public APIs

 - patch_sdk
   * use the public API to craete platform.dill, outline.dill (now
     500K insted of 3Mb because it excludes sources), and vmservice_io.dill
   * moved here logic internal to .GN

 - kernel service
   * use the public API
   * moved here logic that depends on VM internals (e.g. status enum,
     compilation results)

 - package:compiler
   * use the public API in tools and unit tests
   * simplified patched-sdk generation: no more extending fasta's internals

 - package:kernel
   * fix bug in deserialization: initializers and other lists were
     overwritten accidentally with external definitions.
   * updated unit tests, moved shared logic to frontend/src/fasta/testing

R=johnniwinther@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2953703002 .
2017-07-07 15:14:22 -07:00