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

Issue 2913963002: Add negation to single-identifier tests in status files. (Closed)

Created:
3 years, 6 months ago by Lasse Reichstein Nielsen
Modified:
3 years, 6 months ago
Reviewers:
Bob Nystrom, Bill Hesse
CC:
reviews_dartlang.org, Bob Nystrom
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add negation to single-identifier tests in status files. Optimize some regegps too. Fixes #29756 BUG= http://dartbug.com/29756 R=rnystrom@google.com Committed: https://github.com/dart-lang/sdk/commit/5720e3556c2fe8ae2f70eccbeeac5dfe85f9024f

Patch Set 1 #

Patch Set 2 : Document the isIdentifier optimization. #

Total comments: 18

Patch Set 3 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -55 lines) Patch
M pkg/pkg.status View 1 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/observatory/tests/observatory_ui/observatory_ui.status View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tests/co19/co19-dart2js.status View 1 2 4 chunks +4 lines, -4 lines 0 comments Download
M tests/compiler/dart2js/dart2js.status View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tests/corelib/corelib.status View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M tests/corelib_strong/corelib_strong.status View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M tests/html/html.status View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tests/isolate/isolate.status View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tests/language/language.status View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M tests/language/language_dart2js.status View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M tests/language_strong/language_strong.status View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tests/lib/lib.status View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M tests/lib_strong/lib_strong.status View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/standalone.status View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/status_expression_test.dart View 1 2 2 chunks +24 lines, -0 lines 0 comments Download
M tools/testing/dart/status_expression.dart View 1 2 9 chunks +48 lines, -19 lines 0 comments Download
M tools/testing/dart/status_file.dart View 1 2 4 chunks +10 lines, -12 lines 0 comments Download

Messages

Total messages: 7 (3 generated)
Lasse Reichstein Nielsen
3 years, 6 months ago (2017-05-31 09:57:52 UTC) #2
Bob Nystrom
I was looking forward to doing this fun little change, but thank you either way. ...
3 years, 6 months ago (2017-06-01 23:07:46 UTC) #4
Lasse Reichstein Nielsen
Committed patchset #3 (id:40001) manually as 5720e3556c2fe8ae2f70eccbeeac5dfe85f9024f (presubmit successful).
3 years, 6 months ago (2017-06-02 08:38:19 UTC) #6
Lasse Reichstein Nielsen
3 years, 6 months ago (2017-06-07 08:51:50 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/2913963002/diff/20001/pkg/pkg.status
File pkg/pkg.status (right):

https://codereview.chromium.org/2913963002/diff/20001/pkg/pkg.status#newcode94
pkg/pkg.status:94: [ $runtime == vm && $use_sdk ]
I'll just do it.
https://xkcd.com/208/

https://codereview.chromium.org/2913963002/diff/20001/tests/standalone/status...
File tests/standalone/status_expression_test.dart (right):

https://codereview.chromium.org/2913963002/diff/20001/tests/standalone/status...
tests/standalone/status_expression_test.dart:87: var environment = <String,
dynamic>{
On 2017/06/01 23:07:46, Bob Nystrom wrote:
> This map needs to be wrapped in new TestEnvironment() now that my change
landed
> yesterday. (Also, the type arguments aren't needed.)

Done.

https://codereview.chromium.org/2913963002/diff/20001/tests/standalone/status...
tests/standalone/status_expression_test.dart:89: "unchecked": false,
Sure. This was just the "minimal diff" from the test above :)

https://codereview.chromium.org/2913963002/diff/20001/tests/standalone/status...
tests/standalone/status_expression_test.dart:96: environment["unchecked"] =
true;
On 2017/06/01 23:07:45, Bob Nystrom wrote:
> "true" and "false" need to be explicitly stringified now. The environment
> uniformly treats all values as strings.

Done.

https://codereview.chromium.org/2913963002/diff/20001/tools/testing/dart/stat...
File tools/testing/dart/status_expression.dart (right):

https://codereview.chromium.org/2913963002/diff/20001/tools/testing/dart/stat...
tools/testing/dart/status_expression.dart:200: bool negate = false;
On 2017/06/01 23:07:46, Bob Nystrom wrote:
> Nit: "bool" -> "var".
> 
> I'm moving test.dart to consistently use var for locals. (Previously, it was
> simply inconsistent.)

Done.

https://codereview.chromium.org/2913963002/diff/20001/tools/testing/dart/stat...
tools/testing/dart/status_expression.dart:223: var negate = _scanner.advance()
== _Token.notEqual;
On 2017/06/01 23:07:46, Bob Nystrom wrote:
> How about renaming this local to "isNotEqual" to avoid confusing shadowing?

Done.

https://codereview.chromium.org/2913963002/diff/20001/tools/testing/dart/stat...
tools/testing/dart/status_expression.dart:242: static final _tokenPattern = new
RegExp(r"[()$]|&&|\|\||==|!=?|\w+");
Occupational hazard - I can't pass by a RegExp without needing to tweak it :)

https://codereview.chromium.org/2913963002/diff/20001/tools/testing/dart/stat...
tools/testing/dart/status_expression.dart:276: current.length > 2 ||
_identifierPattern.hasMatch(current);
Yes, optimization.
Necessary? Maybe not, but it seems ridiculously expensive to do full "^\w+$"
RegExp run on every identifier (which will, in almost all cases, match anyway)
when checking just the first character or even the length is sufficient.

I guess my approach to performance comes from library work - they need to be as
efficient as absolutely possible because they affect code that can't fix them. 
Applications can probably stop when they are "fast enough" because they can
predict all their uses.

https://codereview.chromium.org/2913963002/diff/20001/tools/testing/dart/stat...
File tools/testing/dart/status_file.dart (right):

https://codereview.chromium.org/2913963002/diff/20001/tools/testing/dart/stat...
tools/testing/dart/status_file.dart:75: if (hashIndex >= 0) {
There are two reasons for this choice (three if you include habit).
- I don't actually expect everybody to remember that the sentinel value is -1,
just that "negative means no". I see "-1" as a magic constant, and it's better
to avoid those.
- It's likely faster and smaller when compiled (pico-optimization, I know :)

Powered by Google App Engine
This is Rietveld 408576698