Commit Graph

280 Commits

Author SHA1 Message Date
Daniel Andersson 51de0c8ff4 Refactor skipped code functions interface.
Prepares for parallel marking by encapsulating the skipped code functions set, and moving the finalization out to the GCMarker, after all marking is done.

Also changes the interface in the visitor interface to make it less coupled with the representation of the set.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1287463003 .
2015-08-27 11:19:19 -07:00
Daniel Andersson b739b6319f Add NoSafepointScope to ObjectPointerVisitor.
Also update some uses of NoHandleScope to NoSafepointScope, which basically means "do not risk GC here".

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1292063004 .
2015-08-13 12:59:32 -07:00
Siva Annamalai e61f1dc8ce 1. Reclaim the CreatedFromSnapshot bit and use the bit to indicate VM heap object.
2. Cleanup calls to set_tags when reading objects from a snapshot.

3. Fixes issue 21816

R=regis@google.com

Review URL: https://codereview.chromium.org//1221503004 .
2015-08-10 11:02:31 -07:00
Florian Schneider 265a54411a Object pool with support for untagged entries.
This adds meta-information to object pool entries to allow storing
untagged immediates or code addresses (ExternalLabel) directly.

This eliminates the need to generate extra code to preserve the LSB
when storing immediates as smis (x64, arm64).

BUG=

Review URL: https://codereview.chromium.org//1175523002.
2015-06-10 11:41:22 +02:00
Ryan Macnak 300a2f34cf Delta encode pc descriptors, and combine pc kind and try index into single field.
328.3kB -> 126.8kB (-61.4%) mirrors_reader_test

Avoid quadratic var-int decoding in extracting edge counters by decoding once into a temporary list.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//1128183007
2015-05-18 11:04:45 -07:00
rmacnak@google.com 848ad67ee1 Revert "Delta encode pc descriptors."
32% regression on dart2js. Edge counters need to be redone first.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45776 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 20:24:47 +00:00
rmacnak@google.com ab784887a7 Delta encode pc descriptors.
328.3kB -> 160.1kB (-51.2%) for mirrors_reader_test

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45715 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 20:27:21 +00:00
fschneider@google.com c2fad4230c VM: Enable collection of unoptimized code for optimized functions.
Until now, code GC was limited to function that have not been optimized.
With lazy generation of unoptimized code on deoptimization we can now
collect unoptimized code for optimized functions as well.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45062 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-10 12:02:30 +00:00
iposva@google.com 320b0e5541 - Remove JSCRE from the runtime.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44987 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-08 23:59:23 +00:00
vegorov@google.com 3062d3bae0 Compress deopt instructions in memory using variable length encoding.
Remove DeoptInfo type entirely and store compressed instructions in the TypedData.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44966 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-08 13:08:36 +00:00
koda@google.com 0311c0eac9 Revert "Eliminate fake-Isolate workaround from concurrent sweeper."
The ARM simulator still needs a current isolate for its atomics.

TBR=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44637 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-23 17:17:41 +00:00
koda@google.com b7e1dcac19 Eliminate fake-Isolate workaround from concurrent sweeper.
Add RawObject::Size(ClassTable*) to avoid remaning calls to Isolate::Current.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44611 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-20 20:37:38 +00:00
koda@google.com dea01755a2 Avoid needless calls to Isolate::Current() in RawObject::SizeFromClass.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44610 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-20 20:19:15 +00:00
koda@google.com 9dff378e6c Work around race condition in MakeArray for ASSERTs and document assumptions.
BUG=dart:22501

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43898 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 22:55:50 +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 0b85873fc8 Deletion barrier preparation: validate overwritten references.
With the upcoming deletion barrier, every update of a pointer field must know whether the previous value was a valid pointer.

Currently, we always use StorePointer/StoreSmi, both for initialization and updates.

Initialization, and thus the potential for overwriting garbage values, appears in three places:
1. Object::Allocate/Foo::New.
2. Creating isolate from full snapshot.
3. Allocation in generated code.

Case 1 already null-initializes all underlying memory.
Case 2 is addressed by this CL by exploiting that:
i) fresh pages are zero-filled by OS, and
ii) freelist headers use only even values.
Case 3 is remains a TODO for future CLs.

