Commit Graph

2008 Commits

Author SHA1 Message Date
Siva Annamalai 79ef28317f Changes to prepare for allowing script snapshots to be taken after running the main application:
- Rename accessors of class Field to make it more apparent as to what is being accessed (static field values or instance field offsets
- Use precompiled initializer state (Used only during precompilation) to also store saved initial value of static fields (Used only during application snapshot   generation)

BUG=
R=hausner@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org//1289643005 .
2015-09-04 11:03:46 -07:00
Srdjan Mitrovic d4365bc6f4 Lookup getter/setter symbols before alllocating them, thus eliminating extra String allocations in new space.
Various old space allocations, cleanups.
Add a test for Symbols concatenation.

BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1320673012 .
2015-09-03 14:09:34 -07:00
Ryan Macnak 0ed4d44a99 Toward precompiled snapshots.
Gets as far as encountering null Instructions in the first Dart_Invoke after loading the snapshot.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1318803002 .
2015-09-02 16:15:02 -07:00
Srdjan Mitrovic df29a93b0d Fix Dartium by supporting external strings as well in Symbols::FromConcatAll
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1323063004 .
2015-09-02 11:25:19 -07:00
Srdjan Mitrovic 7fb555045a Remove allocation in old space ....
Eliminate need for GrowableObjectArray, allocate constants in old space.

BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1305223006 .
2015-09-02 08:59:33 -07:00
Srdjan Mitrovic 59db5010a9 More elimination of new space allocation, fix bugs in Symbols::FromConcatAll
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1322043002 .
2015-09-01 10:30:03 -07:00
Siva Annamalai 52c2319d48 Changes to prepare for allowing script snapshots to be taken after running the main application
- Update usage counter to optimization threshold or 0 depending on whether optimized code exists for the Function
- Do not serialize the resolved names cache and loaded scripts cache when doing script snapshots

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1329503002 .
2015-08-31 16:36:23 -07:00
Siva Annamalai 6b2ae767fd Changes to prepare for allowing script snapshots to be taken after running the main application
- Create singleton empty context scope object
 - Add an implicit field in the context scope so we can distinguish implict context scope objects
 - Allow serialization of extractor_parameter_types, extractor_parameter_names

BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1323813004 .
2015-08-31 15:41:41 -07:00
Todd Turnidge 7ac3150ee3 Improve display of simd vector types and stack traces in Observatory.
Associated protocol changes.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1316123004 .
2015-08-31 10:35:01 -07:00
Srdjan Mitrovic dd5410209f Added {Zone}GrowableHandlePtrArray types: simplifies code, makes code safer
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1312833009 .
2015-08-31 09:24:00 -07:00
Srdjan Mitrovic f857c1ba8e Remove more GrowableObjectArray usage in parser
Allocate appropriate data structures in old space from beginning

BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1316373002 .
2015-08-27 13:46:32 -07:00
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
Srdjan Mitrovic 42f32322cb Change trail from GrowableObjectArray to ZoneGrowableArray.
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1309113004 .
2015-08-27 09:56:36 -07:00
Matthias Hausner 62e9d05668 Introduce per-isolate cache for compile time constants
Compile-time constant values are maintained in a cache, keyed
by script and token position. When the same code is compiled
again later, e.g. by the optimizing compiler, the value is
found in the cache and does not need to be computed again.

In this version, the key is a string concatenated from the
script url and the token position. That’s probably more overhead
than we want.

Added two compiler stat counters for number of cached constants
and number of cache hits. Running dart2js to compile a hello world
program results in about 1400 cached values and 85 cache hits.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1308073005 .
2015-08-26 16:17:20 -07:00
Srdjan Mitrovic b5c256b85f Use zone allocated C-strings instead of String heap objects to construct signature symbols
BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1313363005 .
2015-08-26 13:30:55 -07:00
Regis Crelier 26031ab6b0 Avoid numerous type allocations by caching the canonical type of a class, which
is used as the receiver type for non-static methods of this class, be it a
generic, non-generic, or signature class.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//1309613002 .
2015-08-21 13:37:07 -07:00
Florian Schneider 2e24b091ff VM: Remove dead code from arm/mips/arm64 call instruction patterns
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1304743003 .
2015-08-21 09:44:24 +02:00
Florian Schneider b5966db69e VM: Clean up and fix bugs in instructions patterns
Fix bug in DecodeLoadWordFromPool: used Array::element_offset instead of ObjectPool::element_offset.
This only worked because they accidentally return the same value.

Remove virtual methods from InstructionsPatterns on ia32 and x64. Instead use a template for code reuse.
This avoids among others vtables for the *Pattern classes and saves >= 4K in VM binary code size.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1301963003 .
2015-08-21 09:31:36 +02:00
Ryan Macnak 7055e4862b Toward precompiled snapshots.
R=asiva@google.com, fschneider@google.com

Review URL: https://codereview.chromium.org//1290933002 .
2015-08-19 15:34:17 -07:00
Daniel Andersson 6636b92090 Only test optimizing compilation in helper thread compilation test.
Also fix a couple of old handles (leaving the bulk of them for a separate CL).

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1302623002 .
2015-08-19 09:42:56 -07:00
Florian Schneider 858f1d811a VM: Cache instructions entry point in RawFunction/RawCode.
This make calling sequences shorter and faster, at the expense of an extra
word in the code object and the instructions object.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1295823003 .
2015-08-19 10:04:39 +02:00
Ryan Macnak 38eb6cbd4f Store the RegExp and the string specialization cid in an Array in RawFunction::data_.
No change in Function size due to alignment round up.

R=regis@google.com

Review URL: https://codereview.chromium.org//1295973002 .
2015-08-14 16:01:10 -07:00
Ryan Macnak 294c6a47a4 Add ObjectPool tag for external labels. Use LoadExternalLabel for native calls and the predefined symbols table.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1295693002 .
2015-08-14 10:10:34 -07:00
John McCutchan ec675a3b0d Enable allocation tracing for classes owned by vm isolate
- Don't store the allocation tracing toggle bit in the class.
- Make sure that array and context slow path stubs are added to the code object's static call table.
- Add missing MaybeTraceAllocation to context allocation stub.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//1292723002 .
2015-08-14 06:55:05 -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
Srdjan Mitrovic 8cee9ac89d Change heuristic to determine which fields contain modifieable double boxes: do it if field was initialized with a double constant. Fix a parser bug
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1278003002 .
2015-08-07 09:16:02 -07:00
Ryan Macnak b34267d0d7 Replace is_synthetic bit on Fields with is_reflectable. Mark private fields of dart:* as non-reflectable.
This fixes an inconsistency in mirrors where some classes in dart:* would claim to have a field but throw NSM if one attempts to access it, and prevents accessing private static fields of dart:* that don't have implicit getters or setters.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1280713002 .
2015-08-06 16:48:01 -07:00
Ryan Macnak 5ea1f9eb39 Initial tree-shaking for precompilation: only selective compilation, no removal of unused Functions/Classes.
hello world 23.1 -> 8.1 MB heap

R=fschneider@google.com

Review URL: https://codereview.chromium.org//1259123009 .
2015-08-04 11:35:36 -07:00
Matthias Hausner 4ebab25d8f Implement constructor closures
One detail that isn't implemented yet is canonicalization of constructor tear-offs. At the moment, two tear-offs of the same constructor result in closures that are not equal.

BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1255063005 .
2015-08-03 15:50:46 -07:00
Ryan Macnak 8a3e134502 Non-tree-shaking --precompile.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1261673004 .
2015-07-30 15:29:19 -07:00
Srdjan Mitrovic cc1b7f0c3e Fix inlining information:
Missing caller inlining id chain left the inlining chain truncated and incorrect.
Added full mapping: inlining-id to caller-inlining-id.

Remove fix from https://codereview.chromium.org/1259243005/

Added some of changes from https://codereview.chromium.org/1260163006/

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1268783002 .
2015-07-30 14:47:32 -07:00
Siva Annamalai 325f40d9db Fix for bug 21079
Implement patch records to patch canonical objects.

BUG=21079
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1255003004 .
2015-07-30 10:24:13 -07:00
Florian Schneider f8670e8f84 VM: Hoist handle allocation out of loop when creating the object pool.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1253373002 .
2015-07-28 10:23:33 +02:00
Daniel Andersson fc8286ae71 Migrate NoSafepointScope to Thread, so that helper threads can successfully call Heap::Allocate (but only for old space).
Safepointing is not yet implemented, so helper threads can only allocate when growth control is off and no Dart code is running. But extend unit test to ensure this code path remains exercised as more functionality is added.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1250463004 .
2015-07-22 15:09:54 -07:00
Matthias Hausner f1da09741d Implement tear-off closure operator #
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1234883005 .
2015-07-22 12:50:36 -07:00
Ryan Macnak d1475c0356 Port irregexp bytecode compiler and interpreter from V8 r24065.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1201383002 .
2015-07-07 14:43:32 -07:00
Srdjan Mitrovic 5711c13f69 Make frequent type checks (instanceof) faster by adding dedicated instanceof methods; improves dart2js startup
There is a possibility of adding intrinsics for all new instanceOf methods; my measurements did not show any benefits, therefore they were removed from this CL.

BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1222863003 .
2015-07-07 10:20:41 -07:00
Srdjan Mitrovic c0b359db6c Intrinsic version of Object.runtimeType
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1217323002.
2015-07-01 10:13:14 -07:00
Ryan Macnak 40fcf4a72d Handle field-invocation and method-extraction in the runtime when --lazy_dispatchers=false.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1195573006.
2015-06-30 15:14:35 -07:00
John McCutchan 26b5b2e95b Introduce mechanism to record an allocation of a class
- Use a bit in RawClass to remember if we are tracing allocation for this class.
- Add Profiler::RecordAllocation
- Add a simple heartbeat test for Profiler::RecordAllocation

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1211633002.
2015-06-24 13:41:12 -07:00
Ryan Macnak 44d9f60dbf Port "Add snapshoting methods for code's metadata."
Adjust for field removed from PcDescriptors.

Add SnapshotReader/Writer::allow_code().

R=srdjan@google.com

Review URL: https://codereview.chromium.org//1188973003.
2015-06-19 10:31:37 -07:00
Zachary Anderson fcd4c59430 Fixes crashes in VM isolate shutdown.
If null is not initialized before the VM Isolate's ObjectStore, the
ObjectStore's fields are initialized to kHeapObjectTag, which causes
a crash in VM Isolate shutdown.

There is also a crash when the VM Isolate is signaled with the
shutdown event, so this CL removes adding a Debugger to the
VM Isolate, so that there is no need to shut it down, and send
the signal.

NB: This change does *not* actually enable shutdown. It just fixes
crashes that would happen if it were enabled.

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

Review URL: https://codereview.chromium.org//1168933002.
2015-06-17 10:14:18 -07:00
John McCutchan c7187924a9 Initial Timeline Events
- Each isolate has its own TimelineEventBuffer
- Each isolate has TimelineEventStreams for API, Compiler, Embedder, Isolate, and GC
- Compiler, Isolate, Embedder, and GC are being inserted into the stream
- Basic unit tests
- Dart API for injecting timeline events
- Arbitrary number of native and Dart arguments can be attached to each event
- JSON printing
- Output can be loaded by about://tracing
- Add --timeline-trace-dir flag

Short term follow up CLS:
- Service protocol requests to enable / disable tracing and retrieve a trace
- UI for Observatory
- Dart code EventStreams and Events

R=asiva@google.com

Review URL: https://codereview.chromium.org//1170503004.
2015-06-16 10:10:14 -07:00
Daniel Andersson 24c51b4eea Assert typed data is external iff actually not in heap.
BUG=
R=asiva@google.com, fschneider@google.com

Review URL: https://codereview.chromium.org//1182103003.
2015-06-16 05:32:28 -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 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
Ryan Macnak 304382c1b4 Add TypedData instance kinds.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1157003003.
2015-06-08 17:30:11 -07:00
Siva Annamalai da0363172a Fix for issue 192 in domokit/mojo
Serialize Mint objects as is and at the receving side convert them to Smi or Mints depending on the target architecture.

BUG= 192 from domokit/mojo
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1151573022
2015-06-05 14:45:17 -07:00
Todd Turnidge 1b59b9ea06 Service cleanups...
- Allow for multiple breakpoints in the service protocol.
  The info isn't actually provided or used yet.
- Drop index for list elements returned by the protocol.  Flatten structure.
- Drop index for context elements.  Keep sub-structure so we
   can choose to add extra slot info later.
- Errors now have ids and kinds.
- exception and stacktrace move from @Error to Error.
- All heap Objects now include class/size.
- Changed BoundedType.type and TypeRef.type to different names.
  Turns out we already have a "type" property that conflicts.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1152753005
2015-06-04 09:09:22 -07:00
Ryan Macnak a754930be6 Remove unused field map_ from LinkedHashMap::Iterator.
TBR=koda@google.com

Review URL: https://codereview.chromium.org//1162363003
2015-06-02 12:33:28 -07:00