Commit Graph

32 Commits

Author SHA1 Message Date
Ryan Macnak 30b0b9b723 [vm] Code size reductions:
- Remove dead Isolate::IsTopLevelParsing.
 - Remove dead TraceFunctionEntry/Exit.
 - Migrate more tracing flags to flag_list.h to allow code elimination in non-debug modes.
 - Require an explicit Zone parameter for CheckedHandles.
 - Remove side-effects from RuntimeEntry constructor.

out/ProductX64/exe.stripped/dart_precompiled_runtime 4063464 -> 4046952 (-16k)

Change-Id: Iffd3de25a03d2354cdecf2d79aa761c33ab08bd3
Reviewed-on: https://dart-review.googlesource.com/c/83120
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-08 02:02:39 +00:00
Vyacheslav Egorov 3b86f823d0 [vm/corelib] Remove GrowableArrayMarker hack.
GrowableArrayMarker was a class that implemented int and was used to
enable implementation of default List factory constructor in pure Dart:

  factory List([int length = GROWABLE_ARRAY_MARKER]) {
    return identical(length, GROWABLE_ARRAY_MARKER) ? new _GrowableList<E>(0)
                                                    : new _List<E>(length);
  }

Its existence complicated all kinds of things in the VM and it is finally
time to remove it.

Instead we build List factory body directly in IL.

This CL also provides inlining rule for `new List(n)` case.

Change-Id: I870751658a4ac17fce649c9ac70395ff88a5436c
Reviewed-on: https://dart-review.googlesource.com/57262
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-05-30 13:44:43 +00:00
Vyacheslav Egorov 8a179fb953 [VM, Compiler] Move compiler to a separate folder.
New folder structure (nested under vm/):

- compiler/
-   jit/         - JIT specific code
-   aot/         - AOT specific code
-   backend/     - all middle-end and back-end code (IL, flow graph)
-   assembler/   - assemblers and disassemblers
-   frontend/    - front ends (AST -> IL, Kernel -> IL)

compiler/README.md would be the documentation root for the compiler
pipeline

Bug: https://github.com/dart-lang/sdk/issues/30575
Change-Id: I2dfd9688793bff737f7632ddc77fca766875ce36
Reviewed-on: https://dart-review.googlesource.com/2940
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-09-04 15:15:18 +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 2e4dfd3a2d clang-format runtime/lib
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2468093007 .
2016-11-04 12:14:41 -07:00
Lasse R.H. Nielsen d755dd65b9 Update range errors to agree on the numbers.
Also ensure that typed-data errors are consistent with other lists.

Fixes issue #24295
BUG= http://dartbug.com/24295
R=floitsch@google.com, iposva@google.com, sra@google.com

Review URL: https://codereview.chromium.org//1318943005 .
2015-09-11 13:05:36 +02:00
regis@google.com 0220e41d72 New bigint implementation in the vm.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40061 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 21:47:44 +00:00
vegorov@google.com c431dbcb3f Cleanup throwing of the RangeError in the runtime to remove duplicated code.
Improve List._copyFromObjectArray native performance for large arrays by using PassiveObject instead of Object.

R=iposva@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39911 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 13:15:56 +00:00
vegorov@google.com a1e2035eda Improve List.sublist and List.toList for large lists.
- Merge array allocation and List._copyFromObjectArray to provide memmove fast path;

