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

Issue 2630743002: Remove use of FunctionSignature et al from call_structure.dart (Closed)

Created:
3 years, 11 months ago by Johnni Winther
Modified:
3 years, 11 months ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Remove use of FunctionSignature et al from call_structure.dart R=sigmund@google.com Committed: https://github.com/dart-lang/sdk/commit/7713e62409d06668b40bfd027f80e70ce6394b83

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+176 lines, -193 lines) Patch
M pkg/compiler/lib/src/compile_time_constants.dart View 4 chunks +7 lines, -8 lines 2 comments Download
M pkg/compiler/lib/src/elements/elements.dart View 2 chunks +126 lines, -0 lines 2 comments Download
M pkg/compiler/lib/src/elements/entities.dart View 1 chunk +1 line, -2 lines 0 comments Download
M pkg/compiler/lib/src/inferrer/builder.dart View 1 chunk +1 line, -2 lines 0 comments Download
M pkg/compiler/lib/src/inferrer/closure_tracer.dart View 1 chunk +1 line, -2 lines 0 comments Download
M pkg/compiler/lib/src/resolution/class_hierarchy.dart View 1 chunk +1 line, -2 lines 0 comments Download
M pkg/compiler/lib/src/resolution/constructors.dart View 1 chunk +1 line, -2 lines 0 comments Download
M pkg/compiler/lib/src/resolution/members.dart View 5 chunks +5 lines, -5 lines 0 comments Download
M pkg/compiler/lib/src/resolution/send_structure.dart View 2 chunks +2 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/ssa/builder.dart View 4 chunks +6 lines, -5 lines 0 comments Download
M pkg/compiler/lib/src/typechecker.dart View 1 chunk +2 lines, -7 lines 0 comments Download
M pkg/compiler/lib/src/universe/call_structure.dart View 3 chunks +20 lines, -151 lines 4 comments Download
M pkg/compiler/lib/src/universe/selector.dart View 3 chunks +3 lines, -4 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
Johnni Winther
3 years, 11 months ago (2017-01-13 13:38:35 UTC) #2
Siggi Cherem (dart-lang)
small suggestions, otherwise lgtm https://codereview.chromium.org/2630743002/diff/1/pkg/compiler/lib/src/compile_time_constants.dart File pkg/compiler/lib/src/compile_time_constants.dart (right): https://codereview.chromium.org/2630743002/diff/1/pkg/compiler/lib/src/compile_time_constants.dart#newcode1300 pkg/compiler/lib/src/compile_time_constants.dart:1300: target.functionSignature.parameterCount, target.type.namedParameters); do we want ...
3 years, 11 months ago (2017-01-13 17:11:07 UTC) #3
Johnni Winther
Committed patchset #1 (id:1) manually as 7713e62409d06668b40bfd027f80e70ce6394b83 (presubmit successful).
3 years, 11 months ago (2017-01-18 11:02:06 UTC) #5
Johnni Winther
3 years, 11 months ago (2017-01-18 11:02:51 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/2630743002/diff/1/pkg/compiler/lib/src/compil...
File pkg/compiler/lib/src/compile_time_constants.dart (right):

https://codereview.chromium.org/2630743002/diff/1/pkg/compiler/lib/src/compil...
pkg/compiler/lib/src/compile_time_constants.dart:1300:
target.functionSignature.parameterCount, target.type.namedParameters);
On 2017/01/13 17:11:07, Siggi Cherem (dart-lang) wrote:
> do we want to also get rid of functionSignature here?
>  (compute parameterCount from target.type instead)?

I considered adding a 'parameterCount' property to FunctionType, but we
currently have a lot of inconsistent semantics on the various
(-/required/positional/named)ParameterCount properties so for this CL I didn't
want to add to the madness. Will look into it later.

https://codereview.chromium.org/2630743002/diff/1/pkg/compiler/lib/src/elemen...
File pkg/compiler/lib/src/elements/elements.dart (right):

https://codereview.chromium.org/2630743002/diff/1/pkg/compiler/lib/src/elemen...
pkg/compiler/lib/src/elements/elements.dart:830: * Precondition:
`this.applies(element, world)`.
On 2017/01/13 17:11:07, Siggi Cherem (dart-lang) wrote:
> what is `this` in this static context?

Old invariant. Changed to `callStructure.signatureApplies(element.type)`

https://codereview.chromium.org/2630743002/diff/1/pkg/compiler/lib/src/univer...
File pkg/compiler/lib/src/universe/call_structure.dart (right):

https://codereview.chromium.org/2630743002/diff/1/pkg/compiler/lib/src/univer...
pkg/compiler/lib/src/universe/call_structure.dart:103: if (name ==
namedParameters[nameIndex]) {
On 2017/01/13 17:11:07, Siggi Cherem (dart-lang) wrote:
> Can we get here anymore with the duplicated names, or will the resolver
prevent
> us from reaching this point? If not, we could move the ++ here to ensure the
> same semantics:
>   if (name == namedParameters[nameIndex++])

We still create both function signatures/types and call structures with
duplicate names, but these are erroneous cases so what action we take here is
not that important. It's even preferable to allow calls with duplicate names to
methods with duplicate names...

https://codereview.chromium.org/2630743002/diff/1/pkg/compiler/lib/src/univer...
pkg/compiler/lib/src/universe/call_structure.dart:104: continue OUTER;
On 2017/01/13 17:11:07, Siggi Cherem (dart-lang) wrote:
> I find the logic with `continue` a bit hard to follow. This has an extra
check,
> but might be more self explanatory:
> 
> for (String name in getOrderedNamedArguments()) {
>   bool found = false;
>   // Note: we start at the existing index because arguments are sorted.
>   while (nameIndex < namedParameters.length) {
>     if (name == namedParameters[nameIndex]) {
>       found = true;
>       break;
>     }
>     nameIndex++; 
>   }
>   if (!found) return false;
> }
> return true;
>     

Done.

Powered by Google App Engine
This is Rietveld 408576698