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

Issue 10854140: Fix type inference for self-recursive functions (Closed)

Created:
8 years, 4 months ago by Søren Gjesse
Modified:
8 years, 4 months ago
Reviewers:
ahe, floitsch
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix type inference for self-recursive functions If a self-recursive function calls itself with different argument types that the ones currently expected the actual recompilation of the function did not take place. This caused wrong JavaScript code to be generated. This change queues the generated JavaScript code to be invalidated to after compiling the current function so that it itself can be invalidated correctly. R=floitsch@google.com, ahe@google.com BUG=dart:4492 TEST=tests/compiler/dart2js_extra/regress/4492_test.dart Committed: https://code.google.com/p/dart/source/detail?r=10622

Patch Set 1 #

Total comments: 6

Patch Set 2 : Minor fix #

Patch Set 3 : Addressed review comments from ahe@ #

Patch Set 4 : Add method for retreiving generated code for dart2js tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -27 lines) Patch
M lib/compiler/implementation/compiler.dart View 1 2 4 chunks +6 lines, -9 lines 0 comments Download
M lib/compiler/implementation/dart_backend/backend.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M lib/compiler/implementation/enqueue.dart View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M lib/compiler/implementation/js_backend/backend.dart View 1 2 5 chunks +10 lines, -4 lines 0 comments Download
M tests/compiler/dart2js/call_site_type_inferer_test.dart View 3 chunks +11 lines, -3 lines 0 comments Download
M tests/compiler/dart2js/compiler_helper.dart View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M tests/compiler/dart2js_extra/regress/4434_test.dart View 1 chunk +4 lines, -0 lines 0 comments Download
A + tests/compiler/dart2js_extra/regress/4492_test.dart View 1 chunk +6 lines, -8 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Gjesse
8 years, 4 months ago (2012-08-14 07:48:54 UTC) #1
ahe
LGTM http://codereview.chromium.org/10854140/diff/1/lib/compiler/implementation/compiler.dart File lib/compiler/implementation/compiler.dart (right): http://codereview.chromium.org/10854140/diff/1/lib/compiler/implementation/compiler.dart#newcode761 lib/compiler/implementation/compiler.dart:761: CodeBuffer codeBuffer = backend.codegen(work); codeBuffer is never used. ...
8 years, 4 months ago (2012-08-14 07:57:56 UTC) #2
Søren Gjesse
8 years, 4 months ago (2012-08-14 08:26:30 UTC) #3
http://codereview.chromium.org/10854140/diff/1/lib/compiler/implementation/co...
File lib/compiler/implementation/compiler.dart (right):

http://codereview.chromium.org/10854140/diff/1/lib/compiler/implementation/co...
lib/compiler/implementation/compiler.dart:761: CodeBuffer codeBuffer =
backend.codegen(work);
On 2012/08/14 07:57:56, ahe wrote:
> codeBuffer is never used.

Removed.

http://codereview.chromium.org/10854140/diff/1/lib/compiler/implementation/da...
File lib/compiler/implementation/dart_backend/backend.dart (right):

http://codereview.chromium.org/10854140/diff/1/lib/compiler/implementation/da...
lib/compiler/implementation/dart_backend/backend.dart:25: void codegen(WorkItem
work) => null;
On 2012/08/14 07:57:56, ahe wrote:
> Please don't use => for void methods (outside tests).

Changed to empty body.

http://codereview.chromium.org/10854140/diff/1/lib/compiler/implementation/un...
File lib/compiler/implementation/universe.dart (right):

http://codereview.chromium.org/10854140/diff/1/lib/compiler/implementation/un...
lib/compiler/implementation/universe.dart:41: void invalidateCode(Element
element) {
On 2012/08/14 07:57:56, ahe wrote:
> Please don't add new features to Universe, that is, add this to Enqueuer.

Removed this and used eagerRecompile in Enqueuer (which I had removed in favor
of this).

Powered by Google App Engine
This is Rietveld 408576698