Commit Graph

2016 Commits

Author SHA1 Message Date
Siva Annamalai cab435bd03 Fix gen snapshot code to use Dart_LoadLibrary instead of Dart_LoadScript so that the root library value is not set when creating the bootstrap snapshot. The root library gets set when the application is loaded in later.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1653143002 .
2016-02-01 12:57:04 -08:00
Todd Turnidge 250773cb65 Improve the error message when an import fails.
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1641383003 .
2016-01-29 16:30:08 -08:00
Adam Barth 94570789c9 Fix gn build
This function name had a typo.

R=zra@google.com, zra

Review URL: https://codereview.chromium.org/1654443002 .
2016-01-29 12:27:00 -08:00
Todd Turnidge 0f1d73fd07 Add --warn-on-pause-with-no-debugger flag. Add this to --observe behavior.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1649843002 .
2016-01-29 12:19:33 -08:00
Zachary Anderson 98771a083f Adds SecurityContext.usePrivateKeyBytes
This is the first step toward removing blocking IO calls from
the implementation of the SecurityContext API.

Using a buffer rather than a file name API will probably be needed
for implementing SecurityContext and SecureSocket with platform
specific built-in APIs on iOS/Mac/Windows rather than BoringSSL.

related #8227

R=whesse@google.com

Review URL: https://codereview.chromium.org/1616073004 .
2016-01-29 08:52:18 -08:00
John McCutchan 87d8d3a719 Make it possible to share the embedder's dart sources for the service isolate.
- Cleanups to the embedder's Dart sources for the service isolate. This lets us stop keeping a local copy in the mojo and flutter trees.
- Let the VM know Observatory's server address.

R=zra@google.com

Review URL: https://codereview.chromium.org/1640773005 .
2016-01-29 07:43:21 -08:00
Florian Schneider f47839ba09 Rename DART_PRECOMPILED -> DART_PRECOMPILED_RUNTIME
To avoid future confusion with precompiler compiler-related macros/build targets

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1581393008 .
2016-01-19 13:59:49 -08:00
Vyacheslav Egorov 89121bf530 SignalInfo must store fd_ as an intptr_t not an int.
On Windows we use this field to store a pointer to FileHandle object.

Type of SignalInfo::signal_ is changed to intptr_t too for consistency.

BUG=http://dartbug.com/25345
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1601183003 .
2016-01-19 21:51:18 +01:00
Ivan Posva 4f54e6aee5 - Add support for passing data: based URIs as packageConfig to
Isolate.spawnUri.
- Loosen the expected mimeType and encoding for data: URI based
  file loading.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1585103006 .
2016-01-15 17:01:58 -08:00
Ivan Posva 28412d153e - Fix Isolate.spawn when running from snapshot.
- Avoid access to Isolate.resolvePackageUri when not needed. Fixes Dartium based test.

TBR

Review URL: https://codereview.chromium.org/1591573004 .
2016-01-14 23:24:07 -08:00
Zachary Anderson 6c8a3e0053 Restore IsolateData destructor
Shutdown is turned on, and the race on IsolatData
deletion has been fixed, so this should be safe
to re-enable.

R=iposva@google.com

Review URL: https://codereview.chromium.org/1581443002 .
2016-01-13 10:12:49 -08:00
Ivan Posva 6d066c7e53 Add package config support to dart:isolate
- Add "static Future<Uri> get packageRoot;",
  "static Future<Uri> get packageConfig;" and
  "static Future<Uri> resolvePackageUri(Uri packageUri)" to Isolate class.
- Added "Uri packageRoot, Uri packageConfig, bool automaticPackageResolution: false" parameters to spawnUri.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1553233002 .
2016-01-12 18:19:04 -08:00
Vyacheslav Egorov 8ea0f17289 Add more dart:io related precompilation roots.
File, Directory, Link and FileSystemException are allocated by the runtime code.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1579643005 .
2016-01-12 14:14:50 +01:00
Chinmay Garde f85c015ccd Fix iOS implementation of |GetCurrentMonotonicMicros|.
Fixes regression introduced in dd4ef29098

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1571343003 .
2016-01-11 13:21:46 -08:00
Ryan Macnak 9328d724f8 Precompilation:
- When using --compile_all + --noopt, run Dart_CompileAll before Dart_Precompile to avoid skipping functions dropped by Precompile / asserting out on functions retained but uncompiled by Precompile.
 - Fail gracefully when attempting to use more than one of --noopt, --gen_precompiled_snapshot, or --run_precompiled_snapshot.
 - Fix tree shaking roots to include the right VM entry point for creating assertion failures.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1567953002 .
2016-01-08 10:19:14 -08:00
John McCutchan 25c9077fa8 Fix Mac gen_snapshot by calling TimerUtils::InitOnce
BUG=

