Commit Graph

9862 Commits

Author SHA1 Message Date
Ryan Macnak 1e8fdaee68 Support for taking full snapshots from 'dart', not just 'dart_bootstrap'.
- Don't create rival copies of the predefined symbols in isolates in dart_bootstrap.
 - Don't do work to save these rival copies during symbol table compaction.
 - Create unified symbol table just before writing the vm isolate.
 - Create unified list of scripts to include in the vm isolate.
 - Ignore object ids of the old vm isolate when writing a new one.
 - Ensure token stream private keys are hashed.
 - Use the type of isolate we are writing instead of an object's current isolate to decide if vm isolate objects are written symbolically.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1944213002 .
2016-05-10 10:13:33 -07:00
Ryan Macnak 62350b85c3 Fix product build.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1956403006 .
2016-05-10 10:00:56 -07:00
John McCutchan 20bff77701 Implement OS::GetCurrentThreadCPUMicros for iOS
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1962613003 .
2016-05-10 09:49:40 -07:00
Ryan Macnak 26fe7e2918 Improve the weak table hash.
R=asiva@google.com

Review URL: https://codereview.chromium.org/1965553003 .
2016-05-10 09:43:12 -07:00
Florian Schneider 245197fb9f VM precompiler: Allow optimizing static initializers.
Static initializers were compiled without any optimizations. They are only
executed once, but the optimizer can potentially extract static type information
and may also produce a bit smaller code. (7K size savings when compiling dart2js -- i.e. < 0.1%)

This CL enables optimizations for them. The space savings
 are not great, but I still think it's nicer to only have
 optimized code when precompiling, instead of a mixture of
 unoptimized and optimized.

