Commit Graph

2925 Commits

Author SHA1 Message Date
Daniel Andersson 00ef260503 Enable concurrent optimization test after migrating scopes to Thread*
Also move static call target table allocation into old space.

Note that stats are not thread-safe, so running two compilers concurrently may lead to inaccurate stats.

BUG=https://github.com/dart-lang/sdk/issues/24109

Review URL: https://codereview.chromium.org//1291803009 .
2015-08-19 15:16:47 -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
John McCutchan 1ff7144c31 Switch to a VM wide timeline recorder
- Initialize and shutdown timeline recorder with VM.
- Allocate global blocks for timeline events without an isolate.
- Stop storing the Stream pointer inside a TimelineEvent.
- Store category name in TimelineEvent.
- Store isolate pointer in TimelineEvent.
- TimelineEventRecorder::WriteTo is full VM dump.
- Allow JSONStream to be used without an isolate.
- When a ThreadRegistry is deleted, Finish all open timeline blocks.
- PrintJSON takes a filter.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1294023009 .
2015-08-18 15:18:02 -07:00
Srdjan Mitrovic 476d18aca4 Do not generate some temporary String objects while compiling (field names extracted from getter/setter functions).
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1296403003 .
2015-08-17 17:34:37 -07:00
Daniel Andersson 76ff397c1c Migrate LongJumpScope to Thread.
This was one of the blockers for concurrent compilation (issue 24109).

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1299653003 .
2015-08-17 13:29:17 -07: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
Ryan Macnak 3851c8c0ed Add Regex isCaseSensitive and isMultiLine to the service protocol and Observatory.
BUG=http://dartbug.com/24039
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1284063003 .
2015-08-13 15:50:02 -07:00
Srdjan Mitrovic ce439a353c Trace CHA optimizations (where, when, why)
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1289933002 .
2015-08-13 13:47:34 -07:00
Siva Annamalai 228e0877a7 Use Object::null_instance and Object::null_function and do not create Handles everytime.
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1289813005 .
2015-08-13 10:57:18 -07:00
Ryan Macnak 5979d9341e Demangle library names in the service protocol.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1290563003 .
2015-08-12 12:31:08 -07:00
Siva Annamalai b6ffeafbee 1. Remove the IsRecursive check when dealing with deferred canonicalization
2. Do not try to patch type objects that are already canonical as it already has the right objects in it's object graph.

BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1279453005 .
2015-08-10 18:26:06 -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
Daniel Andersson ecccff2566 Refactor VMTagScope to Thread* rather than Isolate*.
Prepares for per-thread vm tags, but only changes the interface for now.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1284713003 .
2015-08-10 10:43:30 -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
Regis Crelier a42e6199da Relax debug check to allow for type arguments of a canonical signature type to
be bounded.

Same as lost https://codereview.chromium.org/1270093004/

Review URL: https://codereview.chromium.org//1269013003 .
2015-08-04 15:47:21 -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
Ryan Macnak 49cdeec99f Don't do C++ field guards either when --use_field_guards=false.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1255373002 .
2015-07-28 09:45:30 -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
Srdjan Mitrovic 9dbb6d488f Fix issue #23914: do not attempt to make an already immutable array immutable
BUG=23914
R=asiva@google.com, iposva@google.com

Review URL: https://codereview.chromium.org//1256763004 .
2015-07-27 16:43:13 -07:00
Florian Schneider 8d38a58c18 Make array allocation stub shared between isolates.
This allows to make the last explicitly named stubs shared between isolates.

When sharing code stubs, we can't do patching at their entry anymore.
Therefore, I had to remove patching support of the array allocation stub.
Is this a functionality we want to keep?

The change is mostly performance-neutral because optimized code has an inlined fast
path for array allocation and only uses the stub for the slow-case.

The only isolate-specific stubs left are object allocation stubs which are
associated with their Class are per-isolate.

Since this CL removes any isolate-specific stubs from StubCode, it becomes AllStatic.

BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1247783002 .
2015-07-23 12:56:16 +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
Regis Crelier 15de03e2d5 Allow super calls in mixins (for now behind a --supermixin flag).
As a consequence, allow a mixin application alias as a mixin, even if it does
not extend Object.
Add new tests.
Fix an existing test.
Update status files.

