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

Issue 501323002: Replace our homegrown ARRAY_SIZE() with Chrome's arraysize(). (Closed)

Created:
6 years, 3 months ago by Benedikt Meurer
Modified:
6 years, 3 months ago
Reviewers:
refack, Yang
CC:
v8-dev
Project:
v8
Visibility:
Public.

Description

Replace our homegrown ARRAY_SIZE() with Chrome's arraysize(). Our own ARRAY_SIZE() was pretty bad at error checking. If you use arrasize() in a wrong way, the compiler will issue an error instead of silently doing the wrong thing. The previous ARRAY_SIZE() macro is still available as ARRAYSIZE_UNSAFE() similar to Chrome. R=yangguo@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=23389

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+592 lines, -531 lines) Patch
M src/api.cc View 11 chunks +11 lines, -11 lines 0 comments Download
M src/arm/code-stubs-arm.cc View 24 chunks +25 lines, -25 lines 0 comments Download
M src/arm64/assembler-arm64.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/arm64/code-stubs-arm64.cc View 25 chunks +25 lines, -25 lines 0 comments Download
M src/arm64/instrument-arm64.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/arm64/simulator-arm64.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/ast.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/base/logging.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/base/macros.h View 1 chunk +68 lines, -7 lines 1 comment Download
M src/bootstrapper.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/cached-powers.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/code-stubs.cc View 7 chunks +8 lines, -8 lines 0 comments Download
M src/compiler/arm/instruction-selector-arm.cc View 4 chunks +7 lines, -7 lines 0 comments Download
M src/compiler/arm64/instruction-selector-arm64.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M src/compiler/graph.h View 1 chunk +5 lines, -5 lines 0 comments Download
M src/compiler/graph-builder.h View 1 chunk +5 lines, -5 lines 0 comments Download
M src/compiler/ia32/instruction-selector-ia32.cc View 4 chunks +5 lines, -5 lines 0 comments Download
M src/compiler/instruction-selector.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M src/compiler/js-generic-lowering.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M src/compiler/x64/instruction-selector-x64.cc View 4 chunks +5 lines, -5 lines 0 comments Download
M src/conversions.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/debug.cc View 8 chunks +10 lines, -10 lines 0 comments Download
M src/deoptimizer.h View 2 chunks +4 lines, -4 lines 0 comments Download
M src/execution.cc View 6 chunks +6 lines, -6 lines 0 comments Download
M src/factory.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M src/full-codegen.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/global-handles.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/heap/heap.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M src/hydrogen.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/ia32/code-stubs-ia32.cc View 24 chunks +25 lines, -25 lines 0 comments Download
M src/isolate.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/jsregexp.cc View 2 chunks +6 lines, -6 lines 0 comments Download
M src/lithium-codegen.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/messages.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/mips/code-stubs-mips.cc View 22 chunks +23 lines, -23 lines 0 comments Download
M src/mips64/code-stubs-mips64.cc View 22 chunks +23 lines, -23 lines 0 comments Download
M src/mksnapshot.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/objects.cc View 27 chunks +27 lines, -27 lines 0 comments Download
M src/parser.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/runtime.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M src/serialize.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/strtod.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/types.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/vector.h View 1 chunk +1 line, -1 line 0 comments Download
M src/x64/code-stubs-x64.cc View 23 chunks +25 lines, -25 lines 0 comments Download
M src/x87/code-stubs-x87.cc View 24 chunks +25 lines, -25 lines 0 comments Download
M test/base-unittests/platform/platform-unittest.cc View 1 chunk +12 lines, -12 lines 0 comments Download
M test/cctest/compiler/call-tester.h View 3 chunks +4 lines, -4 lines 0 comments Download
M test/cctest/compiler/test-branch-combine.cc View 8 chunks +9 lines, -9 lines 0 comments Download
M test/cctest/compiler/test-instruction.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M test/cctest/compiler/test-js-constant-cache.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M test/cctest/compiler/test-js-typed-lowering.cc View 29 chunks +44 lines, -44 lines 0 comments Download
M test/cctest/compiler/test-node-cache.cc View 4 chunks +6 lines, -6 lines 0 comments Download
M test/cctest/compiler/test-phi-reducer.cc View 6 chunks +11 lines, -11 lines 0 comments Download
M test/cctest/compiler/test-representation-change.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M test/cctest/compiler/test-run-machops.cc View 13 chunks +13 lines, -13 lines 0 comments Download
M test/cctest/compiler/test-simplified-lowering.cc View 19 chunks +24 lines, -24 lines 0 comments Download
M test/cctest/compiler/test-structured-ifbuilder-fuzzer.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M test/cctest/compiler/test-structured-machine-assembler.cc View 5 chunks +7 lines, -7 lines 0 comments Download
M test/cctest/compiler/value-helper.h View 3 chunks +4 lines, -4 lines 0 comments Download
M test/cctest/test-api.cc View 5 chunks +6 lines, -6 lines 0 comments Download
M test/cctest/test-checks.cc View 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/test-compiler.cc View 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/test-cpu-profiler.cc View 13 chunks +19 lines, -19 lines 0 comments Download
M test/cctest/test-date.cc View 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/test-debug.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M test/cctest/test-heap-profiler.cc View 8 chunks +8 lines, -8 lines 0 comments Download
M test/cctest/test-mark-compact.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M test/cctest/test-object-observe.cc View 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/test-parsing.cc View 14 chunks +17 lines, -17 lines 0 comments Download
M test/cctest/test-random-number-generator.cc View 1 chunk +1 line, -1 line 0 comments Download
M testing/gtest-support.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Benedikt Meurer
bmeurer@chromium.org changed reviewers: + yangguo@chromium.org
6 years, 3 months ago (2014-08-26 09:09:02 UTC) #1
Benedikt Meurer
PTAL
6 years, 3 months ago (2014-08-26 09:09:02 UTC) #2
Yang
LGTM. Rubberstamped most. https://codereview.chromium.org/501323002/diff/1/src/base/macros.h File src/base/macros.h (right): https://codereview.chromium.org/501323002/diff/1/src/base/macros.h#newcode88 src/base/macros.h:88: #define ARRAYSIZE_UNSAFE(a) \ Do we actually ...
6 years, 3 months ago (2014-08-26 09:17:22 UTC) #3
Benedikt Meurer
Committed patchset #1 manually as 23389 (presubmit successful).
6 years, 3 months ago (2014-08-26 09:20:07 UTC) #4
refack
On 2014/08/26 09:20:07, Benedikt Meurer wrote: > Committed patchset #1 manually as 23389 (presubmit successful). ...
6 years, 3 months ago (2014-09-10 09:44:58 UTC) #5
Benedikt Meurer
6 years, 3 months ago (2014-09-11 04:43:21 UTC) #6
Message was sent while issue was closed.
On 2014/09/10 at 09:44:58, refack wrote:
> On 2014/08/26 09:20:07, Benedikt Meurer wrote:
> > Committed patchset #1 manually as 23389 (presubmit successful).
> 
> Any Idea why I still can't build this on Ubuntu 14 x64 (GCC 4.8.8 / GCC 4.9.1
/ Clang 3.5.1)?
> something failing about instantiating the template

What is this "something" that is failing? Maybe you can file a bug report with
detailed error messages.

Powered by Google App Engine
This is Rietveld 408576698