Commit Graph

382 Commits

Author SHA1 Message Date
Srdjan Mitrovic edccf3af0a Cleanup: we are not patching entries any longer
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1376963002 .
2015-09-30 10:22:59 -07:00
Florian Schneider fe8bda5c4d VM: Handle null-case when running with --trace-ic.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1369703003 .
2015-09-28 11:09:36 +02:00
Ryan Macnak fcdd855859 Precompile invoke-field-dispatchers for closures.
Improves precompiled DeltaBlueClosures by 8.6x and increases
instructions size by 0.05% (0.0005) on ARM.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//1371453002 .
2015-09-24 17:19:37 -07:00
Todd Turnidge 66f9abc7e3 Refactor isolate interrupts to use OOB messages instead of interrupt bits.
Closes #24349

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1344993002 .
2015-09-23 12:13:25 -07:00
Florian Schneider bac82e2592 VM: New calling convention for generated code.
Instead of calling code object directly, call indirectly and
pass the code object in a register. The object pool is then loaded from
the code object. This is another preparation step for making generated code
relocatable.

All non-ia32 platforms:
No entry patching.

ARM:
PC marker (now code object) moves to the same place as on x64 (below saved PP, above saved FP).
R9 is now used as PP, R10 as CODE_REG.

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

Committed: https://github.com/dart-lang/sdk/commit/1d343e5a7b75168fb6c9f86b64c55173cdbdc9b2

Review URL: https://codereview.chromium.org//1192103004 .
2015-09-19 13:21:09 +02:00
Florian Schneider 7af7a2db87 Revert "VM: New calling convention for generated code."
This reverts commit 1d343e5a7b.

Because of Windows test failures.

BUG=
TBR=whesse@google.com

Review URL: https://codereview.chromium.org//1343373003 .
2015-09-16 13:46:05 +02:00
Florian Schneider 1d343e5a7b VM: New calling convention for generated code.
Instead of calling code object directly, call indirectly and
pass the code object in a register. The object pool is then loaded from
the code object. This is another preparation step for making generated code
relocatable.

All non-ia32 platforms:
No entry patching.

ARM:
PC marker (now code object) moves to the same place as on x64 (below saved PP, above saved FP).
R9 is now used as PP, R10 as CODE_REG.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1192103004 .
2015-09-16 13:05:58 +02:00
Ryan Macnak 491b1d42f8 Reapply "Move megamorphic cache table into the Dart heap."
Prevent megamorphic miss function from losing its code:
 - Only include megamorphic function in precompiled snapshots.
 - Also put the megamorphic miss code in the object store.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1339363002 .
2015-09-15 11:18:43 -07:00
Ryan Macnak 33b037125f Revert "Move megamorphic cache table into the Dart heap."
We're somewhere attempting to recompile the megamoprhic miss function.

Review URL: https://codereview.chromium.org//1334283004 .
2015-09-14 17:54:43 -07:00
Ryan Macnak 3068f1e092 Move megamorphic cache table into the Dart heap.
R=asiva@google.com

Review URL: https://codereview.chromium.org//1346473002 .
2015-09-14 17:11:55 -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
Daniel Andersson a1bc527306 Migrate logging infrastructure Isolate->Thread
This enables thread-safe logging (e.g., ISL_Print, which will soon be renamed to THR_Print), which is needed for concurrent
marking (DetachCode) and compilation.

Make finalization of GC marking tasks concurrent, now that it's thread-safe.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1314673008 .
2015-09-09 15:30:38 -07:00
Siva Annamalai 141d0913e9 Add a print statement for recompilations.
BUG=

Review URL: https://codereview.chromium.org//1315863004 .
2015-08-31 13:19:09 -07:00
Ivan Posva 3ff350ed09 - Clarify the order of setting the interrupt bit and posting a message in
Dart_InterruptIsolate.

BUG=

Review URL: https://codereview.chromium.org//1290893006 .
2015-08-20 19:26:25 -07:00
Lasse R.H. Nielsen 1b8f3fba14 Make List constructor give better error messages for non-int arguments
BUG= http://dartbug.com/15986
R=herhut@google.com, iposva@google.com, sra@google.com

Committed: https://github.com/dart-lang/sdk/commit/33c76638268e3e24fb7a73a8f6f141f38272e8dd