(An alternative solution for case 2 would have been to add an init_foo method for every set_foo called.)

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42584 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-02 18:16:13 +00:00
hausner@google.com 48807614ee Eliminate 99% of allocated ExceptionHandler objects
The vast majority of functions have no exception handlers, thus they can all
share a single ExceptionHandler descriptor.

This CL reduces the number of ExceptionHandler objects on the heap from
about 8400 to 16, from 132KB to less than 1KB, when running dart2js.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40323 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 16:27:04 +00:00
hausner@google.com d8a70f2932 Save more memory by compacting LocalVarDescriptors
(Re-landing this change after assertions fixed.)

Instead of allocating an array for the names of local variables,
store the names in the LocalVarDescriptors structure directly.

Using dart2js to compile a small dart program results in about 7200
LVDs on the heap.

Retained memory before: 568KB
Retained memory after: 432KB (75%)

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40276 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 21:34:58 +00:00
ricow@google.com 941403f9c7 Revert revision 40228
This is making us crash across platforms in debug mode, see e.g., 
http://build.chromium.org/p/client.dart/builders/vm-linux-debug-x64-be/builds/2967

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40231 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 06:37:18 +00:00
hausner@google.com acf28bc37e Save more memory by compacting LocalVarDescriptors
Instead of allocating an array for the names of local variables,
store the names in the LocalVarDescriptors structure directly.

Using dart2js to compile a small dart program results in about 7200
LVDs on the heap.

Retained memory before: 568KB
Retained memory after: 432KB (75%)

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40228 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-12 23:53:03 +00: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
zra@google.com c686b2c624 Finishes removing intptr_t from raw object fields.
Also removes {Read,Write}IntptrValue from the snapshot reader and writer.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40048 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 19:51:22 +00:00
iposva@google.com 2ee3263277 - Add and enable concurrent sweeper.
- Keep separate lists for normal sized executable and data pages.

R=koda@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39593 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 13:37:55 +00:00
zra@google.com 5d3f4708ec Fixes to support ARMv5 lego mindstorm.
1. Deopts on division when neither vfp nor idiv are present.
   In a subsequent CL, I can add a leaf runtime call for this.

2. Uses a different PC read offset in STR and STM instructions.
   On ARMv5 and earlier, the PC read offset is 8 except in STR
   and STM instructions, where it is implementation defined. On
   lego mindstorm it is 12. This requires changing
   kEntryPointToPcMarkerOffset to be a function.

3. Uses a dummy struct to compute the size of a compressed
   pc descriptor to avoid alignment issues. sizeof(PcDescriptorRec)
   is 16 on ia32 and arm. Subtracting sizeof(int16_t) gives 14,
   which creates alignment problems on ARM, i.e. poor performance on
   ARMv6 and later, and wrong results on ARMv5 and earlier.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39250 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 15:42:00 +00:00
koda@google.com 1cdcb12b4e Add VM class for Map/LinkedHashMap.
Introduces a new internal class for the most common case, the default Map.

Passes all functionality tests.
Slow: Dart side simply calls into runtime for now.
Hidden behind "--use_internal_hash_map".

Add copies of hash map tests to exercise this implementation.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38588 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-25 20:04:11 +00:00
asiva@google.com a323a9c9db The dart version of typeddata library has changed to be compatible with the dart2js implementation
(typeddata does not implement ByteBuffer anymore).
Added new Dart API functions to account for this change.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38351 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-17 22:08:07 +00:00
srdjan@google.com ac094f9d20 Address comment by asiva.
Review URL: https://codereview.chromium.org//392353002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38289 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 16:22:48 +00:00
srdjan@google.com 16e4600ff5 Fix build (link error reproducible on linux with GYP_DEFINES=dart_debug_optimization_level=0).
Review URL: https://codereview.chromium.org//393083002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38251 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-15 19:49:27 +00:00
srdjan@google.com 3d71a1fdec Another attempt to fix LLVM 4.2 failure.
Review URL: https://codereview.chromium.org//395973002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38249 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-15 18:42:12 +00:00
srdjan@google.com 9c8a395f6f More PcDescriptor cleanups, compress recors if no try index is needed (frequent).
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38242 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-15 17:07:03 +00:00
zra@google.com 1dc0e2331b Removes open arrays (e.g. data[0]) from raw objects.
Replaces them with data() methods as in RawArray.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37450 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-18 15:58:16 +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
johnmccutchan@google.com 8f0056371d Initial UserTag and dart:profiler library
R=asiva@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34949 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-10 22:32:45 +00:00
zra@google.com e8eef533d1 Prevents GC of code from intrinsified functions.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34936 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-10 18:02:46 +00:00
fschneider@google.com cc9e3b8068 Introduce a lazy-compile stub for functions.
The function's code pointer is either a lazy-compile stub
or the compiled code. The function is compiled on invocation.

