Commit graph

215 commits

Author SHA1 Message Date
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

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

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07:00
Zachary Anderson 8200955ed0 Fuchsia: Add native symbol resolver. Small fixes.
R=asiva@google.com

Review URL: https://codereview.chromium.org/2438843002 .
2016-10-20 13:39:35 -07:00
Ryan Macnak 61bf8abd75 Make fatal out of memory messages uniform.
Add checks in a few more places with large allocations.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2418323002 .
2016-10-19 16:37:59 -07:00
Zach Anderson 71a84cfed6 GN: Fix Debug flags. Fix Windows build.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2425043002 .
2016-10-17 12:58:24 -07:00
Siva Annamalai 42c58c5c2d - fix some cases where we are using uninitialized memory
- use attribute 'no msan' on NativeEntry::ReturnValueIsError function
  as msan doesn't seem to track the return slot being set by a native
  function
- vsnprintf seems to have issues with msan so unpoison the allocated
  memory buffer everytime vsnprintf is used to suppress the error.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2383293003 .
2016-10-05 16:54:18 -07:00
Ryan Macnak 47cc06ae66 Shrink AOT snapshot size and memory usage.
- Conditionally remove fields of Code, Function and ICData that are not used in the AOT runtime.
 - Don't include RawClosureData.context_scope_ in AOT snapshots.
 - Remove parameter names not needed for method resolution.
 - Remove parameter types not needed for function type tests.
 - Deduplicate parameter name and parameter type lists.
 - Shrink and share the initial MegamorphicCache table.

Flutter gallery (IsolateSnapshotReader event)
snapshot size 2731129 -> 2199999 (-19.4%)
initial heap  7899568 -> 5433176 (-31.2%)

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2326483005 .
2016-09-15 15:06:42 -07:00
Zach Anderson a695975d00 Fixes run_vm_tests Windows shutdown problem
related #27250

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2311283002 .
2016-09-06 10:10:40 -07:00
Ryan Macnak d418dde65b Reduce copying in sending service responses.
Add missing safepoint transitions.

Issue #27092
Likely contributes to Issue #27010

dart2js hello
Peak RSS at first Observatory visit -> Peak RSS after visiting timeline (with endless recorder)
Before 215M -> 321M
After 182M -> 233M

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2254543006 .
2016-08-18 10:34:50 -07:00
Zach Anderson 581939d8b6 Retry: Fixes memory leaks in the eventhandler
Crashes were caused by removing from a std::map while iterating over it.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2231123002 .
2016-08-10 15:20:30 -07:00
Zachary Anderson bf085120f6 Revert: Fixes leak of duplicate command line environment strings
For bot crashes on Mac

Review URL: https://codereview.chromium.org/2229973002 .
2016-08-09 15:36:57 -07:00
Zachary Anderson 92abe83b26 Fixes memory leaks in the eventhandler
These probably only happen when the VM is going down after an unhandled
exception, but I want to fix them anyway.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2228503007 .
2016-08-09 15:20:50 -07:00
Zachary Anderson e476e00ca6 Fuchsia: Use low-level prng call, add test, update test runner.
There is now a syscall for getting cryptographically secure random bytes.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2204523002 .
2016-08-02 13:18:37 -07:00
Ryan Macnak b01541d54d Attempt to print the stack using the profiler upon assertion failure.
Fix mismatched free of native symbol.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2199453002 .
2016-07-29 13:29:25 -07:00
Zachary Anderson 74bbc7f55f Fuchsia: Make some more VM tests pass
R=asiva@google.com

Review URL: https://codereview.chromium.org/2189973003 .
2016-07-29 08:07:25 -07:00
Zachary Anderson 53374c3b99 Fuchsia: Build standalone VM. Make it run "Hello, World!".
This CL adds targets to the GN build that build the standalone Dart VM
without the observatory, and with dart:io enabled but with most of the
functionality stubbed out as UNIMPLEMENTED(). It also adds a simple
eventhandler for Fuchsia for implementing Timers.

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

Review URL: https://codereview.chromium.org/2168193002 .
2016-07-22 14:00:31 -07:00
Zachary Anderson b30da81483 Fuchsia: Hello, Fuchsia!
R=asiva@google.com

Review URL: https://codereview.chromium.org/2158673002 .
2016-07-18 10:35:03 -07:00
Zachary Anderson e27b49fc80 [fuchsia] GN build support for Fuchsia OS and fuchsia_test target
This adds a GN target for the 'fuchsia_test' executable and teaches
the GN build about is_fuchsia. Key differences:

*) There's not currently a dart:io implementation for Fuchsia
*) Fuchsia's toolchain currently doesn't support (or need) ldl or lpthread
*) Fuchsia's buildconfig doesn't currently set the is_asan variable

