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

Issue 23956007: Fix bug in inferrer for the computation of callers: we need to keep track of what is the called nod… (Closed)

Created:
7 years, 3 months ago by ngeoffray
Modified:
7 years, 3 months ago
Reviewers:
kasperl
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix bug in inferrer for the computation of callers: we need to keep track of what is the called node to ensure another call does not accidentally remove a caller. The bug was in the following code: Iterable<Element> untypedTargets = allFuctions.filter(selector.asUntyped); Iterable<Element> typedTargets = allFuctions.filter(selector); for (callee in untypedTargets) { if (!typedTargets.contains(callee)) { callee.removeCall(caller); } else { callee.addCall(caller); } } The "removeCall" here is not correct because the relation caller-> callee could have been made by another call, with the same selector name but a different typedTargets set. R=kasperl@google.com Committed: https://code.google.com/p/dart/source/detail?r=27233

Patch Set 1 : #

Total comments: 2

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -14 lines) Patch
M sdk/lib/_internal/compiler/implementation/types/container_tracer.dart View 1 chunk +3 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart View 1 7 chunks +14 lines, -14 lines 0 comments Download
A tests/compiler/dart2js/simple_inferrer_callers_test.dart View 1 chunk +53 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
ngeoffray
7 years, 3 months ago (2013-09-05 15:48:56 UTC) #1
kasperl
LGTM! https://codereview.chromium.org/23956007/diff/8001/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart File sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (right): https://codereview.chromium.org/23956007/diff/8001/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart#newcode196 sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart:196: callers[caller].remove(node); I'd put callers[caller] in a local variable.
7 years, 3 months ago (2013-09-06 08:22:33 UTC) #2
ngeoffray
Thanks Kasper. https://codereview.chromium.org/23956007/diff/8001/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart File sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (right): https://codereview.chromium.org/23956007/diff/8001/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart#newcode196 sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart:196: callers[caller].remove(node); On 2013/09/06 08:22:33, kasperl wrote: > ...
7 years, 3 months ago (2013-09-06 08:42:13 UTC) #3
ngeoffray
7 years, 3 months ago (2013-09-06 08:43:11 UTC) #4
Message was sent while issue was closed.
Committed patchset #2 manually as r27233 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698