Commit Graph

42 Commits

Author SHA1 Message Date
Jan-Hendrik Dolling 89560c68a0 change "the the" to the 2016-10-28 21:47:50 +02:00
Siva Annamalai ee74c6207d Minor cleanup.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2250093004 .
2016-08-16 18:27:40 -07:00
Ryan Macnak dd731b4bfe Fix handle sharing bug in implementation of shape changes.
The existing tests only passed because the morphed class had the last cid.

Fixes #27077.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2253733002 .
2016-08-16 14:16:16 -07:00
Siva Annamalai 690d6d74f8 Fix for heap corruption issue when patch https://codereview.chromium.org/2225243003/ is applied.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2255553002 .
2016-08-16 13:01:10 -07:00
Florian Schneider d664003e5b Fix race in GC sweeper and isolate reload rollback.
The sweeper could see a NULL saved_class_table_.

Also, make LoadRelaxed a template function to avoid casting to uword.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2252533002 .
2016-08-15 15:50:32 -07:00
Ryan Macnak 6b5f29fb70 Reload: Don't free the saved class table while another thread may be reading it.
Fixes #27016.

R=asiva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2240283002 .
2016-08-12 16:12:25 -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 9f2a883739 Fix reload service protocol reporting
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2213753002 .
2016-08-04 09:34:04 -07:00
John McCutchan a547fd531c Propagate UnhandledExceptionErrors returned by the tag handler in Reload
TBR=rmacnak

Review URL: https://codereview.chromium.org/2205573005 .
2016-08-02 19:08:45 -07:00
John McCutchan 35146c688e Fix reload handling of unwind / stackoverflow errors
BUG=

Review URL: https://codereview.chromium.org/2201283002 .
2016-08-02 18:27:35 -07:00
John McCutchan b8500cdd2d More reload status and bug fixes
TBR=rmacnak

Review URL: https://codereview.chromium.org/2209513003 .
2016-08-02 17:26:13 -07:00
John McCutchan a6114c23cd Simplify reload error reporting
- [x] Rationalize the load failure code path.
- [x] Remove support for reload to be aborted via a callback.
- [x] If a reload fails due to an unwind error, ignore it as the isolate is dead anyway.
- [x] Move more allocations into the zone.

Review URL: https://codereview.chromium.org/2208553002 .
2016-08-02 16:11:30 -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
Ryan Macnak 25759da7bf Narrow the scope of writable code to the forwarding phase of become instead of the whole isolate reload scope.
Other operations during an isolate reload scope may create new protected code or re-protect old code.

Also, only make code writable on IA32.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2207643002 .
2016-08-02 10:19:35 -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
Todd Turnidge 248ee5227b Pay attention to exports when determine which libraries to reload.
Refactor unit testing framework functionality around imported test
libraries.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2205513002 .
2016-08-01 13:35:22 -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
John McCutchan 9c83d24622 Add --hot-reload-rollback test mode
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2200683002 .
2016-08-01 10:57:22 -07:00
Todd Turnidge 1166f83bf6 Only reload libraries when they may have been modified.
We now check all of the scripts which make up a library.  If any
script is modified, then we consider that library to be modified.  We
also consider any library which imports a modified library to be
modified.  To propagate this info efficiently, we build and discard
the imported-by graph when beginning a reload.

The embedder must provide a FileModifiedCallback in order to support
the detection of modified scripts.

In order to detect changes to package: libraries, we have modified the
embedder interface to provide the resolved url when possible, so that
we don't need to re-resolve package uris when checking for reload.
This change is incompatible and all embedders will need to be updated.

We now support a "force" flag when reloading sources.  This causes all
libraries to be reloaded regardless of whether the underlying scripts
have been updated.

Closes #26919

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2186423002 .
2016-07-29 11:23:18 -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 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
Florian Schneider 25070b85b1 Fix for use-after-free of reload context
Delete the reload context after the last use. My first attempt did not work
with our unit test framework for reload cc tests.  When running unit tests
the reload context is needed for longer, and deleted separately.

BUG=#26895
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2164703003 .
2016-07-19 18:28:56 -07:00
Zachary Anderson 43e89ccdd3 DBC: Make unoptimized static calls call through ICData
Isolate reloading works by manipulating ICData. Unoptimized
static calls won't go to the new function after a reload unless
the calls go through the ICData.

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2149993006 .
2016-07-18 10:39:09 -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
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 262dfebe67 Fix uncommon GC related reload crash
Fixes the crashes that looked like:

runtime/vm/object.h: 6185: error: expected: (value & kSmiTagMask) == kSmiTag

R=asiva@google.com

Review URL: https://codereview.chromium.org/2142913002 .
2016-07-12 10:46:10 -07:00
Todd Turnidge 62ccff992f Cache compile-time constants on the script object, sometimes.
When a script is not in the vm heap, we now cache compile time
constants on the script object itself.  During isolate reload we may
have both an old and a new version of a script being compiled at the
same time and they need to cache their constants separately.  This
also means that compile time constants from old scripts can be
collected when the script is collected, which is good.

When a script is in the vm heap, we continue to use the old system of
employing a shared per-isolate cache stored in the object store.

Closes #26833

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

Review URL: https://codereview.chromium.org/2126393003 .
2016-07-11 14:15:37 -07:00
John McCutchan 621ce4e2fd Add --hot-reload-test-mode flag to embedder and wire it up to test.py
- [x] Add --hot-reload-test-mode to standalone embedder.
- [x] Have test.py pass `--hot-reload-test-mode` instead of specific flags.
- [x] Add --reload_every_back_off flag to control exponential backof off reloads.
- [x] Add --check_reloaded flag to ensure that an isolate has reloaded at least once before exiting.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2118923002 .
2016-07-01 14:26:25 -07:00
Ryan Macnak 4e2bcf110b Reduce (debug-only) VerifyMaps from O(n^2) to O(n).
VerifyMaps in dart2js identity reload 1400-1900ms -> 80-100ms.

BUG=http://dartbug.com/26807
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2115713002 .
2016-07-01 12:38:51 -07:00
Ryan Macnak 7219cfdcac Some cleanup for become.
- Remove forced GC (probably predates use of the write barrier).
 - Remove some paranoid asserts to avoid 2 heap walks in debug mode.

Debug mode become on dart2js identity reload: 600-870ms -> 200-400ms

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2107373003 .
2016-06-30 15:43:00 -07:00
Ryan Macnak 5026d03a75 More live edit timeline events.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2105023007 .
2016-06-30 10:59:54 -07:00
John McCutchan a6aec58b6b Ensure the url provided to a library has a computed hash code
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2068813002 .
2016-06-14 14:28:00 -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 0e286e2fdd Fix library private key stability during reload
- [x] When allocating a library private key during reload, give the reload context an opportunity to provide a private key from the original library.
- [x] In identity reload mode, ensure that we pair all libraries as well as classes.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/2054833002 .
2016-06-13 12:42:17 -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
Ryan Macnak 3f8c0bb0a9 Don't overload FreeListElement for become.
R=asiva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2026643004 .
2016-06-02 10:57:34 -07:00
Todd Turnidge 9e3ac930d7 Fix tests by removing broken (and unneeded) code from isolate_reload.cc
BUG=

Review URL: https://codereview.chromium.org/1988763004 .
2016-05-17 15:32:58 -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