Review URL: https://codereview.chromium.org/1563553002 .
2016-01-05 11:32:57 -08:00
John McCutchan dd4ef29098 Refactor monotonic clock interface and use raw tick values in stopwatch
- Split interface to provide direct access to raw clock value and clock frequency.
- Update Stopwatch to use raw clock value and clock frequency instead of microseconds.
- Fix possible initialization race on OSX

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1563473002 .
2016-01-05 11:22:20 -08:00
Zachary Anderson 810a9fca13 Turn on shutdown
R=asiva@google.com

Review URL: https://codereview.chromium.org/1556373002 .
2016-01-05 10:17:28 -08:00
Florian Schneider b042cd9a9a VM: Remove non-existent/unused functions from precompiled entry points.
These are not present / or not used currently.

Also remove associated native functions from vm-service.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1536003002 .
2016-01-04 12:41:16 +01:00
Ryan Macnak 22683803ed Initialize standalone embedder's copy of the monotonic clock on Windows.
BUG=http://dartbug.com/25055
BUG=http://dartbug.com/25278
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1537063002 .
2015-12-18 13:20:57 -08:00
Ryan Macnak 6b964b83ac Add ./tools/test.py -c precompiler -r dart_precompiled.
- Make --gen/run-precompiled-snapshot take a directory to use for the snapshot pieces.
 - Throw on Platform.executeable to prevent tests from becoming fork-bombs.
 - Update status files so 'dart_precompiled' is generally expected to behave the same as 'vm'.

Currently multitests will fail unless run with --jobs=1 because the test harness assigns them the same temporary directory.

Running this also requires a great deal of space. My out directory is 380G.

BUG=http://dartbug.com/24975
R=fschneider@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org/1507943002 .
2015-12-18 12:08:10 -08:00
Ivan Posva e651452759 - Make sure that externals are patched for dart2js.
- Remove unneeded native entry points.

BUG=

Review URL: https://codereview.chromium.org/1535743002 .
2015-12-17 08:26:07 -08:00
Ivan Posva b6781b656a - Implement Platform.packageRoot and Platform.packageConfig based
on the new specification.

BUG=
R=lrn@google.com

Review URL: https://codereview.chromium.org/1529063006 .
2015-12-17 07:48:41 -08:00
John McCutchan e7358d1e51 Fix clang build error
BUG=

Review URL: https://codereview.chromium.org/1531863003 .
2015-12-16 12:42:36 -08:00
John McCutchan cc0f297703 Compress Observatory assets
- Gzip the Observatory assets tar file before encoding into the C++ source file.

Shrinks observatory_assets.cc from ~21MB to ~4MB.

Fixes #25276

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1534523002 .
2015-12-16 12:35:58 -08:00
Florian Schneider 61f190eebe Temporary workaround to make VM bots greener.
The reason are data races at isolate creation/shutdown. Further investigation
to fix the root cause needed.

TBR=johnmccutchan@google.com,

BUG=

Review URL: https://codereview.chromium.org/1531763002 .
2015-12-16 15:30:29 +01:00
Florian Schneider fbdce6a59e VM: Const-correctness fixes.
Three types of fixes:
1. Remove redundant const_cast
2. Remove const_cast by adding const when appropiate.
3. Remove const_cast by removing const (e.g. places where we call free with it)

For now I only fixed places where the fix is local enough - i.e. does not require
changed a large amount of code.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1526123002 .
2015-12-15 19:24:40 +01:00
Ryan Macnak 2bfdde5c36 Also adjust the event handler's timer_fd to the monotonic clock.
Should fix timeouts on pkg-linux-debug-be.

Cf. 9387fead15.

BUG=http://dartbug.com/25055
BUG=http://dartbug.com/25216
TBR=iposva@google.com

Review URL: https://codereview.chromium.org/1513843007 .
2015-12-11 17:37:35 -08:00
Ryan Macnak 1a333dcdd2 Also copy the fallback code.
Review URL: https://codereview.chromium.org/1519073003 .
2015-12-11 13:35:06 -08:00
Ryan Macnak fc551b6f33 Remove stray copy of OS::AlignedAllocate.
Review URL: https://codereview.chromium.org/1518113002 .
2015-12-11 13:13:52 -08:00
Ryan Macnak 9387fead15 Use a monotonic clock in the implementation of Timer.
Ask the embedder for the current time, since it is the embedder who later compares the deadline with current time when deciding when to send a wake up message.

BUG=http://dartbug.com/25055
BUG=http://dartbug.com/25216
R=iposva@google.com, zra@google.com

Review URL: https://codereview.chromium.org/1519563003 .
2015-12-11 12:39:56 -08:00
Zachary Anderson bd20ef507f Load Observatory assets lazily
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org/1500073003 .
2015-12-09 10:09:45 -08:00
Ryan Macnak 3c3d3e23af Update standalone help message for removed legacy debugger protocol options.
Cf. 6249c2bcf3

