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

Issue 54663002: Change int.fromEnvironment in VM to use same code as int.parse. (Closed)

Created:
7 years, 1 month ago by Lasse Reichstein Nielsen
Modified:
7 years, 1 month ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Change int.fromEnvironment in VM to use same code as int.parse. R=fschneider@google.com, sgjesse@google.com Committed: https://code.google.com/p/dart/source/detail?r=29670

Patch Set 1 #

Patch Set 2 : And fix some typos. #

Patch Set 3 : Fix some typos #

Total comments: 5

Patch Set 4 : Change return type of ParseInteger to RawInteger* #

Patch Set 5 : Change order for String/bool too. Add canonicalization. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -57 lines) Patch
M runtime/lib/bool.cc View 1 2 3 4 1 chunk +6 lines, -6 lines 0 comments Download
M runtime/lib/integers.cc View 1 2 3 4 3 chunks +22 lines, -40 lines 3 comments Download
M runtime/lib/string.cc View 1 2 3 4 1 chunk +5 lines, -5 lines 0 comments Download
M sdk/lib/_internal/lib/core_patch.dart View 1 2 chunks +3 lines, -3 lines 0 comments Download
M tests/corelib/int_from_environment2_test.dart View 1 2 3 2 chunks +4 lines, -1 line 0 comments Download
M tests/corelib/int_from_environment_default_value_test.dart View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M tests/corelib/int_from_environment_test.dart View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
Lasse Reichstein Nielsen
7 years, 1 month ago (2013-10-31 13:00:40 UTC) #1
Søren Gjesse
lgtm, with comments https://codereview.chromium.org/54663002/diff/40001/runtime/lib/integers.cc File runtime/lib/integers.cc (right): https://codereview.chromium.org/54663002/diff/40001/runtime/lib/integers.cc#newcode249 runtime/lib/integers.cc:249: if (result.IsInteger()) return result.raw(); I think ...
7 years, 1 month ago (2013-10-31 13:17:49 UTC) #2
Florian Schneider
lgtm
7 years, 1 month ago (2013-10-31 13:23:10 UTC) #3
Lasse Reichstein Nielsen
https://codereview.chromium.org/54663002/diff/40001/runtime/lib/integers.cc File runtime/lib/integers.cc (right): https://codereview.chromium.org/54663002/diff/40001/runtime/lib/integers.cc#newcode249 runtime/lib/integers.cc:249: if (result.IsInteger()) return result.raw(); Will do. Florian, is there ...
7 years, 1 month ago (2013-10-31 13:25:49 UTC) #4
Lasse Reichstein Nielsen
Address comments. https://codereview.chromium.org/54663002/diff/140001/runtime/lib/integers.cc File runtime/lib/integers.cc (right): https://codereview.chromium.org/54663002/diff/140001/runtime/lib/integers.cc#newcode252 runtime/lib/integers.cc:252: String::New(result.ToCString()))); Ivan, we can't decide if this ...
7 years, 1 month ago (2013-10-31 13:45:24 UTC) #5
Lasse Reichstein Nielsen
Committed patchset #5 manually as r29670 (presubmit successful).
7 years, 1 month ago (2013-10-31 13:45:51 UTC) #6
Ivan Posva
7 years, 1 month ago (2013-10-31 16:08:17 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/54663002/diff/140001/runtime/lib/integers.cc
File runtime/lib/integers.cc (right):

https://codereview.chromium.org/54663002/diff/140001/runtime/lib/integers.cc#...
runtime/lib/integers.cc:250: if (result.IsSmi()) return result.raw();
{
  return result.raw();
}

https://codereview.chromium.org/54663002/diff/140001/runtime/lib/integers.cc#...
runtime/lib/integers.cc:252: String::New(result.ToCString())));
On 2013/10/31 13:45:24, Lasse Reichstein Nielsen wrote:
> Ivan, we can't decide if this canonicalization is still necessary.
> If not, we can just return result.raw in all cases.

Yes, it is necessary. You could of course do

return result.CheckAndCanonicalize();

to avoid parsing again.

Powered by Google App Engine
This is Rietveld 408576698