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

Side by Side Diff: test/cctest/test-heap.cc

Issue 1277353002: Use static_cast<> for NULL (clang 3.7) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use nullptr everywhere, squash commits Created 5 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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-i18n.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 obj_copy->Size() / 2); 121 obj_copy->Size() / 2);
122 CHECK(not_right != *code); 122 CHECK(not_right != *code);
123 } 123 }
124 124
125 125
126 TEST(HandleNull) { 126 TEST(HandleNull) {
127 CcTest::InitializeVM(); 127 CcTest::InitializeVM();
128 Isolate* isolate = CcTest::i_isolate(); 128 Isolate* isolate = CcTest::i_isolate();
129 HandleScope outer_scope(isolate); 129 HandleScope outer_scope(isolate);
130 LocalContext context; 130 LocalContext context;
131 Handle<Object> n(reinterpret_cast<Object*>(NULL), isolate); 131 Handle<Object> n(static_cast<Object*>(nullptr), isolate);
132 CHECK(!n.is_null()); 132 CHECK(!n.is_null());
133 } 133 }
134 134
135 135
136 TEST(HeapObjects) { 136 TEST(HeapObjects) {
137 CcTest::InitializeVM(); 137 CcTest::InitializeVM();
138 Isolate* isolate = CcTest::i_isolate(); 138 Isolate* isolate = CcTest::i_isolate();
139 Factory* factory = isolate->factory(); 139 Factory* factory = isolate->factory();
140 Heap* heap = isolate->heap(); 140 Heap* heap = isolate->heap();
141 141
(...skipping 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 int max_word_fill = Heap::GetMaximumFillToAlign(kWordAligned); 1979 int max_word_fill = Heap::GetMaximumFillToAlign(kWordAligned);
1980 CHECK_EQ(0, max_word_fill); 1980 CHECK_EQ(0, max_word_fill);
1981 int max_double_fill = Heap::GetMaximumFillToAlign(kDoubleAligned); 1981 int max_double_fill = Heap::GetMaximumFillToAlign(kDoubleAligned);
1982 CHECK_EQ(maximum_double_misalignment, max_double_fill); 1982 CHECK_EQ(maximum_double_misalignment, max_double_fill);
1983 int max_double_unaligned_fill = Heap::GetMaximumFillToAlign(kDoubleUnaligned); 1983 int max_double_unaligned_fill = Heap::GetMaximumFillToAlign(kDoubleUnaligned);
1984 CHECK_EQ(maximum_double_misalignment, max_double_unaligned_fill); 1984 CHECK_EQ(maximum_double_misalignment, max_double_unaligned_fill);
1985 int max_simd128_unaligned_fill = 1985 int max_simd128_unaligned_fill =
1986 Heap::GetMaximumFillToAlign(kSimd128Unaligned); 1986 Heap::GetMaximumFillToAlign(kSimd128Unaligned);
1987 CHECK_EQ(maximum_simd128_misalignment, max_simd128_unaligned_fill); 1987 CHECK_EQ(maximum_simd128_misalignment, max_simd128_unaligned_fill);
1988 1988
1989 Address base = reinterpret_cast<Address>(NULL); 1989 Address base = static_cast<Address>(NULL);
1990 int fill = 0; 1990 int fill = 0;
1991 1991
1992 // Word alignment never requires fill. 1992 // Word alignment never requires fill.
1993 fill = Heap::GetFillToAlign(base, kWordAligned); 1993 fill = Heap::GetFillToAlign(base, kWordAligned);
1994 CHECK_EQ(0, fill); 1994 CHECK_EQ(0, fill);
1995 fill = Heap::GetFillToAlign(base + kPointerSize, kWordAligned); 1995 fill = Heap::GetFillToAlign(base + kPointerSize, kWordAligned);
1996 CHECK_EQ(0, fill); 1996 CHECK_EQ(0, fill);
1997 1997
1998 // No fill is required when address is double aligned. 1998 // No fill is required when address is double aligned.
1999 fill = Heap::GetFillToAlign(base, kDoubleAligned); 1999 fill = Heap::GetFillToAlign(base, kDoubleAligned);
(...skipping 4377 matching lines...) Expand 10 before | Expand all | Expand 10 after
6377 6377
6378 PrintF("Context size : %d bytes\n", measure.Size()); 6378 PrintF("Context size : %d bytes\n", measure.Size());
6379 PrintF("Context object count: %d\n", measure.Count()); 6379 PrintF("Context object count: %d\n", measure.Count());
6380 6380
6381 CHECK_LE(1000, measure.Count()); 6381 CHECK_LE(1000, measure.Count());
6382 CHECK_LE(50000, measure.Size()); 6382 CHECK_LE(50000, measure.Size());
6383 6383
6384 CHECK_LE(measure.Count(), count_upper_limit); 6384 CHECK_LE(measure.Count(), count_upper_limit);
6385 CHECK_LE(measure.Size(), size_upper_limit); 6385 CHECK_LE(measure.Size(), size_upper_limit);
6386 } 6386 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-i18n.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698