Also, fix printing disassembly for initializers, and insert additional assertions.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1958913003 .
2016-05-10 09:38:03 +02:00
Regis Crelier 508b876ec8 Report wrong async function result type as type error in checked mode (Fixes #26133).
Add regression test.

R=hausner@google.com

Review URL: https://codereview.chromium.org/1847953002 .
2016-05-09 15:06:45 -07:00
John McCutchan f07fd20304 Add GC stats to GC timeline events
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1961033003 .
2016-05-09 14:28:56 -07:00
Zachary Anderson 87c4171b64 SourceReport should test result of RestoreIcDataMap for NULL entries
Entries in the result can't be the null object, but they can be NULL.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1965523002 .
2016-05-09 14:21:10 -07:00
John McCutchan 5331af35bc Skip adding line based range data for ranges that don't map to a line.
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org/1960213002 .
2016-05-09 13:40:09 -07:00
Zachary Anderson a6c686234c DBC: Adds DecodeLoadObjectFromPoolOrThread, enables tests
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1961953003 .
2016-05-09 12:52:36 -07:00
Zachary Anderson 57fea4f10b Adds a gn argument for boringssl path
Fixes Flutter build. There should be no need for Flutter to set the
flag. Mojo will need to set the flag.

R=jsimmons@google.com

Review URL: https://codereview.chromium.org/1955163002 .
2016-05-06 15:05:10 -07:00
Jason Simmons 7eb43c2134 Return a null Platform.executable and resolvedExecutable on Android
See https://github.com/flutter/flutter/issues/3648

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1953333002 .
2016-05-06 14:29:53 -07:00
Ryan Macnak 7546ef1709 Simplify command line options for creating snapshots.
Also makes codeless app snapshots work in debug and release modes.

dart --snapshot=file.snap [--snapshot-kind=script] script.dart
dart file.snap

dart_bootstrap --snapshot=dir --snapshot-kind=app-after-run script.dart
dart --run-app-snapshot=dir script.dart

dart_bootstrap --snapshot=dir --snapshot-kind=app-jit-after-run script.dart
dart --run-app-snapshot=dir script.dart

dart_bootstrap --snapshot=dir --snapshot-kind=app-aot script.dart
dart_precompiled_runtime --run-app-snapshot=dir script.dart

R=asiva@google.com

Review URL: https://codereview.chromium.org/1947783003 .
2016-05-06 12:40:04 -07:00
Chinmay Garde e4db01fdd4 Fix syntax error in os_macos.cc on iOS.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1958513002 .
2016-05-05 17:21:56 -07:00
Chinmay Garde 269bcf9bf8 GN file updates to support using dbc.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1953173002 .
2016-05-05 17:08:03 -07:00
John McCutchan 234250189b Include the field name and function name in Dart_GetField and Dart_Invoke timeline events
Fixes #26395

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1951003002 .
2016-05-05 16:50:11 -07:00
John McCutchan 204de1dc68 Fix MacOS build breakage
BUG=

Review URL: https://codereview.chromium.org/1952253003 .
2016-05-05 16:43:26 -07:00
John McCutchan f6b570aa2a Include thread CPU time in Timeline.
- [x] Refactor old OSThread interface for querying thread CPU time into OS::GetCurrentThreadCPUMicros.
- [x] Add data to TimelineEvent to track thread CPU time.
- [x] Include "tts" and "tdur" properties when converting the timeline to JSON

Fixes #26396

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1960483002 .
2016-05-05 16:34:09 -07:00
Zachary Anderson d55b87d622 Fixes GN boringssl deps path
The Mojo tree already DEPSes in boringssl into its //third_party. To
avoid DEPSing in two boringssl's, we need to look for the one there.
(The GN 'check' routine requires the sources to be found even if
noone depends on them.) Flutter will need to move its boringssl
DEPS from //dart/third_party/boringssl to //third_party/boringssl
to match.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1952383002 .
2016-05-05 16:07:11 -07:00
Zachary Anderson 78de302495 Fix DBC product build
fixes #26415

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1945183006 .
2016-05-05 15:57:16 -07:00
Ryan Macnak e0184aa823 Remove unnecessary full GCs before snapshot creation.
R=asiva@google.com

Review URL: https://codereview.chromium.org/1953673004 .
2016-05-05 15:55:01 -07:00
John McCutchan 4dee1c71c2 Fix Windows build
BUG=

Review URL: https://codereview.chromium.org/1960443003 .
2016-05-05 15:18:21 -07:00
Siva Annamalai 48700fca66 Change Type::signature to not allocate a handle and instead use the cid value.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1956453002 .
2016-05-05 15:12:37 -07:00
John McCutchan 5d02929fa0 Fix the profiler for threads spawned from the Linux eventhandler
Fixes #26416

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1953143002 .
2016-05-05 14:45:37 -07:00
Zachary Anderson 924214d695 Enable code object tests for DBC
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1955473002 .
2016-05-05 13:49:33 -07:00
Siva Annamalai 29d79258f1 Fix precompile build issue with IsString change.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1953803003 .
2016-05-05 12:53:02 -07:00
Ryan Macnak 354a26ce52 Add Dart_IsPrecompiledRuntime to help simplify logic in embedders that conditionally use precompilation or the JIT.
R=chinmaygarde@google.com

Review URL: https://codereview.chromium.org/1948183002 .
2016-05-05 11:32:43 -07:00
Ivan Posva b2ac279269 - Use a map to lookup libraries by URL.
- Ensure the uniqueness of private keys without having to
  search the existing key space.
- Pass a thread parameter where useful to library methods.

BUG=

Review URL: https://codereview.chromium.org/1947393003 .
2016-05-05 10:42:28 -07:00
Ryan Macnak 257b3a82b8 JIT precompilated snapshots.
(Precompiled snapshots with unoptimized code.)

+ ./out/ReleaseX64/dart --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js

real	0m3.299s
user	0m3.197s
sys	0m0.831s

+ ./out/ProductX64/dart_bootstrap --full-snapshot-after-run=/usr/local/google/home/rmacnak/dart3/sdk/app --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js
+ ./out/ProductX64/dart --run-full-snapshot=/usr/local/google/home/rmacnak/dart3/sdk/app --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
vm-service: Isolate creation error: (null)
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js

real	0m1.979s
user	0m1.806s
sys	0m0.581s

+ ./out/ReleaseX64/dart_bootstrap --use_blobs --gen-precompiled-jit-snapshot=/usr/local/google/home/rmacnak/dart3/sdk --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js
VMIsolate(CodeSize): 2699304
Isolate(CodeSize): 5930097
Instructions(CodeSize): 9440176
Total(CodeSize): 18069577
+ ./out/ReleaseX64/dart --use_blobs --run-precompiled-jit-snapshot=/usr/local/google/home/rmacnak/dart3/sdk --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js

real	0m0.994s
user	0m1.259s
sys	0m0.229s

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

Review URL: https://codereview.chromium.org/1938653002 .
2016-05-04 18:47:36 -07:00
Ivan Posva 964f95a020 - Fix loading of dart:html.
- Remove debug print in VM service.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1952903002 .
2016-05-04 17:43:58 -07:00
Siva Annamalai 95904322e7 Minor cleanup based on profiler output of CompileParseFunction.
- Add a zone parameter to TokenStream::Iterator
- Add IsXXXX() functions in raw_object.h using GetClassId()
- Modify
    - Function::owner
    - Function::origin
    - Type::IsMalformed
    - Type::IsMalbounded
    - Type::error
  to not create a Handle in the common path

R=regis@google.com

Review URL: https://codereview.chromium.org/1952023002 .
2016-05-04 15:30:56 -07:00
Regis Crelier 6fcb857f00 Remove temporary code used to debug issue #26101.
R=hausner@google.com

Review URL: https://codereview.chromium.org/1948173002 .
2016-05-04 12:55:46 -07:00
Regis Crelier 4eb2144956 Fix cloning of generic function types when applying mixin members to mixin
application class (fixes #26387).

R=hausner@google.com

Review URL: https://codereview.chromium.org/1950133002 .
2016-05-04 11:34:00 -07:00
Todd Turnidge 956ac4c183 Fix getSourceReport's forceCompile option for unused classes.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1916243002 .
2016-05-04 11:02:06 -07:00
Florian Schneider f54c8d89fa VM: Remove PushTempInstr, simplify SSA renaming.
BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1950553002 .
2016-05-04 10:54:03 +02:00
Ivan Posva 2268bb8530 - Fix build.
BUG=

Review URL: https://codereview.chromium.org/1946953002 .
2016-05-03 20:45:05 -07:00
Ivan Posva 3884fd4e4b - Allow for loading dart:html and friends into the standalone
dart_bootstrap binary to evaluate startup and compilation
  performance.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1916793003 .
2016-05-03 20:33:14 -07:00
Regis Crelier 5294523c20 More efficient identification of dynamic and void types.
R=asiva@google.com

Review URL: https://codereview.chromium.org/1947753002 .
2016-05-03 16:08:37 -07:00
Zachary Anderson fc65d07fdf Adds DBC StoreIntoObject test
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1948803002 .
2016-05-03 14:58:40 -07:00
Zachary Anderson 13c740f4bd Adds more DBC assembler tests
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1950613002 .
2016-05-03 13:55:30 -07:00
Regis Crelier 1b36e9dbe6 Remove small window when function parameter types and names were reset to null
by background compiler, possibly crashing the main thread performing a function
type test (fixes #26101).

R=hausner@google.com

Review URL: https://codereview.chromium.org/1947683002 .
2016-05-03 13:37:35 -07:00
Ryan Macnak f7a3e215a5 Undo "Don't include an object header for instructions in the text section."
This undoes most of b2f3e8efe1.

This optimization prevents precompiled code from being disabled and re-enabled, because disabling causes the code to lose its only reference to its own instructions. This was okay for precompilated code that ran without a JIT because it is never disabled, but precompiled code that runs in a JIT will become disabled when corresponding optimized code is compiled and re-abled after a deopt.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1925153003 .
2016-05-03 11:22:28 -07:00
Zachary Anderson a1d241922f Adds more DBC assembler tests.
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1944503002 .
2016-05-03 09:01:11 -07:00
Siva Annamalai 65c4aaee17 - Add a new constructor to the hash table classes that allow handles to be passed in instead of creating new ones for every lookup/insertion
- Use reusable handles in Symbols::New and Symbols::Lookup with the new constructor defined above

R=hausner@google.com

Review URL: https://codereview.chromium.org/1934263003 .
2016-05-02 17:07:31 -07:00
Ryan Macnak 58a2c13d0a Give OSR compilation its own event name. Rename other optimizated compilation events so they sort together with unoptimized compilation.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1938553002 .
2016-05-02 10:19:32 -07:00
Vyacheslav Egorov b089d4f004 Work around a kernel bug on Android.
Kernel does not clear If-Then execution state bits when entering ARM signal handler which violates requirements imposed by ARM architecture reference. Some CPUs look at these bits even while in ARM mode which causes them
to skip some instructions in the prologue of the signal handler.

To work around the issue we insert enough NOPs in the prologue to ensure that no actual instructions are skipped and then branch to the actual signal handler.

For the kernel patch that fixes the issue see: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6ecf830e5029598732e04067e325d946097519cb

This causes sporadic crashes with SIGILL on some testing devices (e.g. Nexus 7).

R=fschneider@google.com
BUG=

Review URL: https://codereview.chromium.org/1940883002 .
2016-05-02 19:12:48 +02:00
Zachary Anderson 5d7ecb8500 Adds LoadClassIdInstr to DBC
R=iposva@google.com, vegorov@google.com

Review URL: https://codereview.chromium.org/1922173003 .
2016-05-02 09:02:22 -07:00
Martin Kustermann 620b896e2f Initial support to test.dart for running precompiler tests on android devices
Steps to make this work:

a) Make sure you have an android sdk checkout:

  => See https://github.com/dart-lang/sdk/wiki/Building-Dart-SDK-for-Android

b) Building using android-toolchain crosscompiler:

  $ ./tools/build.py -mrelease -aarm --os=android dart_precompiled_runtime

  => Notice --os=android

c) Testing using attached android phones:

  $ export PATH=$PATH:$PWD/third_party/android_tools/sdk/platform-tools
  $ ./tools/test.py -mrelease -aarm --system=android -cprecompiler -rdart_precompiled --use-blobs

  => Notice --system=android

Failing tests on android can be marked in status files via:

[ $compiler == precompiler && $runtime == dart_precompiled && $system == android ]

R=whesse@google.com

Review URL: https://codereview.chromium.org/1922163002 .
2016-05-02 12:41:22 +02:00
Siva Annamalai d6d8fb827f Fix product build.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1941503002 .
2016-04-29 15:57:23 -07:00
Siva Annamalai 964a659470 - reset 'dirty' flag to false after the libraries mirrors is computed, this ensures that we compute the libraries only when new library modules are loaded and the 'dirty' flag is set to true.
- Use passed in 'zone' argument in the native string functions

- Use passed in 'thread' argument in the library mirror creation functions

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1935703002 .
2016-04-29 15:15:19 -07:00