Review URL: https://codereview.chromium.org//1214723009 .
2015-08-17 13:01:13 +02:00
Lasse R.H. Nielsen 51fa195f16 Revert "Make List constructor give better error messages for non-int arguments"
There are VM-only tests that assume exact text of failure.

BUG=

Review URL: https://codereview.chromium.org//1294483003 .
2015-08-14 15:05:17 +02:00
Lasse R.H. Nielsen 33c7663826 Make List constructor give better error messages for non-int arguments
BUG= http://dartbug.com/15986
R=herhut@google.com, iposva@google.com, sra@google.com

Review URL: https://codereview.chromium.org//1214723009 .
2015-08-14 13:44:19 +02:00
Daniel Andersson bc149bf2f5 Migrate most uses of StackZone(Isolate*) to Thread*.
Also migrate some HANDLESCOPE uses.
This prepares for concurrent compilation.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1285293004 .
2015-08-13 13:11:30 -07:00
Ryan Macnak e8320e4081 Adjust implementation of the hash-closurization to work with --no-lazy-dispatchers.
R=hausner@google.com

Review URL: https://codereview.chromium.org//1269143003 .
2015-08-04 16:11:55 -07:00
Daniel Andersson 500eb6d79d Safepoint interface and unit tests.
Add infrastructure to enable all threads in an isolate to rendezvous at GC-safe points, and exercise it through unit tests.

* Use existing interrupt mechanism for Dart threads, but a cooperative approach for non-Dart threads (concurrent compiler, etc.): they must periodically call CheckSafepoint (may block).

* Add unit tests to exercise and verify various scenarios: organizing the rendezvous from helper/main thread, with/without Dart code executing, etc.

The next step is to use this interface in old-space allocation and garbage collection, respectively, to allow helper threads to perform allocations that potentially trigger GC (needed for concurrent compiler).

Limitations:

* A thread that is executing a long-running native function is currently not considered at a safepoint, and will delay the rendezvous until it returns to Dart or indirectly calls CheckSafepoint. In a future CL, we can use the saved stack pointer to detect and support this case, and intercept the thread if/when it re-enters Dart or the VM.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1259223005 .
2015-07-31 19:53:14 -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
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 66194d4fc1 Port "Add flag to disable lazy compilation of invocation dispatchers."
Fix InvokeNoSuchMethodDispatcher to propagate with a rethrow instead of a throw.

Fix unit test checking raw stack frames.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//1191813002.
2015-06-18 10:23:39 -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
Ivan Posva f5e3f94019 Fix http://dartbug.com/23578:
- Complete revamp of isolate-specific flags.
- Associate flags with the isolate on creation.
- Dart_CreateIsolate and associate callback do take an
  extra flags argument.
- Make sure to clear IC data array when clearing code.

BUG=23578

Review URL: https://codereview.chromium.org//1162033005
2015-06-07 17:57:34 +02:00
Srdjan Mitrovic ed73a3d151 With --noopt run unoptimized code through optimizer, more optimizations can be done later.
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1149713002
2015-05-28 10:05:46 -07:00
Daniel Andersson 6542a451c3 Refactor Isolate -> Thread in NativeArguments and exception handler jump.
Further reduces the one-to-one assumption about isolates and threads: native entries now ask the thread for its isolate, rather than the other way around.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//1156143003
2015-05-26 16:49:51 -07:00
srdjan@google.com 3ac643115f Remove unneeded flag declaratiosn (enable_type_checks, enable_asserts).
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45647 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 16:48:43 +00:00
iposva@google.com a1854d45ac Fix http://dartbug.com/23290
- Ensure that we do have unoptimized code available when generating
  coverage information.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45419 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-24 23:31:15 +00:00
koda@google.com ce40dfd81e Fix List length size check; add test.
Ensures that we throw an exception rather than exit the VM (FATAL).

BUG=dart:23227
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45223 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 00:34:44 +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
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
fschneider@google.com 9709db7f76 VM: Add infrastructure to support deferred generation of unoptimized code.
Add deferred deoptimization instructions for return address, pc marker and
object pool pointer. This enables generating unoptimized code lazily
on deoptimization.

