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

Issue 2987183002: [vm] Revise Dart_IntegerToHexCString to avoid dependency on Bigint (Closed)

Created:
3 years, 4 months ago by alexmarkov
Modified:
3 years, 4 months ago
Reviewers:
zra, siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

[vm] Revise Dart_IntegerToHexCString to avoid dependency on Bigint Until this change, implementation of Dart_IntegerToHexCString() always created Bigint objects and used Bigint::ToHexCString() to do the work. In --limit-ints-to-64-bits mode (with Dart integers limited to 64 bits) Bigints are banned and should not be used. This CL revises Dart_IntegerToHexCString implementation to avoid creating Bigint objects for Smi and Mint arguments, so it would work in --limit-ints-to-64-bits mode. Also, this CL adds test case to lock down the behavior of Dart_IntegerToHexCString. R=asiva@google.com Issue: https://github.com/dart-lang/sdk/issues/30103 Committed: https://github.com/dart-lang/sdk/commit/3d4838fc70a5439437a5ceb4247551315c294477

Patch Set 1 #

Total comments: 4

Patch Set 2 : Virtual methods grouped together #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -22 lines) Patch
M runtime/vm/dart_api_impl.cc View 1 chunk +1 line, -7 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 3 chunks +65 lines, -14 lines 0 comments Download
M runtime/vm/object.h View 1 3 chunks +7 lines, -1 line 0 comments Download
M runtime/vm/object.cc View 1 chunk +10 lines, -0 lines 2 comments Download

Messages

Total messages: 9 (2 generated)
alexmarkov
3 years, 4 months ago (2017-07-31 21:00:38 UTC) #2
siva
lgtm https://codereview.chromium.org/2987183002/diff/1/runtime/vm/object.h File runtime/vm/object.h (right): https://codereview.chromium.org/2987183002/diff/1/runtime/vm/object.h#newcode6465 runtime/vm/object.h:6465: virtual const char* ToHexCString(Zone* zone) const; Club this ...
3 years, 4 months ago (2017-07-31 22:03:51 UTC) #3
alexmarkov
https://codereview.chromium.org/2987183002/diff/1/runtime/vm/object.h File runtime/vm/object.h (right): https://codereview.chromium.org/2987183002/diff/1/runtime/vm/object.h#newcode6465 runtime/vm/object.h:6465: virtual const char* ToHexCString(Zone* zone) const; On 2017/07/31 22:03:51, ...
3 years, 4 months ago (2017-08-01 15:42:29 UTC) #4
alexmarkov
Committed patchset #2 (id:20001) manually as 3d4838fc70a5439437a5ceb4247551315c294477 (presubmit successful).
3 years, 4 months ago (2017-08-01 16:00:45 UTC) #6
zra
https://codereview.chromium.org/2987183002/diff/20001/runtime/vm/object.cc File runtime/vm/object.cc (right): https://codereview.chromium.org/2987183002/diff/20001/runtime/vm/object.cc#newcode18245 runtime/vm/object.cc:18245: return OS::SCreate(zone, "-0x%" PRIX64, static_cast<uint64_t>(-value)); We have some abbreviations ...
3 years, 4 months ago (2017-08-01 16:21:57 UTC) #7
zra
3 years, 4 months ago (2017-08-01 16:22:00 UTC) #8
alexmarkov
3 years, 4 months ago (2017-08-01 17:40:11 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/2987183002/diff/20001/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://codereview.chromium.org/2987183002/diff/20001/runtime/vm/object.cc#ne...
runtime/vm/object.cc:18245: return OS::SCreate(zone, "-0x%" PRIX64,
static_cast<uint64_t>(-value));
On 2017/08/01 16:21:57, zra wrote:
> We have some abbreviations for these here:
> 
> https://github.com/dart-lang/sdk/blob/master/runtime/platform/globals.h#L390

Introduced new short form specifier PX64, see
https://codereview.chromium.org/2985423002/


> 
> Also, I think they have to be followed by "", so:
> 
> OS::SCreate(zone, "-0x%" Px64 "", ...)

I think there is no need in trailing "", because these format specifier
constants are just string literals like "d" or "llx". Can you clarify why
appending an empty string at the end is useful?

Powered by Google App Engine
This is Rietveld 408576698