Review URL: https://codereview.chromium.org/2149953003 .
2016-07-14 15:01:30 -07:00
Ryan Macnak d75699e863 Make core snapshots word-size portable again.
Flutter creates a single core snapshot (from x64) that is used by both sky_snapshot (x64) and the engine (arm).

R=asiva@google.com

Review URL: https://codereview.chromium.org/2132833002 .
2016-07-08 14:18:44 -07:00
Zachary Anderson a503570e3a Fuchsia: Initial check-in.
Instructions to build and run are in README.fuchsia.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2117593002 .
2016-07-01 12:42:05 -07:00
Carlo Bernaschina 21ce02fb70 Use official JSON encoding for stream
Closes https://github.com/dart-lang/sdk/issues/26721

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2081433002 .
2016-06-28 15:40:08 -07:00
Zachary Anderson fcf4578c03 Remove STL use from platform/assert.cc
R=asiva@google.com

Review URL: https://codereview.chromium.org/2085703002 .
2016-06-21 12:50:43 -07:00
Vyacheslav Egorov 97a8c4caff VM: Fix WeakProperty processing during parallel marking.
Previously if one marker marked the weak property and another marker marked its key then the first marker might stop marking before it sees that the key was marked.

Here is a possible concurrent execution, assuming P is a WeakProperty and K is P.key:

    (Marker A)                        (Marker B)
        |                                  |
[ mark property P     ]                    |
        |                                  |
[ drain marking stack ]                    |
[ no more work to do  ]                    |
        |                       [ mark K               ]
        |                       [ draing marking stack ]
        |                       [ no more work to do   ]
        |                                  |
        |                                  |
       ...                                ...
        |                                  |
    [Finalize]                         [Finalize]
        |
    [Clear P]

In this execution we end up clearing P even though P.key is marked.

To fix this issue without reintroducing central WeakProperty processing
we change the marking phase loop in such a way that markers consider the
marking done only if all of them agree that they have no more weak properties
with marked keys.

Essentially the marking loop now has a separate phase where all markers check
their pending weak properties. The decision to proceed to the next marking phase
(weak handles processing) is done in lock step using barrier - either all threads
advance to the next stage or one of the threads finds a weak property
with marked key and unmarked value and all threads resume marking.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2041413005 .
2016-06-09 18:50:23 +02:00
Ryan Macnak 85cdc0eac2 Don't assume we want the iOS ABI if running simarm on Mac and the EABI otherwise.
Allow controlling the target ABI by defining TARGET_ABI_IOS or TARGET_ABI_EABI.  If neither is defined, default to the previous behavior.

Make Linux, Mac, Android and iOS agree on the value of PreferredCodeAlignment for all architectures.

BUG=http://dartbug.com/26464
R=zra@google.com

Review URL: https://codereview.chromium.org/1982613003 .
2016-05-17 15:03:54 -07:00
John McCutchan fc117e0b87 Merge branch 'master' into undo_last_change
Undo the previous change
2016-05-17 12:38:04 -07:00
John McCutchan dfb1e1b0f5 Attempt to get the bots to rebuild the world
BUG=

Review URL: https://codereview.chromium.org/1988843003 .
2016-05-17 12:35:29 -07:00
Zachary Anderson f82a8c9af2 Disable concurrent marking/sweeping, and background compilation on ARMv5TE
Also adds missing feature detection to the graph intrinsifier.

R=iposva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1974873002 .
2016-05-12 15:09:42 -07:00
John McCutchan 0cfd4f5cd5 GN Build fixes for Flutter + gen_snapshot fix
1. Add "dart_runtime_mode" GN argument. This is an enum with three valid values: "release", "profile", and "develop".
   *) "release" builds product precompiled-runtime.
   *) "profile" builds non-product precompiled-runtime.
   *) "develop" builds non-product non-precompiled-runtime.

2. Remove the redundant "dart_product" GN argument.

3. Kill all *precompiled_runtime static library variants and the related config.

4. Always include the precompiler in gen_snapshot.

5. Support multiple --embedder_entry_points_manifest arguments to gen_snapshot.

6. Update our test harness to use gen_snapshot and pass the same kinds of command line arguments the Flutter folks are using.

7. ASSERT that both DART_PRECOMPILED_RUNTIME and DART_PRECOMPILER are not set at the same time.

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

Review URL: https://codereview.chromium.org/1903583002 .
2016-04-22 07:00:03 -07:00
Vyacheslav Egorov ee0f608ce4 Dart Byte Code interpreter.
This version is Clang/GCC only and does not support Windows because it uses computed goto's.

Only unoptimized mode is supported.

Architecture is described in constants_dbc.h and stack_frame_dbc.h.

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

