Commit Graph

358 Commits

Author SHA1 Message Date
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
fschneider@google.com 52239e118e Don't perform OSR on intrinsified methods.
Some non-native methods have intrinsic code (e.g. in Bigint)
and can't be entered via OSR.

BUG=dartbug.com/21186
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40838 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-01 14:50:06 +00:00
koda@google.com 60b12996ec Track references to allocation stubs via static_calls_table, instead of keeping two referencers alive.
(Verbatim copy of srdjan's https://codereview.chromium.org/609893002/ )

TBR=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40738 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-26 20:17:53 +00:00
koda@google.com 667454a233 Support old-space allocation in generated code (bump block only for now).
First steps towards general pretenuring support.
* Generalize Heap::Top/EndAddress.
* Add testing flag to exercise new code paths.
* Also update the slow-case runtime calls, to ensure a fresh block will be allocated in old.

Next steps are general invalidation of the generated code and adding a policy that doesn't blow up the store buffers), and freelist allocation.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40530 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 23:46:22 +00:00
srdjan@google.com 4bb01949bc Fix to allocation stub invalidation: we cannot just remove it as it will be collected even though code still may reference it. Since we should probably have two different allocation stubs, keep two in the class and switch between them. Future work will put intelligence in the allocation stub selection. Added Daniel's test flag & code.
R=koda@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40327 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 17:01:17 +00:00
srdjan@google.com dd9c0ef25e Allow invalidation and recompilation of instance allocation stubs. Requested in order to implement better pretenuring strategy.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40168 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 17:56:42 +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
fschneider@google.com 0469c12072 VM: Remove unused IsClosureCall bit from IC data.
Since closure calls are now implemented in terms of instance calls
 (via .call and a dispatcher method), there is no need for a bit in
  the IC data tracking if a IC call may be a closure call.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39979 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 17:10:59 +00:00
fschneider@google.com e2443c0ef2 VM: Clean up generated code for NoSuchMethod invocation of closures.
Remove unnecessary ic-data argument from the runtime function that
invokes noSuchMethod for closures.  This reduces the size of generated
code for closures.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39804 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 12:51:28 +00:00
asiva@google.com ac6b6f8fe4 Use PassiveObject were possible.
Review URL: https://codereview.chromium.org//512933002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39687 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-29 00:22:16 +00:00
fschneider@google.com 937726a0aa Improve polymorphic inlining of int/int double/double operations.
I added inlining of the native Double methods _add, _sub, _mul and _div and fromInteger
and unified the method recognition of the MethodRecognizer and the Intrinsifier classes.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39446 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 11:13:44 +00:00
hausner@google.com 0bbf6c5b16 Runtime support for evaluation of static field initializer expressions
Eliminates the generation of field initializer functions by the parser.
Adds a runtime call that creates a one-shot function to evaluate the
initializer of a static field. The runtime function gets called from
the implicit static getter function for the field.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39387 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 21:53:44 +00:00
vegorov@google.com 00daaa6106 Don't assign safepoint at the definition to the definition's live-range.
This avoids treating spill slot associated with the definition live during GC as
it will only be filled in after definition's code is fully executed.

Additionally this makes output register dead for GC inside the definiton itself
which is something we used to guarantee manually by removing it from the
live_registers set before calling on the slow path.

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38059 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-08 14:12:00 +00:00
regis@google.com 32f3e11d99 Cleanup of error and warning reporting.
R=hausner@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37468 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-18 22:30:34 +00:00
rmacnak@google.com 7ce5c53f0b Pass around the current isolate in exception handling code.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37409 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-17 18:17:03 +00:00
srdjan@google.com 3480ac4a0e Fix deferred library code disabling for inlined functions.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37107 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-06 22:14:40 +00:00
srdjan@google.com 905d0d86bf Increase optimization threshold since unoptimized code runs faster. Faster startup time, no measurable performance degradation.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37091 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-06 18:13:15 +00:00
vegorov@google.com 4e286b316f Split GuardField into GuardFieldType and GuardFieldLength instructions.
Record expected length offset that matches guarded_cid.

This greatly simplifies code generation and control flow inside these guards.

Fixes the bug that was causing unoptimized code to call into runtime even when guard did not fail.

Add --trace-field-guards flags to trace updates to the state of guarded fields' properties.

BUG=http://dartbug.com/19003
R=fschneider@google.com, johnmccutchan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36872 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-02 13:53:53 +00:00
srdjan@google.com dec3af813b Emit intrinsified code even if optimziation is turned off.
Also remove unsued flag —report-usage.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36529 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-22 21:30:05 +00:00
iposva@google.com b4b4889406 - Refined https://codereview.chromium.org/293963008/
Make compilation VM more fine grained

- Use the isolate where appropriate.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36451 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 21:04:03 +00:00
hausner@google.com d5807cf221 Fix code invalidation of functions with references to deferred libraries
When a code object with a reference to a deferred library prefix is
invalidated, it must be removed from the function object, and also
patched so that direct calls to it (from optimized code for example)
will trap and redirect to the newly compiled code.

Removing an overly eager assertion.

This fixes bug 18909.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36436 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 16:06:41 +00:00
fschneider@google.com 17385b30cf Fix issue 18834. Collect stack trace before the frame is prepared for OSR.
Otherwise there is a mismatch between PC in the frame and the PC marker.

R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36413 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 09:33:30 +00:00
srdjan@google.com 14ce525d79 Recognize List. constructor and turn it inot CreateArray.
R=johnmccutchan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36138 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-13 23:09:22 +00:00
regis@google.com dec11d8b7b Add support for javascript incompatibility warnings (work in progress).
For now, warnings are only issued when applicable for type tests, type casts,
and toString.
Fix newly reported lint errors.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36001 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-09 22:42:10 +00:00
zra@google.com 842a42a5a9 Adds unary double operations to ARM64, enables many tests.
Also removes disabling of optimization.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35863 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-07 20:04:05 +00:00