Commit graph

28 commits

Author SHA1 Message Date
Ryan Macnak e0e14c370a [vm] Update NULL to nullptr in runtime/platform.
TEST=build
Change-Id: I1a01702451f1be91f14c3a860fa3f84b0c686409
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292062
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-30 20:49:48 +00:00
Tess Strickland 431ed5183f [vm/compiler] Reduce number of subtype comparisons in AOT.
Previously when building subtype class id ranges for a class in AOT, we
looped over the entire class table, even though in most cases, the
number of actual subclasses and implementors of the class is a small
subset of all loaded classes.

Instead, use the same hierarchy information in both JIT and AOT, only
falling back to traversing the entire class table in cases where the
hierarchy information is missing.

Additional changes:
* Do not generate unused type argument checks if the subtype class id
  range to check is empty.
* Only generate a nullability check when checking that an instance
  type argument is a subtype of non-nullable Object in null safe mode.
* Fix AbstractType::IsSubtypeOf so _Closure <: Function.

Fixes https://github.com/dart-lang/sdk/issues/46936

TEST=vm/cc/HierarchyInfo

Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try
Change-Id: Ic0310208d271ef04e778f070f420ae0abbdd47d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210581
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-08-19 18:32:01 +00:00
Zach Anderson f407419d0a [vm] Reland: Prefix HOST_OS_* and TARGET_OS_* with DART_
This relands https://dart-review.googlesource.com/c/sdk/+/205633
but without renaming TARGET_OS_IPHONE to DART_TARGET_OS_IPHONE.
It also changes uses of TARGET_OS_IOS to
DART_TARGET_OS_MACOS_IOS to be consistent with the rest of the
VM.

TargetConditionals.h for XCode 13 defines several
TARGET_OS_* preprocessor symbols that confuse the
Dart build. There is probably a more targeted fix
for this, but renaming the symbols that Dart uses
will also prevent this problem if more symbols
are added to the platform headers in the future.

See: https://github.com/dart-lang/sdk/issues/46499

TEST=It builds.

Change-Id: Ie775c19dd23cfdf5f65e5ebc6ee4ec3a561676fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205860
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-07-02 19:06:45 +00:00
Slava Egorov 42164cc140 Revert "[vm] Prefix HOST_OS_* and TARGET_OS_* with DART_"
This reverts commit aa9201b76b.

Reason for revert: blocks G3 roll (b/192627187)

Original change's description:
> [vm] Prefix HOST_OS_* and TARGET_OS_* with DART_
>
> TargetConditionals.h for XCode 13 defines several
> TARGET_OS_* preprocessor symbols that confuse the
> Dart build. There is probably a more targeted fix
> for this, but renaming the symbols that Dart uses
> will also prevent this problem if more symbols
> are added to the platform headers in the future.
>
> See: https://github.com/dart-lang/sdk/issues/46499
>
> TEST=It builds.
> Change-Id: I3b33a03b4a9a14b76d55fe12f8cdefec4b3c3664
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205633
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=rmacnak@google.com,zra@google.com,asiva@google.com

Change-Id: Ib06ca418c7e9d3b4df62c72c033cd39f462f7667
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205790
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2021-07-02 14:02:02 +00:00
Zach Anderson aa9201b76b [vm] Prefix HOST_OS_* and TARGET_OS_* with DART_
TargetConditionals.h for XCode 13 defines several
TARGET_OS_* preprocessor symbols that confuse the
Dart build. There is probably a more targeted fix
for this, but renaming the symbols that Dart uses
will also prevent this problem if more symbols
are added to the platform headers in the future.

See: https://github.com/dart-lang/sdk/issues/46499

TEST=It builds.
Change-Id: I3b33a03b4a9a14b76d55fe12f8cdefec4b3c3664
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205633
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-07-02 06:02:48 +00:00
Vyacheslav Egorov 69ec09825a [vm] On Android set abort message before aborting
Android L and newer (API level 21) provides a way to
specify abort message which will be included into
crash report created by debuggerd.

Make sure our DynamicAssertionHelper uses this functionality
if available.

TEST=tested manually

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-android-release-arm64-try,vm-kernel-mac-release-x64-try
Change-Id: If25cd168d43677e0a0fe9b63e21a017415686ab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191140
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-03-15 15:35:10 +00:00
Ryan Macnak 971f4845d7 [build] Remove last platform -> vm and bin -> vm dependencies. Fix some ODR violations.
Change some static_libraries to source_sets to make ODR violations link-time errors.

This is needed to enable (stop suppressing) -fvisibility=hidden in Fuchsia product builds.

