Commit Graph

25 Commits

Author SHA1 Message Date
Ryan Macnak 7e54844fe7 [vm] Fix build for gcc 7.3.0.
Change-Id: I02ead73679c3a6e1e5c9313f78c5f02ad6ca79b0
Reviewed-on: https://dart-review.googlesource.com/53521
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-03 17:59:44 +00: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
Zachary Anderson 6953586716 Add .clang-format and run clang-format on runtime/platform.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2470663006 .
2016-11-03 14:25:16 -07:00
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
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
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
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
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
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
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
koda@google.com 4cac1a531a Increase verbosity of assertion failures in SizeFromClass.
Print the tag word for which the assertion fails.
This is specifically to help tracking down issue 22087.

TBR=iposva@google.com
BUG=dart:22087

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43732 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 18:08:55 +00:00
koda@google.com bf07d168c4 MallocGrowableArray
To be used where neither Dart nor zone allocation is suitable, such as ClassTable.

Also add ASSERT_NOTNULL convenience macro for use in initializer lists.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42819 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 16:40:09 +00:00
fschneider@google.com 01255e0843 Change COMPILE_ASSERT to take only one argument and use it in more places.
This way it can be used in the same way as ASSERT.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36625 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-26 09:45:04 +00:00
iposva@google.com fd8565b071 - Add a minimal implementation of Capability.
- Make RawReceivePort and SendPort VM internal objects.
- Rationalize the creation of ports and their handling within the VM.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35325 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 19:44:03 +00:00
iposva@google.com 25b81b3e8b - Fix string conversion warnings.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30204 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-12 19:43:44 +00:00
cbracken@google.com 0fdb309321 Prefix compile-time typedef checks with __attribute__((unused))
Prevents build failure under gcc 4.8.

Bug report: http://dartbug.com/13645

BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28411 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-09 19:43:41 +00:00
fschneider@google.com 86da5111ad Replace scalarlist optimizations and split external array loads into two IL instructions.
This CL removes optimized access for scalarlist, and only the new TypedData classes
are optimized. I changed the runtime libraries core and math to use typedData
instead of scalarlist (Uint16List is used in StringBuffer, Uint32List by Math.random).

Instead of using LoadIndexed for internal and external arrays,
split external loads into a load of the backing store and a load
of the element.

v3 <- LoadIndexed(v1, index)

becomes

v2 <- LoadUntagged(v1, ExternalTypedData::data_offset)
v3 <- LoadIndexed(v2, index);

For this I introduce two new representations in the IL:

 kUntagged (for values that hold a untagged pointer) and
 
 kNoRepresentation (for instructions accept any input
 representation)

Deoptimization does not need to know about kUntagged
since these values can never occur in the environment.

Also with this change:
* fix COMPILE_ASSERT and use it in one place.
* Cleanup IL printer output of deopt ids.
Review URL: https://codereview.chromium.org//12871010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20198 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 12:06:23 +00:00
zerny@google.com 792a5cbcee Added slow_assert macro and flag for slow development assertions in the VM.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13069 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-01 14:27:45 +00:00
cshapiro@google.com da14bf70a7 Add attributions so printf like functions can have their arguments checked.
This change also corrects some misuses of format strings and format
arguments that discovered by the compiler checks.

Review URL: https://chromiumcodereview.appspot.com//10869063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11912 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 00:58:25 +00:00
cshapiro@google.com 28c9533a21 Use output-only string streams instead of input-output string streams.
The assertion code only writes to its string streams and never reads data
back.  As such, there is no reason to use a stream type supporting input.

Review URL: https://chromiumcodereview.appspot.com//10828317

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10693 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 23:55:37 +00:00
turnidge@google.com 40b0d11c1f Add missing files from last commit!
Review URL: https://chromiumcodereview.appspot.com//10829127

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10133 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-01 18:29:55 +00:00
turnidge@google.com ec36e02c28 Remove the partially completed code for remote IsolateMirrors and
replace it with the beginnings of a local (same isolate) IsolateMirror
implementation.

Removed old mirror tests and added two new mirror tests.

Even though mirrors.cc is part of the vm, I chose to implement most of
it using the dart embedding interface instead of our internal
interfaces because the embedding interface was more convenient.
mirrors.cc is basically all new in this CL -- don't pay any attention
to diffs for that file.

Added dart embedding functions required for the functionality in this
CL: Dart_DebugName, Dart_GetNativeInstanceFieldCount,
Dart_RootLibrary, Dart_RegisteredLibraryUrls, and Dart_LibraryName.

Extended or modified some existing dart api functions, primarily to
make them propagate error handles properly.

Added tests for new dart embedding api functionality.

Added the ability to determine if a port is local to the current isolate.

Extended NotImplementedException to accept an optional string
argument.  I wanted to give more descriptive error messages.
Review URL: https://chromiumcodereview.appspot.com//10416050

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8117 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-30 17:07:19 +00:00
sgjesse@google.com 3f035ecad0 Add support for lists and backward references when decoding a message to a Dart_CObject object
The C message reader can now read lists created like this:

  new List()
  new List<int>()
  new List<String>()
  new List<double>()
  new List<bool>()

The backward references are now resolved and already allocated
Dart_CObject objects are reused when there is a backward reference.

The reuse of the Dart_CObject objects poses the issue of which objects
where allocated with the supplied allocator and which where not.

Currently this will work best with a zone allocator. This will be added
to the tests in a subsequent change.

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

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9303031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3831 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 09:55:18 +00:00
sgjesse@google.com bf67f24098 Move assert.h/assert.cc from runtime/vm to runtime/platform
The purpose of this change is twofold:

1. Source in the bin directory can now use the same assertions as
   source in the vm directory. The ASSERT macro used by the code
   in runtime/bin was just defined to use assert from the standard
   C library.
2. Moving other implementation parts from runtime/vm to
   runtime/platform (e.g. classes Monitor and Mutex) for sharing
   between runtime/bin and runtime/vm will be easier as these
   implementations rely on these assertion macros.

Created two gypi files for the platform directory. One for the
headers and one for the source. The source one is only included
when building the VM library and will be present in libdart.a
when the dart executable is linked.

All the code for asserts is still in the dart namespace.

Also re-arranged the order of includes to be alphabetically in
the files touched.

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

BUG=
TEST=

Review URL: http://codereview.chromium.org//9189003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3335 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 12:28:10 +00:00