Commit Graph

40 Commits

Author SHA1 Message Date
Alexander Aprelev 2ad715e706 [vm/hr] Directly compare type arguments count when validate hot reload.
There might be better fix with using canonical types for comparison, we
just need to make sure we canonicalize class's type when finalizing it.

Bug:https://github.com/dart-lang/sdk/issues/32942
Change-Id: I2301a7cb91146d587893f91f2d6ee7b731ea3c62
Reviewed-on: https://dart-review.googlesource.com/54314
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-05-09 16:34:17 +00:00
Ryan Macnak fda4ab3dbf [vm] Move the info_array for ObjectPool inline.
The info_array is needed to visit an ObjectPool's pointers, requiring the compactor to move the info_array's body before forwarding the ObjectPool's pointers. Moving the info_array inline remove this constraint on the compactor.

Also saves 3 words per ObjectPool modulo allocation size rounding.

Bug: https://github.com/dart-lang/sdk/issues/30978
Change-Id: I94de0e4b7356d46fb145efee7ab14abd7473eb4c
Reviewed-on: https://dart-review.googlesource.com/27480
Reviewed-by: Erik Corry <erikcorry@google.com>
2017-12-08 20:42:51 +00:00
Siva Chandra bf096c2bb4 Copy library specific kernel binary data to VM heap.
Before this change, each function and field had its own kernel data blob
in the VM heap. With this change, the entire kernel data of a library is
stored as one single blob in the VM heap. Functions and fields store an
offset which points to the kernel data, specific to them, in that single
blob.

The pointer to the kernel data for a library is saved in two places:
1. With the library objects themselves.
2. With all the patch classes of the library.
3. With the patch classes created during hot reload.

Change-Id: Ie03e738c4d20f16056a5ef04341b75506fda9c60
Bug:
Reviewed-on: https://dart-review.googlesource.com/6601
Commit-Queue: Siva Chandra <sivachandra@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-10-09 15:03:15 +00:00
Alexander Aprelev ce427ac14f Revert "Revert "Introduce StaticCallNode::kNoRebind and use that in implicit closures.""
This reverts commit ade37f931e.

This re-lands RebindRule change with fixes for the "-mdebug--hot-reload" test failures.

Original commit is reverted in patch set 1.
Fixes are in following patch sets.

Bug:
Change-Id: I49375af9b891323fe05c670d77cbf880964aae54
Reviewed-on: https://dart-review.googlesource.com/9361
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2017-09-28 19:43:32 +00:00
Dmitry Stefantsov ade37f931e Revert "Introduce StaticCallNode::kNoRebind and use that in implicit closures."
This reverts commit 97393fd961.

TBR=aam@google.com

Change-Id: I8fc5f644e994faa20aa8b5c54f8d6227a054e39d
Reviewed-on: https://dart-review.googlesource.com/9220
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-28 08:44:48 +00:00
Alexander Aprelev 97393fd961 Introduce StaticCallNode::kNoRebind and use that in implicit closures.
Change-Id: I6219462fed278dbb90361c2084eed886c9245097

Revert "Revert "Introduce inline cache reload rule attribute to static call AST node and ICData.""

This reverts commit 162283c2f3.

This re-lands the change with original revert in Patch set 1, actual bug fix in next patch set.

Bug:
Change-Id: I6219462fed278dbb90361c2084eed886c9245097
Reviewed-on: https://dart-review.googlesource.com/8760
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-28 03:26:22 +00:00
Alexander Aprelev 162283c2f3 Revert "Introduce inline cache reload rule attribute to static call AST node and ICData."
This reverts commit 68a727fa5c.

Revert "Fix ICData::New() invocation. Follow-up to 68a727fa5cf5."

This reverts commit ac06b1c8ea.

Revert "Fix last ICData::New() invocation. Follow-up to 68a727fa5cf5."

This reverts commit da26ffc4de.

Bug:
Change-Id: Ia2d4e6a3c3a3a329982c90aded11e72bf25a9a34
Reviewed-on: https://dart-review.googlesource.com/8402
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2017-09-26 02:08:17 +00:00
Alexander Aprelev 68a727fa5c Introduce inline cache reload rule attribute to static call AST node and ICData.
Reload rule describes how inline cache has to be processed during hot reload, whether it should
be updated, reset or preserved.

