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

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

Issue 1506753002: [test] Test expectations in cctest should use CHECK and not DCHECK. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « test/cctest/compiler/test-run-bytecode-graph-builder.cc ('k') | test/cctest/test-api.cc » ('j') | 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 heap->AllocateByteArray(100, TENURED).ToObjectChecked(); 59 heap->AllocateByteArray(100, TENURED).ToObjectChecked();
60 60
61 // Old pointer space. 61 // Old pointer space.
62 SimulateFullSpace(heap->old_space()); 62 SimulateFullSpace(heap->old_space());
63 heap->AllocateFixedArray(10000, TENURED).ToObjectChecked(); 63 heap->AllocateFixedArray(10000, TENURED).ToObjectChecked();
64 64
65 // Large object space. 65 // Large object space.
66 static const int kLargeObjectSpaceFillerLength = 3 * (Page::kPageSize / 10); 66 static const int kLargeObjectSpaceFillerLength = 3 * (Page::kPageSize / 10);
67 static const int kLargeObjectSpaceFillerSize = FixedArray::SizeFor( 67 static const int kLargeObjectSpaceFillerSize = FixedArray::SizeFor(
68 kLargeObjectSpaceFillerLength); 68 kLargeObjectSpaceFillerLength);
69 DCHECK(kLargeObjectSpaceFillerSize > heap->old_space()->AreaSize()); 69 CHECK(kLargeObjectSpaceFillerSize > heap->old_space()->AreaSize());
70 while (heap->OldGenerationSpaceAvailable() > kLargeObjectSpaceFillerSize) { 70 while (heap->OldGenerationSpaceAvailable() > kLargeObjectSpaceFillerSize) {
71 heap->AllocateFixedArray( 71 heap->AllocateFixedArray(
72 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked(); 72 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked();
73 } 73 }
74 heap->AllocateFixedArray( 74 heap->AllocateFixedArray(
75 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked(); 75 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked();
76 76
77 // Map space. 77 // Map space.
78 SimulateFullSpace(heap->map_space()); 78 SimulateFullSpace(heap->map_space());
79 int instance_size = JSObject::kHeaderSize; 79 int instance_size = JSObject::kHeaderSize;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 Handle<JSFunction> function = factory->NewFunction( 145 Handle<JSFunction> function = factory->NewFunction(
146 factory->function_string()); 146 factory->function_string());
147 // Force the creation of an initial map and set the code to 147 // Force the creation of an initial map and set the code to
148 // something empty. 148 // something empty.
149 factory->NewJSObject(function); 149 factory->NewJSObject(function);
150 function->ReplaceCode(CcTest::i_isolate()->builtins()->builtin( 150 function->ReplaceCode(CcTest::i_isolate()->builtins()->builtin(
151 Builtins::kEmptyFunction)); 151 Builtins::kEmptyFunction));
152 // Patch the map to have an accessor for "get". 152 // Patch the map to have an accessor for "get".
153 Handle<Map> map(function->initial_map()); 153 Handle<Map> map(function->initial_map());
154 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors()); 154 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors());
155 DCHECK(instance_descriptors->IsEmpty()); 155 CHECK(instance_descriptors->IsEmpty());
156 156
157 PropertyAttributes attrs = NONE; 157 PropertyAttributes attrs = NONE;
158 Handle<AccessorInfo> foreign = TestAccessorInfo(isolate, attrs); 158 Handle<AccessorInfo> foreign = TestAccessorInfo(isolate, attrs);
159 Map::EnsureDescriptorSlack(map, 1); 159 Map::EnsureDescriptorSlack(map, 1);
160 160
161 AccessorConstantDescriptor d(Handle<Name>(Name::cast(foreign->name())), 161 AccessorConstantDescriptor d(Handle<Name>(Name::cast(foreign->name())),
162 foreign, attrs); 162 foreign, attrs);
163 map->AppendDescriptor(&d); 163 map->AppendDescriptor(&d);
164 164
165 // Add the Foo constructor the global object. 165 // Add the Foo constructor the global object.
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 code_range.FreeRawMemory(blocks[index].base, blocks[index].size); 247 code_range.FreeRawMemory(blocks[index].base, blocks[index].size);
248 current_allocated -= blocks[index].size; 248 current_allocated -= blocks[index].size;
249 if (index < blocks.length() - 1) { 249 if (index < blocks.length() - 1) {
250 blocks[index] = blocks.RemoveLast(); 250 blocks[index] = blocks.RemoveLast();
251 } else { 251 } else {
252 blocks.RemoveLast(); 252 blocks.RemoveLast();
253 } 253 }
254 } 254 }
255 } 255 }
256 } 256 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-run-bytecode-graph-builder.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698