Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Issue 2996843002: Add IncrementalKernelGenerator.acceptLastDelta()/rejectLastDelta(). (Closed)

Created:
3 years, 4 months ago by scheglov
Modified:
3 years, 4 months ago
CC:
reviews_dartlang.org, dart-fe-team+reviews_google.com
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 11

Patch Set 2 : Fixes for review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -12 lines) Patch
M pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/front_end/lib/incremental_kernel_generator.dart View 1 5 chunks +29 lines, -8 lines 0 comments Download
M pkg/front_end/lib/src/incremental_kernel_generator_impl.dart View 5 chunks +37 lines, -4 lines 0 comments Download
M pkg/front_end/test/incremental_kernel_generator_test.dart View 12 chunks +52 lines, -0 lines 0 comments Download
M pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart View 1 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
scheglov
3 years, 4 months ago (2017-08-10 17:47:11 UTC) #1
Paul Berry
lgtm https://codereview.chromium.org/2996843002/diff/1/pkg/front_end/lib/incremental_kernel_generator.dart File pkg/front_end/lib/incremental_kernel_generator.dart (right): https://codereview.chromium.org/2996843002/diff/1/pkg/front_end/lib/incremental_kernel_generator.dart#newcode57 pkg/front_end/lib/incremental_kernel_generator.dart:57: /// Each invocation of [computeDelta] must follow by ...
3 years, 4 months ago (2017-08-10 18:03:39 UTC) #2
Siggi Cherem (dart-lang)
lgtm with some suggestions below https://codereview.chromium.org/2996843002/diff/1/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart File pkg/front_end/lib/src/incremental_kernel_generator_impl.dart (right): https://codereview.chromium.org/2996843002/diff/1/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart#newcode81 pkg/front_end/lib/src/incremental_kernel_generator_impl.dart:81: throw new StateError( question: ...
3 years, 4 months ago (2017-08-10 18:31:15 UTC) #3
scheglov
Committed patchset #2 (id:20001) manually as 222ce73a49d968c0b7794823205419ad6f8a4bf6 (presubmit successful).
3 years, 4 months ago (2017-08-10 19:28:20 UTC) #5
scheglov
3 years, 4 months ago (2017-08-10 19:28:39 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/2996843002/diff/1/pkg/front_end/lib/increment...
File pkg/front_end/lib/incremental_kernel_generator.dart (right):

https://codereview.chromium.org/2996843002/diff/1/pkg/front_end/lib/increment...
pkg/front_end/lib/incremental_kernel_generator.dart:57: /// Each invocation of
[computeDelta] must follow by invocation of either
On 2017/08/10 18:03:39, Paul Berry wrote:
> "must be followed by"

Done.

https://codereview.chromium.org/2996843002/diff/1/pkg/front_end/lib/increment...
pkg/front_end/lib/incremental_kernel_generator.dart:100: /// Each invocation of
[computeDelta] must follow by invocation of either
On 2017/08/10 18:03:39, Paul Berry wrote:
> "must be followed by"

Done.

https://codereview.chromium.org/2996843002/diff/1/pkg/front_end/lib/src/incre...
File pkg/front_end/lib/src/incremental_kernel_generator_impl.dart (right):

https://codereview.chromium.org/2996843002/diff/1/pkg/front_end/lib/src/incre...
pkg/front_end/lib/src/incremental_kernel_generator_impl.dart:81: throw new
StateError(
On 2017/08/10 18:31:15, Siggi Cherem (dart-lang) wrote:
> question: instead of throwing, should we instead report an error message via
> options.reportError? (and define an error in messages.yaml)?

I don't know.

Outside of front_end I would use StateError, because nothing good is going to
happen when you use API incorrectly.
It is not a compilation error, or a transient problem - it is a programmer
error.

https://codereview.chromium.org/2996843002/diff/1/pkg/front_end/lib/src/incre...
pkg/front_end/lib/src/incremental_kernel_generator_impl.dart:84: _lastSignatures
= {};
On 2017/08/10 18:31:15, Siggi Cherem (dart-lang) wrote:
> it might be good to also enforce that accept/reject is not called until after
> computeDelta() completes. 
> Two ideas for that:
> - we could keep this as a local variable and only assign it as a field when
you
> are about to return the DeltaProgram
> - add a second field to track that there is a computeDelta in progress.
> 
> Also, since you said that calling `invalidate` is invalid if there is a
pending
> computeDelta, we might want to do that too. If so, I guess the latter idea
might
> make more sense.

This is not a new contract, I will return to enforcement in a new CL.

https://codereview.chromium.org/2996843002/diff/1/pkg/front_end/test/src/incr...
File pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart (right):

https://codereview.chromium.org/2996843002/diff/1/pkg/front_end/test/src/incr...
pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart:190:
compiler.acceptLastDelta();
On 2017/08/10 18:31:15, Siggi Cherem (dart-lang) wrote:
> A couple suggestions: feel free to ignore if you don't want to bundle these
> changes in this CL, I can follow up later with these as well.
>  - might be nice to move this line to the hotReload instead (when we know that
> the request was accepted)
>  - we could add a test that we know will be rejected and then do a subsequent
> reload with the new delta. We know that the VM will reject a reload if we
> replace "class" by "enum", so we could add one such thing below.

I moved this line into hotReload() and setUp().

I don't think there is a test for a failing hot reload, so I leave it without
tests.

Powered by Google App Engine
This is Rietveld 408576698