Bug: dartbug.com/30639
Change-Id: I40b63ade786456ec48d4fa205a076654c2996bce
Reviewed-on: https://dart-review.googlesource.com/7586
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-25 20:18:58 +00:00
Siva Annamalai 8039138f39 Move all the isolate reload code under !defined(DART_PRECOMPILED_RUNTIME)
R=zra@google.com

Review-Url: https://codereview.chromium.org/2997243002 .
2017-08-24 09:25:55 -07:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Ryan Macnak 092eb33341 [hot reload] Give a better error message when changing between a regular class and a typedef.
Fixes #29816

R=regis@google.com

Review-Url: https://codereview.chromium.org/2926203002 .
2017-06-07 16:06:23 -07:00
Regis Crelier 23d57d28df Set correct type for enum values list (fixes #28341).
Add regression test.
Update status file.

R=hausner@google.com

Review-Url: https://codereview.chromium.org/2651813006 .
2017-01-24 15:07:01 -08:00
John McCutchan f43b48e34d Support reloading from source on top of a script snapshot.
- [x] Add arguments `rootLibUri` and `packagesUri` to the reload service rpc. These allow the uri of the root library and the .packages files to be overridden.
- [x] When pairing libraries during reload, support the base url changing.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2512483002 .
2016-11-17 11:29:12 -08:00
John McCutchan f0f32a0e29 Map deleted enum values to a sentinel value.
Fixes #27802

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

Review URL: https://codereview.chromium.org/2498863002 .
2016-11-15 14:15:36 -08:00
John McCutchan a776600362 Run field initializers for new instance fields after a reload
- [x] When performing a reload, track new fields with initializing expressions.
- [x] After a reload, run the initializing expressions for each new field on all instances of the class.
- [x] Unit tests (heart beat, throwing, and syntax errors)
- [x] Add some utility methods to Function, Field, and Script.
- [x] Fix a major bug in instance morphing and class hierarchy traversal.

Fixes #27666

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2489723003 .
2016-11-14 13:33:19 -08:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
John McCutchan ec2767eeb4 During a reload, give const fields their new values.
Fixes #27667

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2474193002 .
2016-11-03 13:01:48 -07:00
Florian Schneider fac7314c4c Preserve canonical bit of static closures on reload.
BUG=#27364
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2362693005 .
2016-09-23 13:07:16 -07:00
Ryan Macnak 7ff2dd4117 Optimize AOT's switchable calls for the monomorphic case.
The call sequence is very similar to a classic IC call, except the guarded class and the target are loaded indirectly from the constant pool instead of as immediates. In the monomorphic case, we call directly to the expected target with a class check in the callee. In the unlinked, polymorphic and megamorphic cases, we call a stub; these case are now call-through instead of call-and-return.

Every code, except stubs involved in switchable calls, includes the class check sequence at the beginning. So we now distinguish between a checked and an unchecked entry point. Generated code except the switchable call continues to use the unchecked entry point.

PC offsets are calculated relative to the beginning of the instruction stream, rather than either entry point.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2226893002 .
2016-08-12 11:18:35 -07:00
Ryan Macnak 7a12b0cb60 Fix IA32 build.
Review URL: https://codereview.chromium.org/2214313002 .
2016-08-04 17:52:52 -07:00
Ryan Macnak 19716b351a Reset most ICs by returning to the canonical empty data arrays.
We can't do this for the binary operators because they must be writable and not shared for the fast Smi op stubs to record invocation counts.

Suspected to help avoid races, see Issue #26946.

Also remove some dead code and avoid TLS.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2217733002 .
2016-08-04 17:41:03 -07:00
John McCutchan 133c087cdb Become the old E.values into the new E.values
Fixes https://github.com/dart-lang/sdk/issues/26988

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2199173002 .
2016-08-03 10:46:40 -07:00
John McCutchan ade4a6b111 Fix top level parse error reload test
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2200233002 .
2016-08-02 10:58:16 -07:00
John McCutchan 059470cf85 Make all reload zone allocations use the same zone
- [x] Use a single outer zone for all zone allocations done during a reload. This fixes an issue where we were allocating  objects in different zones that were destroyed before we expected them to be.
- [x] Rename some methods.
- [x] Made most methods on IsolateReloadContext private.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2201093002 .
2016-08-02 09:36:46 -07:00
Ryan Macnak ccaf6c6834 RELOAD: Maintain identity of static tear-offs.
R=turnidge@google.com

Review URL: https://codereview.chromium.org/2194333002 .
2016-08-01 17:44:23 -07:00
John McCutchan 501c9896c1 Refactor how we report reload results
- [x] Give the IsolateReloadContext a JSONStream.
- [x] Remove the sticky reload error from the isolate.
- [x] Print all reasons for cancelling when we fail.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/2196723002 .
2016-08-01 12:30:39 -07:00
Lars Bak b38b2f7071 Added JSON reporting to reload.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2186303002 .
2016-07-28 11:07:15 -07:00
Lars Bak a4a314251b Added use of from_.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2183703003 .
2016-07-26 11:22:40 -07:00
Lars Bak 293c6116e9 Implemented schema change for the isolate reload operation.
I'll add more tests to isolate_reload_test.cc while waiting for the first round of comments.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2179983002 .
2016-07-26 11:13:28 -07:00
John McCutchan c692a64e5a Rework how enums are implemented and reloaded
- Enum instances now hold their index and their label. Before the labels were held in a static array to the side and the index was used to look up the label.

- Before and after reload enum instances are now paired (by label) and put into the 'become' table.

Fixes https://github.com/dart-lang/sdk/issues/26877

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2153143002 .
2016-07-15 10:52:20 -07:00
Ryan Macnak 69be2c8b57 Implement rebinding super calls after hot reload.
BUG=http://dartbug.com/26884
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2147293002 .
2016-07-14 14:20:44 -07:00
Todd Turnidge 77b99396e8 Disallow deferred loading when using isolate reloading.
Update status files.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2144113002 .
2016-07-13 15:25:06 -07:00
John McCutchan e8a214bc67 Fix language/enum* hot reload failures
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2142013002 .
2016-07-12 10:42:45 -07:00
John McCutchan 51ace86544 Bug fixes for hot reload
- [x] Report the reload error synchronously from the _reloadSources RPC.
- [x] Add sticky reload error to an isolate so we can report the error.
- [x] Remove redundant 'OnStackReload'.
- [x] Fix a bug where a class could have a field added but we wouldn't reject it.
- [x] Add unit test for above bug fix.
- [x] Enable reload via the service protocol with a live stack.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2070873002 .
2016-06-16 11:02:35 -07:00
John McCutchan c0eb4d9dc0 Remember inside an ICData if it is for a static call or an instance call
- [x] Add an is static call bit to ICData
- [x] Rewrite the reset ICData iterators to rely on that bit rather than the function's ic data map

BUG=

Review URL: https://codereview.chromium.org/2064693003 .
2016-06-13 13:23:57 -07:00
John McCutchan 77e0e96b5f Revert "Remember inside an ICData if it is for a static call or an instance call"
I accidentally committed an old version of this CL.

This reverts commit 9256d49af5.

BUG=

Review URL: https://codereview.chromium.org/2062983002 .
2016-06-13 13:19:38 -07:00
John McCutchan 9256d49af5 Remember inside an ICData if it is for a static call or an instance call
- [x] Add an is static call bit to ICData
- [x] Rewrite the reset ICData iterators to rely on that bit rather than the function's ic data map

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2044423003 .
2016-06-13 13:09:48 -07:00
John McCutchan 4d5ad08d11 Enable on stack reload in standalone embedder
- [x] Implement Isolate::OnStackReload
- [x] Now that we don't invoke Dart code during loading, stop blocking class finalization during loading

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2049833002 .
2016-06-08 11:00:31 -07:00
Siva Annamalai 5de775a823 - Canonicalize generic types in a global isolate hash
table, this ensures that we do not linearly walk through
  a large type list in the class calling the expensive
  'Type::Equals' method (some applications have close to
  1304 generic types in them)

- Use the stand hash table implementation for TypeArguments
  canonicalization instead of a custom hash table

R=johnmccutchan@google.com, regis@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1965493004 .
2016-05-17 14:35:23 -07:00
John McCutchan 48c8ffa7f3 Initial isolate reload support
This is a cut of the work that Todd and I collaborated on in the reload branch.

In this CL, we've dropped the loader port hacks, in other words, on stack reloading in the standalone embedder does not work yet.

- [x] Support for hot reloading of isolate source code
- [x] Unit test harness and many tests
- [x] Service protocol and Observatory support
- [x] Product build does not include support for hot reloading.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1965823002 .
2016-05-17 12:19:06 -07:00