Fixes #23771

R=hausner@google.com

Review URL: https://codereview.chromium.org//1232613005 .
2015-07-17 11:32:23 -07:00
Ryan Macnak 0979a7b23e Async-step, first cut.
Also fix inclusion of internal variables from outer scopes in var descriptors.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1241673003 .
2015-07-16 13:05:37 -07:00
John McCutchan f854bd1ea3 Move update state bits under changed branch
BUG=

Review URL: https://codereview.chromium.org//1234943004 .
2015-07-16 07:34:30 -07:00
John McCutchan a92a3c8af3 Expose allocation tracing over service protocol
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org//1231603008 .
2015-07-14 11:41:57 -07:00
Florian Schneider 81deeaeedc VM: Share some stub code between isolates.
This CL also lifts the restriction that the object pool can't be used
in VM isolate code on x64 and arm64.

Stubs that perform allocation can't be shared yet, because the inline allocation
code is not yet isolate-independent. This will be added in a separate CL.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1229283002 .
2015-07-13 10:00:51 +02:00
John McCutchan 598c67001b Update Assembler::TryAllocate to support inline allocation tracing
- Track whether class allocation should be traced in existing ClassHeapStats structure.
- Emit compare and branch at top of ::TryAllocate

These changes appear to be performance neutral.

An alternative approach is to deoptimize all code that inlined allocations for a specific class. I do not think this is a good approach because we will spoil the water- allocations that aren't occurring in the (optimized steady state) running program  will appear in the allocation profile. This will make the data much less actionable bordering on misleading. The approach used in this CL will guarantee the allocation profile aligns with the actual running program.

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

Review URL: https://codereview.chromium.org//1213013002 .
2015-07-10 12:19:01 -07:00
Srdjan Mitrovic d503d2f0ed Added full deferred loading semantic to precompiled/--noopt/eager-loading code (some corner cases, e.g., compile-time errors for constants, still missing)
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org//1211273011 .
2015-07-09 10:56:55 -07:00
Daniel Andersson c089a152ac Migrate most uses of Isolate::current_zone to Thread::zone.
After https://codereview.chromium.org/1204303003/ is submitted, the last remaining uses can go.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1220193009 .
2015-07-08 09:59:32 -07:00
Daniel Andersson 3fc6fce1c0 Safer interface for heap iteration.
Address issue 21620, by sharing code to wait for concurrent sweeper to finish, and freeing the caller from this responsibility. The new public interface is Heap::Iterate*, and the old Heap::Visit* are made private, for GC use only.

(Eventually, we'll want to support iterating over the heap while concurrent GC runs, but that will have to wait until all header accesss is synchronized.)

BUG=21620
R=asiva@google.com

Review URL: https://codereview.chromium.org//1212943010 .
2015-07-07 17:20:20 -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
Ryan Macnak f84461ed48 Observatory improvements for exploring compiled code.
- Views for ObjectPool, Instructions, ICData.
 - Allow querying retained size of non-Instances.
 - References to non-Dart functions as links.
 - Find ic data array from a Function.
 - Fix NPE when current token position in a script inset cannot be mapped.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1212933003.
2015-06-26 14:29:49 -07:00
John McCutchan 48dfce84b1 Fix allocation stub switching
- When disabling the allocation stub for a class, patch the stub so that the next caller will regenerate the stub.
- Use allocation profiling to test that stub switching and regeneration works.

R=koda@google.com

Review URL: https://codereview.chromium.org//1215773002.
2015-06-26 12:35:54 -07:00
Ryan Macnak 69938db31a Include pattern and functions for RegExps over the service protocol.
Remove some quadratic behavior from processing/display of Code in Observatory, so we can actually look at 300k regexp instructions.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1208153002.
2015-06-25 12:56:59 -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
Ryan Macnak 723334d344 UI for setting/clearing closure-specific breakpoints.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1191133002.
2015-06-18 14:01:19 -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
Srdjan Mitrovic a2c1601c0a Fix crash with --noopt and no_snapshot: initialize megamorphic cache table before first code is run.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1190973003.
2015-06-17 10:08:48 -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