Review URL: https://codereview.chromium.org/1858283002 .
2016-04-18 23:02:01 +02:00
Srdjan Mitrovic cef337f8c7 Add instruction tags to saved ICData (debug mode only).
When restoring ICData in optimizing compiler, we can verify that the ICData/deopt-id matches an instruction. This should help catch non-deterministic graph generation.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1864143002 .
2016-04-06 11:01:46 -07:00
Zach Anderson 08450dc432 Begin work on ios secure sockets
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1839123003 .
2016-03-31 12:55:31 -07:00
John McCutchan 9bc7398eb8 Ensure embedder timeline callbacks are called for service protocol requests
BUG=
R=chinmaygarde@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1799933002 .
2016-03-15 07:59:04 -07:00
Ivan Posva c822c34af6 - Add DEBUG_ONLY and NOT_IN_PRODUCT macros.
- Remove user_name_ field from RawClass using macros.
- Consolidate "#ifndef PRODUCT" and "#ifdef DEBUG" code using macros.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1715123003 .
2016-02-19 17:48:08 -08:00
Ivan Posva 4f392df85e Fix some more shorten-64-to-32 warnings:
- Remove duplicate check for javascript integer overflow.
- Make sure the BitField class knows the type it is
  encoding into.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1644223006 .
2016-02-02 13:58:06 -08:00
Zachary Anderson 963946af00 Disable TLS destructors on Windows before calling abort() for an ASSERT.
This fixes some flaky failures and timeouts on Windows in tests where
an ASSERT fails.

This change requires Using OS::Abort in platform/assert.cc so that the
flag disabling tls destructors can be set.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1572913002 .
2016-01-11 10:35:00 -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
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
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
Zachary Anderson 3563dc0fb0 Use ExitProcess on Windows.
Even after joining threads, it is still possible for the exit code to be
polluted. NaCL uses ExitProcess to avoid this problem:

https://code.google.com/p/chromium/codesearch#chromium/src/native_client/src/shared/platform/win/nacl_exit.c

This change also cleans up thread local storage for the last Thread.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1410293006 .
2015-10-29 23:35:46 -07:00
Chinmay Garde 87ce99fd00 Enable generation of instruction buffer on precompilation
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1411383004 .
2015-10-22 12:26:41 -07:00
William Hesse e6b85bb28c Use #if TARGET_OS_IOS instead of #ifdef TARGET_OS_IOS.
New versions of the OS X SDK always define TARGET_OS_IOS, as 0 or 1.

BUG=https://github.com/dart-lang/sdk/issues/24501
BUG=https://github.com/dart-lang/sdk/issues/24453
R=iposva@google.com

Review URL: https://codereview.chromium.org/1388973002 .
2015-10-12 12:38:10 +02:00
Todd Turnidge cc981c8246 Don't use %p when generating disassembly in vm service.
Evidentally it is platform dependent -- it seems to include the 0x
prefix on mac but not on windows.  I've switched to using %" Px "
instead.

This will fix bug 24038.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1282993002 .
2015-08-11 11:22:55 -07:00
Todd Turnidge 81d5c8c508 Add STDOUT_FILENO, etc., for windows build.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1234953003 .
2015-07-14 14:28:06 -07:00
Ryan Macnak b8bad6725c Expand the class id to 32 bits and size field to 16 bits on 64-bit platforms.
Remove misleading suffix from disassembly of some ia32 immediate ops.

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

Review URL: https://codereview.chromium.org//1174173007.
2015-06-12 16:42:40 -07:00
Ryan Macnak a16abcdf5a Shrink some fields and add some bounds checks.
R=asiva@google.com

Review URL: https://codereview.chromium.org//1149943009.
2015-06-09 10:47:25 -07:00
Srdjan Mitrovic c0824e7725 Fix 23563: double unary- operator unstable for NANs
BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1160453003
2015-06-03 11:00:28 -07:00
Ivan Posva 8f1506e817 - Determine whether the simulator is being used in globals.h
- Make sure to switch on HOST_ARCH_ and on USING_SIMULATOR
  where appropriate.
- Avoid allocating in new generation when running in the VM isolate.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1156053006
2015-05-29 14:35:29 -07:00
John McCutchan 51d8bae199 Revert "Hide Isolate pointer from embedder"
This reverts commit 014e694ba7.

Revert "Fix fall out from hide isolate pointer change"

This reverts commit 966aafbc81.

Revert "Fix build"

This reverts commit d7b03ba7b0.

BUG=

Review URL: https://codereview.chromium.org//1140263005
2015-05-19 11:41:42 -07:00
John McCutchan 014e694ba7 Hide Isolate pointer from embedder
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1130753006
2015-05-18 14:06:10 -07:00
johnmccutchan@google.com e23be8563a Fixes to enable building dart:io implementation cleanly in mojo tree
+ make Observatory respect script line offsets (which Sky uses).

R=iposva@google.com

Review URL: https://codereview.chromium.org//1101083003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45427 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-27 14:46:32 +00:00