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

Issue 1462953002: VM: Make more globals constant where easily possible. (Closed)

Created:
5 years, 1 month ago by Florian Schneider
Modified:
5 years, 1 month ago
Reviewers:
rmacnak, Ivan Posva
CC:
reviews_dartlang.org, ricow1, turnidge, rmacnak, Cutch, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

VM: Make more globals constant where easily possible. Remove -fdata-section again from the Linux build configuration: It prevented some optimizations in gcc and clang - fewer things were recognized as constants. Add const to pointers/arrays in some places to help compilers with determining what is a constant. A common pattern is strlen of a string literal const char*, or an array of function pointers. Tested with gcc 4.8.4 / clang 3.4 and improves code qualtiy + reduces binary size. BUG= R=iposva@google.com, rmacnak@google.com Committed: https://github.com/dart-lang/sdk/commit/64e71a0b2e74cbb8a2a840b18fa100007ec1c43f

Patch Set 1 #

Total comments: 2

Patch Set 2 : Remove unnecessary const_cast #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -57 lines) Patch
M runtime/bin/dartutils.h View 1 chunk +14 lines, -14 lines 0 comments Download
M runtime/bin/dartutils.cc View 1 chunk +14 lines, -14 lines 0 comments Download
M runtime/bin/vmservice_impl.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M runtime/vm/flags.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/globals.h View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/object.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/runtime_entry.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M runtime/vm/service.cc View 10 chunks +17 lines, -17 lines 0 comments Download
M tools/gyp/configurations_make.gypi View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 6 (2 generated)
Florian Schneider
https://codereview.chromium.org/1462953002/diff/1/runtime/vm/globals.h File runtime/vm/globals.h (right): https://codereview.chromium.org/1462953002/diff/1/runtime/vm/globals.h#newcode31 runtime/vm/globals.h:31: #define kNegInfinity bit_cast<double>(DART_UINT64_C(0xfff0000000000000)) This was the only way I ...
5 years, 1 month ago (2015-11-19 16:17:01 UTC) #3
rmacnak
lgtm https://chromiumcodereview.appspot.com/1462953002/diff/1/runtime/vm/globals.h File runtime/vm/globals.h (right): https://chromiumcodereview.appspot.com/1462953002/diff/1/runtime/vm/globals.h#newcode31 runtime/vm/globals.h:31: #define kNegInfinity bit_cast<double>(DART_UINT64_C(0xfff0000000000000)) On 2015/11/19 16:17:00, Florian Schneider ...
5 years, 1 month ago (2015-11-20 01:03:57 UTC) #4
Ivan Posva
LGTM -Ivan P.S. As Ryan says INFINITY was not usable as it caused compiler warnings ...
5 years, 1 month ago (2015-11-20 04:40:51 UTC) #5
Florian Schneider
5 years, 1 month ago (2015-11-20 09:52:12 UTC) #6
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
64e71a0b2e74cbb8a2a840b18fa100007ec1c43f (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698