This CL does not change the way unoptimized code is generated or collected
yet, but just provides the mechanisms needed. This can be used to allow
code GC for the unoptimized code of optimized functions.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44934 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-07 12:32:22 +00:00
koda@google.com 92a8c39d3c Keep zone cached in SnapshotReader to allow removing ZoneHandle(Isolate*) interface.
Add a StackZone around API snapshot reading call.
Also remove CheckedHandle(Isolate*) interface by migrating its users to Zone*.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44580 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-19 17:42:40 +00:00
koda@google.com 9c181ec6d5 Thread/Isolate refactoring: new(Isolate*) -> new(Zone*)
Refactor all remaning cases where the current zone is used through new(Isolate*) and remove this interface.

Removing this interface is needed to move towards multiple threads per isolate, and also makes the caller more aware of the scope of the zone used, reducing the risk of use-after-free.

Make the current thread and the stack zone created around native/runtime entries directly available in their body, saving an indirection (and optimized away if unused).

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44541 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-17 19:24:26 +00:00
iposva@google.com 5ce27dc200 - Remove stale code.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44342 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-09 20:29:14 +00:00
iposva@google.com 7d1785e760 - Allow any implementation of StackTrace to participate in async/
await exception handling.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43880 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 16:17:19 +00:00
koda@google.com 4c74036e9b To satisfy ASAN, use stub instead of & operator to get C++ stack pointer.
Because of initialization order, this requires slightly different paths for VM isolate and others.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43865 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 04:58:08 +00:00
iposva@google.com 6898a10c93 - Make sure to fail early if an non-stacktrace is passed into the VM
where we expect one.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43546 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-06 09:23:57 +00:00
zra@google.com 1299ad1485 Allows turning on checked mode on a per-isolate basis
using the embedding API.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43481 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 18:32:48 +00:00
fschneider@google.com d9be656941 VM: Share closure-call dispatchers.
Instead of caching these in each signature class,
cache them in the common super-class of all closures (_FunctionImpl)

This avoid unecessary polymorphism when invoking.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43336 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-30 13:06:11 +00:00
rmacnak@google.com 7322f1f37b Rename DeoptimizeAll to DeoptimizeFunctionsOnStack.
To avoid confusion with operations related to live modification that really do touch all functions.

BUG=
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43303 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 17:45:54 +00:00
zerny@google.com c77ab72c54 Use a typed array for the irregexp stack.
BUG=
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43039 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-21 15:11:36 +00:00
zerny@google.com 5c04899198 Define a lower threshold for optimizing irregexp generated functions.
The threshold is given by the flag --regexp_optimization_count_threshold
and has a default value of 1000.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42632 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-06 13:56:21 +00:00
iposva@google.com 577242dbd4 - Implement Isolate.kill.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42355 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-13 00:39:16 +00:00
hausner@google.com 392db8d312 Implement correct semantics of Boolean Conversion
When converting null to a boolean value, throw an AssertionError
rather than a TypeError.

This is the same change as r42145, with added co19 status updates.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42170 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 18:51:48 +00:00
hausner@google.com 4cfdf02012 Revert r42145 to fix co19 tests
Review URL: https://codereview.chromium.org//772513003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42148 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-05 21:05:38 +00:00
hausner@google.com ad837a0d9f Implement correct semantics of Boolean Conversion
When converting null to a boolean value, throw an AssertionError
rather than a TypeError.

Fixes issue 21279.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42145 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-05 20:36:37 +00:00
fschneider@google.com b26ff22adf Allocation sinking for contexts.
Improved aliasing computation in presence of Redefinition and AssertAssignable.

Added possibility for inlining annotations via --enable-inlining-annotations flag.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41713 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-13 13:53:58 +00:00
vegorov@google.com e6113cc0f5 If bounds check 0 <= index < length is not redundant we attempt to
replace it with a sequence of checks that guarantee

          0 <= LowerBound(index) < UpperBound(index) < length

and hoist all of those checks out of the enclosing loop.

Upper/Lower bounds are symbolic arithmetic expressions with +, -, *
operations and are computed based on discovered simple induction variables.

Simple induction variable is a variable that follows the pattern v1 <- phi(v0, v1 + 1)

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40969 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 18:50:29 +00:00