There is no need to check for null when invoking a function. This means
one check less when invoking functions via a stub. For this I added a  LazyCompile
stub.

Additional cleanup in Stackmap and PcDescriptors (remove unused code pointer,
and changed smi-lengh into a raw integer).

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34643 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-02 12:37:48 +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
johnmccutchan@google.com 9d80608b9c Add Float64x2, Float64x2List, etc... with runtime and dart2js implementations
R=sra@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32196 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-31 15:28:05 +00:00
hausner@google.com 682855e8cc Ensure the debugger keeps a reference to code objects
Keep the code object in a breakpoint object rather than the
function object. This ensures that the GC can’t collect the
code object while there are breakpoints for the function.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32006 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-24 23:55:11 +00:00
regis@google.com fb6d24945f Introduce class TypeRef in the VM to fully support recursive types.
Fix issues 15244, 15148, 14869, 14000, and 13688 (was closed, but fragile).

Note that the current solution is not final as it may not be correct in more
complex cases not yet covered by language tests.
The final solution will require a 'trail' instead of a simple mark bit to
prevent operations involving recursive types to diverge.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31087 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-11 22:51:19 +00:00
zra@google.com daf539e2f9 Fixes a couple problems with GC of unoptimized code.
1. Instead of making a pass before the Marking phase,
   this change does not visit code pointers in functions
   during marking. Then after marking, if the code has
   still not been marked, code pointers in functions
   are nulled out.
2. Since code pointers in functions may be nulled out,
   functions are no longer used as proxies for code in
   deoptimization info.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30600 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-23 00:17:28 +00:00
johnmccutchan@google.com 29c01044bc This is the final breaking change in dart:typed_data needed for Dart 1.0. We need this change because the ECMAScript SIMD specification only includes Int32x4 and Int32x4List and our types must match.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29849 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 21:56:59 +00:00
asiva@google.com 9809b88c4a Fix RawObject::IsVMHeapObject to use Contains instead of relying on the mark bit.
Review URL: https://codereview.chromium.org//51253003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29572 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 17:51:36 +00:00
johnmccutchan@google.com 84c299177d Fix --gc_at_alloc
BUG=13619
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27964 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-26 17:18:10 +00:00
iposva@google.com da4806e40c - Reapply change r26880.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26933 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-30 18:01:18 +00:00
kmillikin@google.com ea5dfcd2e4 Revert "Compress memory usage. Imprive speed of finding exception handle..."
This reverts svn revision 26880.  That change has broken stack traces for
exceptions, making it impossible to use them for debugging Dart code.

BUG=https://code.google.com/p/dart/issues/detail?id=12940

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26909 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-30 11:19:22 +00:00
srdjan@google.com e8117fea14 Compress memory usage. Imprive speed of finding exception handlers: if a code does not have any handlers, do not reaverse the PC descriptors.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26880 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-29 16:47:49 +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
fschneider@google.com 0b94e4c329 Clean up VM class DartFunction.
DartFunction was the VM-internal class associated with
the Dart class "Function". It does not have any functionality
on it and therefore we don't need a VM-internal class for it.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26063 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 17:05:46 +00:00
rmacnak@google.com 303a29b5ba Move Null class out of the VM isolate.
BUG=http://dartbug.com/12071
BUG=http://dartbug.com/12128
BUG=http://dartbug.com/12319
BUG=http://dartbug.com/12337
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25982 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-09 21:54:30 +00:00
rmacnak@google.com 04e9e1fe56 Add a VM defined class VMReference as an opaque pointer for Dart code to VM internal objects.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24694 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-02 16:17:25 +00:00