R=hausner@google.com

Review URL: https://codereview.chromium.org/1505253003 .
2015-12-08 14:48:50 -08:00
Ryan Macnak 4d9a399f53 Standalone: Null out _packagesPort after close.
Fixes crash in precompilation attempting to serialize a receive port.

BUG=http://dartbug.com/25075
R=iposva@google.com

Review URL: https://codereview.chromium.org/1505193003 .
2015-12-08 10:53:21 -08:00
Ivan Posva 6249c2bcf3 - Remove the legacy debug protocol.
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org/1497033003 .
2015-12-03 17:46:02 -08:00
Florian Schneider 59fd6c8397 VM: Small clean up and const-ness fix for Thread/OSThread constants.
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1482243006 .
2015-12-02 12:30:12 +01:00
Ryan Macnak 6fc5018282 Standalone: Use new support in dart:core for decoding data uris.
R=iposva@google.com

Review URL: https://codereview.chromium.org/1489603002 .
2015-12-01 13:46:20 -08:00
Zachary Anderson c888f04ba3 Fixes setjmp clobbering warnings.
Also fixes an unused result warning.

BUG=https://github.com/dart-lang/sdk/issues/25052
R=whesse@google.com

Review URL: https://codereview.chromium.org/1484653002 .
2015-11-28 14:00:53 -08:00
Zachary Anderson 5ee95b085f Move tar archive parsing to C++
This gives a 30+ms speedup to startup.

Also uses HashMap instead of Map for assets.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1474603003 .
2015-11-25 14:39:19 -08:00
Florian Schneider 64e71a0b2e VM: Make more globals constant where easily possible.
Remove -fdata-section again from the Linux build configuration: It prevented
some optimizations in gcc and clang - fewer things were recognized as constants.

Add const to pointers/arrays in some places to help compilers with determining
what is a constant.  A common pattern is strlen of a string literal const char*,
or an array of function pointers.

Tested with gcc 4.8.4 / clang 3.4 and improves code qualtiy + reduces binary size.

BUG=
R=iposva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1462953002 .
2015-11-20 10:52:07 +01:00
John McCutchan aaf37ad035 Landing patch set 7 from https://codereview.chromium.org/1450113003/
Review URL: https://codereview.chromium.org/1466523002 .
2015-11-19 14:18:52 -08:00
Todd Turnidge b243fa53cf Redo the interface for capture stdio.
Flutter doesn't care to import tons of our include files.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1460863002 .
2015-11-19 09:24:23 -08:00
Florian Schneider f0a35b3260 VM: Add dart_precompiled build target, a standalone VM without the JIT compiler.
This removes most of the compiler-related code from dart_precompiled:
x64 stripped binary size 13M -> 9.1M
ARM stripped binary size 12M -> 8.3M

The precompiled build defines the DART_PRECOMPILED macro. This
stubs out the public interface to the compiler/parser with empty
function bodies.

Use gcc options -ffunction-sections and --gc-sections to make the linker remove
unused functions/symbols.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1459443002 .
2015-11-19 10:13:16 +01:00
Todd Turnidge 1d2d1ce0fc Don't use global variables for capturing stdio.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1458983002 .
2015-11-18 12:47:34 -08:00
Florian Schneider 72bd5adf00 Fix running standalone-precompiled when passing a package-root/-file/-map.
These are missing embedder entry points for standalone VM and
are needed when e.g. passing --package-root to a precompiled snapshot.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1462533002 .
2015-11-18 19:00:47 +01:00
John McCutchan 28e416b1f4 Revert "Avoid strerror_r portability issues"
This reverts commit ca81c1732b.
2015-11-17 16:34:25 -08:00
John McCutchan ca81c1732b Avoid strerror_r portability issues
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1450113003 .
2015-11-17 15:23:47 -08:00
Ivan Posva d97c7bdbde - Include sources in gen_snapshot and dart_no_snapshot to allow
creating full snapshots without having a full Dart SDK checkout.

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

Review URL: https://codereview.chromium.org/1449163003 .
2015-11-17 14:58:09 -08:00
Ryan Macnak f3759dedd3 Report iOS as iOS rather than OS X.
R=iposva@google.com

Review URL: https://codereview.chromium.org/1417013011 .
2015-11-13 11:15:04 -08:00
Lasse R.H. Nielsen ed0b187d58 Add data-URI support class to dart:core (next to Uri).
R=floitsch@google.com, fschneider@google.com

Committed: https://github.com/dart-lang/sdk/commit/bbc66c2c41e61d82d6b85fdd16e2b0f1204c2a33

Review URL: https://codereview.chromium.org/1381033002 .
2015-11-12 13:02:20 +01:00