Change-Id: I699cec8d4b516beab9cebf9db0a522a7ff99e004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99822
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-22 20:15:43 +00:00
Ryan Macnak 28178aade6 [vm] Move VM globals from runtime/platform to runtime/vm.
Change-Id: Ia271602865c259cc5a6e001869f3104817d1ce44
Reviewed-on: https://dart-review.googlesource.com/63261
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-04 21:16:39 +00:00
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
Ryan Macnak aee4561882 [vm] Remove dependency of platform/assert.cc on vm/profiler.h
Change-Id: Ieab84b164ed620d5edca06e3c7b63b33bdcd6569
Reviewed-on: https://dart-review.googlesource.com/52943
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-27 23:30:48 +00:00
Siva Annamalai 501720c644 Retry landing cl for issue with TSAN.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2525103003 .
2016-11-23 15:40:26 -08:00
Siva Annamalai 66cb033ac1 Revert "Fix tsan failure"
This reverts commit 159a5ab366.

This reverts commit aa76de9a8f.

BUG=

Review URL: https://codereview.chromium.org/2510093005 .
2016-11-18 16:44:32 -08:00
Siva Annamalai 159a5ab366 Fix tsan failure
We have a racy read of the object header in the stack frame walker
called from the profiler (in this case the gc marker is running at
the same time).

It is appropriate to avoid this even though we think the access is
safe as the objects are in old space and never forwarded and only
the mark bits are manipulated while marking
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2517473002 .
2016-11-18 14:09:02 -08: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
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
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
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 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
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
fschneider@google.com aefdc04fa8 VM: Fix issue with local variable values reported by the debugger.
I added a function to test if a variable is visible or not to the
debugger tests.

BUG=dartbug.com/22353
TEST=standalone/debugger/local_variables_test
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43850 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-18 18:48:00 +00:00
ajohnsen@google.com d21ca48526 Flush stderr when printing ASSERT message.
This ensures that the message is received by the other end, e.g. test.dart, on Windows.

BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37160 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-10 06:52:12 +00:00
jackpal@google.com 3e510176c2 Fix Android build breaks
Prevent Android's STLPort from undefining global functions from
math.h when cmath is included after math.h.

The Android STLPort does not provide std::assert or std::atexit. Use
the C versions of these functions on Android.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12741 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 22:04:37 +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 2d70c7a5eb Improve the stack trace output to be more readable.
BEFORE

Unhandled exception:
MyException
 0. Function: '::baz' url: 'file:///Users/turnidge/dart/bug.dart' line:2 col:3
 1. Function: '_OtherClass@11f7ef14._OtherClass@11f7ef14._named@11f7ef14' url: 'file:///Users/turnidge/dart/bug.dart' line:7 col:8
 2. Function: '::set:globalVar' url: 'file:///Users/turnidge/dart/bug.dart' line:12 col:3
 3. Function: '::_bar@11f7ef14' url: 'file:///Users/turnidge/dart/bug.dart' line:16 col:3
 4. Function: 'MyClass.get:field' url: 'file:///Users/turnidge/dart/bug.dart' line:25 col:9
 5. Function: 'MyClass.fooHelper' url: 'file:///Users/turnidge/dart/bug.dart' line:30 col:7
 6. Function: 'MyClass.foo' url: 'file:///Users/turnidge/dart/bug.dart' line:32 col:14
 7. Function: 'MyClass.function' url: 'file:///Users/turnidge/dart/bug.dart' line:21 col:15
 8. Function: 'MyClass.MyClass.' url: 'file:///Users/turnidge/dart/bug.dart' line:21 col:18
 9. Function: '::function' url: 'file:///Users/turnidge/dart/bug.dart' line:38 col:10
 10. Function: '::main' url: 'file:///Users/turnidge/dart/bug.dart' line:38 col:24

AFTER

Unhandled exception:
MyException
#0      baz (file:///Users/turnidge/dart/bug.dart:2:3)
#1      _OtherClass._OtherClass._named (file:///Users/turnidge/dart/bug.dart:7:8)
#2      globalVar= (file:///Users/turnidge/dart/bug.dart:12:3)
#3      _bar (file:///Users/turnidge/dart/bug.dart:16:3)
#4      MyClass.field (file:///Users/turnidge/dart/bug.dart:25:9)
#5      MyClass.foo.fooHelper (file:///Users/turnidge/dart/bug.dart:30:7)
#6      MyClass.foo (file:///Users/turnidge/dart/bug.dart:32:14)
#7      MyClass.MyClass.<anonymous closure> (file:///Users/turnidge/dart/bug.dart:21:15)
#8      MyClass.MyClass (file:///Users/turnidge/dart/bug.dart:21:18)
#9      main.<anonymous closure> (file:///Users/turnidge/dart/bug.dart:38:10)
#10     main (file:///Users/turnidge/dart/bug.dart:38:24)
Review URL: https://chromiumcodereview.appspot.com//10826191

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10408 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 17:22:26 +00:00
sgjesse@google.com 68d10e1568 Move Mutex and Monitor from vm/ to platform/
The tests are still in runtime/vm/thread_test.cc.

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

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3349 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-17 10:29:24 +00:00
sgjesse@google.com 65896148c9 Move utils.h and utils.cc from runtime/vm to runtime/platform
Moved additional parts of globals.h from vm/ to platform/ to support
types and constants used by utils.*.

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

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3337 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 13:23:40 +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
Renamed from runtime/vm/assert.cc (Browse further)