- In optimizer given v2 = CreateArray(v0, v1) fold v2.length load to v1;

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39831 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 20:36:01 +00:00
fschneider@google.com 97dc2bd55a Implement native _List. constructor in the flow-graph builder.
Replace assembly intrinsic and the C++ native function with a CreateArray
instruction.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39554 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 13:57:15 +00:00
regis@google.com 7830430adf Implement eager instantiation and canonicalization of type arguments at run
time using a cache in uninstantiated type arguments.
Remove InstantiatedTypeArguments class.
Fix a bug in optimized code: do not update unused type test cache for Smi.
Fix a bug in optimized code on ARM and MIPS in type test cache lookup.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32447 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 19:54:33 +00:00
srdjan@google.com e16402e56e Fix 16099: Invocation's positionalArguments contains an immutable array.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31845 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-15 19:14:45 +00:00
iposva@google.com e7e2e4bf03 - Rename arrays to lists:
_ObjectArray -> _List
  _GrowableObjectArray -> _GrowableList
  _ImmutableArray -> _ImmutableList

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28189 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-03 00:15:14 +00:00
srdjan@google.com b6b3e1f400 Factor out throwing of argument error.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28109 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 18:48:37 +00:00
jacobr@google.com 605b33c1bc fix cpp11 compile errors
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26387 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 20:24:11 +00:00
srdjan@google.com dd9806e023 Fix crashes in debug mode with optimizations turned off.
Remove wrong assert. The correct assertion is done within SetTypeArguments.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22079 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-26 18:19:45 +00:00
iposva@google.com 5c71abedff - Do not use the ? operator in the List factory.
Review URL: https://codereview.chromium.org//12335146

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19178 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 22:36:22 +00:00
asiva@google.com 7ea520f10f Create read only handles for empty_array and sentinel objects
(trying out a basic framework and will extend it to others once this
works).
Review URL: https://codereview.chromium.org//11648006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16416 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-21 02:33:05 +00:00
asiva@google.com 8af296c9c8 Cleanup the exceptions create code to use Arrays instead GrowableArrays so
that it is consistent with the DartEntry invoke code that it calls finally.
Review URL: https://codereview.chromium.org//11639007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16295 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 23:47:35 +00:00
regis@google.com dd6a0ec349 Rename GET_NATIVE_ARGUMENT macro to GET_NON_NULL_NATIVE_ARGUMENT.
Introduce new GET_NATIVE_ARGUMENT macro accepting null.
Add test.
Review URL: https://codereview.chromium.org//11468016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15919 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-10 17:59:40 +00:00
hausner@google.com 7eb3efc2ba Fix native argument handling
Native functions need to fetch arguments differently if they are
called through a closure.

fixes issue 6696.
Review URL: https://codereview.chromium.org//11293290

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14937 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-15 01:14:01 +00:00
lrn@google.com 7e6ae8ea09 Renaming IndexOutOfRangeException to RangeError.
It now extends ArgumentError.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14405 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-01 13:46:30 +00:00
lrn@google.com a1faa6f135 Change IllegalArgumentException to ArgumentError.
Review URL: https://codereview.chromium.org//10989013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12841 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 12:27:52 +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
turnidge@google.com 14f614da12 Use the return value of vm native methods to set the return value,
based on Siva's earlier suggestion (he actually suggested putting it
in the generated stub, which I haven't done).

Added SetReturnUnsafe and use it exactly one place so far.
Review URL: https://chromiumcodereview.appspot.com//10874072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11633 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:41:19 +00:00
turnidge@google.com 8b68d343c7 Enforce length/size limits for variable size heap object in order to
avoid overflow.

For each variable size heap object, compute the maximum number of
elements and use that in the ::New functions to avoid overflow.  If a
bad length/size reaches a ::New function, that is a FATAL error -- the
problem should have been caught earlier by the dart api or by the
library code.

Add "border guards" in the dart api and in library calls which cause
new variable size heap objects to be allocated.  We check for invalid
length/size and throw explanatory error messages.
Review URL: https://chromiumcodereview.appspot.com//10782016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10130 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-01 18:22:30 +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
srdjan@google.com d07087ce77 Ongoing renaming of type classes:
TypeArguments -> AbstractTypeArguments
TypeArray -> TypeArguments
Review URL: http://codereview.chromium.org//8776020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2002 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 23:19:59 +00:00
srdjan@google.com 88878148ac Fix crashes when going to natives. Throw an exception instead.
Review URL: http://codereview.chromium.org//8678025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1817 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 22:03:51 +00:00
srdjan@google.com 0265e3f027 Fixes to co19 crashes:
- Null is a valid exception object.
- Throw exception in array copy.
Review URL: http://codereview.chromium.org//8437106

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1173 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-03 22:31:32 +00:00
srdjan@google.com 6d8d978d5a FIx issue 261: throw exception if index if idnexed oeprators if lists Array and GrowableArray is not int.
Review URL: http://codereview.chromium.org//8387035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@962 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-31 18:40:32 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00