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

Unified Diff: src/heap/heap.cc

Issue 501323002: Replace our homegrown ARRAY_SIZE() with Chrome's arraysize(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index a3d653d33b7eefebc64efa3bb48f3b0c2d79aa5a..e31a281e5345163826988032f4029a28cd19f260 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -2500,7 +2500,7 @@ bool Heap::CreateInitialMaps() {
ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, exception);
ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, termination_exception);
- for (unsigned i = 0; i < ARRAY_SIZE(string_type_table); i++) {
+ for (unsigned i = 0; i < arraysize(string_type_table); i++) {
const StringTypeTable& entry = string_type_table[i];
{
AllocationResult allocation = AllocateMap(entry.type, entry.size);
@@ -2546,7 +2546,7 @@ bool Heap::CreateInitialMaps() {
ALLOCATE_MAP(FILLER_TYPE, 2 * kPointerSize, two_pointer_filler)
- for (unsigned i = 0; i < ARRAY_SIZE(struct_table); i++) {
+ for (unsigned i = 0; i < arraysize(struct_table); i++) {
const StructTable& entry = struct_table[i];
Map* map;
if (!AllocateMap(entry.type, entry.size).To(&map)) return false;
@@ -2791,7 +2791,7 @@ void Heap::CreateInitialObjects() {
handle(Smi::FromInt(-5), isolate()),
Oddball::kException));
- for (unsigned i = 0; i < ARRAY_SIZE(constant_string_table); i++) {
+ for (unsigned i = 0; i < arraysize(constant_string_table); i++) {
Handle<String> str =
factory->InternalizeUtf8String(constant_string_table[i].contents);
roots_[constant_string_table[i].index] = *str;
@@ -2921,7 +2921,7 @@ bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) {
kStringTableRootIndex,
};
- for (unsigned int i = 0; i < ARRAY_SIZE(writable_roots); i++) {
+ for (unsigned int i = 0; i < arraysize(writable_roots); i++) {
if (root_index == writable_roots[i]) return true;
}
return false;
« src/base/macros.h ('K') | « src/global-handles.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698