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

Issue 1180973003: dart2js cps: Support function types in 'is' and 'as' operators. (Closed)

Created:
5 years, 6 months ago by asgerf
Modified:
5 years, 6 months ago
Reviewers:
karlklose
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

dart2js cps: Support function types in 'is' and 'as' operators. The generated code uses different helpers than the SSA. In SSA, there are calls to buildFunctionType and _isTest. The CPS uses checkSubtypeOfRuntimeType, the "one size fits all" method we also use to test against type variable types. When the function type has no type variables in it we could hoist the function type into a constant, but the constant system does not support type representation constants at the moment. But it seems like an optimization we may want to add later. BUG= R=karlklose@google.com Committed: https://github.com/dart-lang/sdk/commit/fb38d61dba779be60a29026a6861430e439db940

Patch Set 1 #

Patch Set 2 : Fix status file #

Total comments: 7

Patch Set 3 : New test case #

Patch Set 4 : Update doc comment for TypeCast #

Unified diffs Side-by-side diffs Delta from patch set Stats (+95 lines, -689 lines) Patch
M pkg/compiler/lib/src/compiler.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart View 3 chunks +6 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart View 1 chunk +2 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart View 1 2 3 3 chunks +5 lines, -9 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/type_propagation.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/compiler/lib/src/js_backend/backend.dart View 1 chunk +8 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/codegen/codegen.dart View 3 chunks +9 lines, -5 lines 0 comments Download
M pkg/compiler/lib/src/ssa/builder.dart View 1 chunk +1 line, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/js_lib/js_rti.dart View 1 chunk +2 lines, -1 line 0 comments Download
M tests/co19/co19-dart2js.status View 1 4 chunks +2 lines, -56 lines 0 comments Download
M tests/compiler/dart2js_extra/dart2js_extra.status View 1 chunk +2 lines, -32 lines 0 comments Download
M tests/compiler/dart2js_native/dart2js_native.status View 4 chunks +1 line, -6 lines 0 comments Download
M tests/corelib/corelib.status View 1 chunk +12 lines, -92 lines 0 comments Download
M tests/isolate/isolate.status View 1 chunk +0 lines, -4 lines 0 comments Download
A tests/language/function_subtype3_test.dart View 1 2 1 chunk +30 lines, -0 lines 0 comments Download
M tests/language/language_dart2js.status View 13 chunks +9 lines, -303 lines 0 comments Download
M tests/lib/lib.status View 3 chunks +3 lines, -135 lines 0 comments Download
M tests/standalone/standalone.status View 2 chunks +0 lines, -39 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
asgerf
https://codereview.chromium.org/1180973003/diff/20001/sdk/lib/_internal/compiler/js_lib/js_rti.dart File sdk/lib/_internal/compiler/js_lib/js_rti.dart (right): https://codereview.chromium.org/1180973003/diff/20001/sdk/lib/_internal/compiler/js_lib/js_rti.dart#newcode393 sdk/lib/_internal/compiler/js_lib/js_rti.dart:393: if (isDartFunctionType(t)) { This matters when 'o' is a ...
5 years, 6 months ago (2015-06-17 14:01:49 UTC) #2
karlklose
LGTM, just one question about the change to js_rti. https://codereview.chromium.org/1180973003/diff/20001/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart File pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart (right): https://codereview.chromium.org/1180973003/diff/20001/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart#newcode387 pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart:387: ...
5 years, 6 months ago (2015-06-18 07:45:02 UTC) #3
asgerf
https://codereview.chromium.org/1180973003/diff/20001/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart File pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart (right): https://codereview.chromium.org/1180973003/diff/20001/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart#newcode387 pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart:387: final List<Reference<Primitive>> typeArguments; On 2015/06/18 07:45:02, karlklose wrote: > ...
5 years, 6 months ago (2015-06-18 09:20:38 UTC) #4
karlklose
Still LGTM.
5 years, 6 months ago (2015-06-18 09:29:45 UTC) #5
asgerf
5 years, 6 months ago (2015-06-18 09:31:02 UTC) #6
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
fb38d61dba779be60a29026a6861430e439db940 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698