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

Side by Side Diff: test/cctest/cctest.h

Issue 12218034: Make the GC stress builder go green. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments. Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 } 235 }
236 236
237 237
238 // Pick a slightly different port to allow tests to be run in parallel. 238 // Pick a slightly different port to allow tests to be run in parallel.
239 static inline int FlagDependentPortOffset() { 239 static inline int FlagDependentPortOffset() {
240 return ::v8::internal::FLAG_crankshaft == false ? 100 : 240 return ::v8::internal::FLAG_crankshaft == false ? 100 :
241 ::v8::internal::FLAG_always_opt ? 200 : 0; 241 ::v8::internal::FLAG_always_opt ? 200 : 0;
242 } 242 }
243 243
244 244
245 // Helper function that simulates a fill new-space in the heap. 245 // Helper function that simulates a full new-space in the heap.
246 static inline void SimulateFullSpace(v8::internal::NewSpace* space) { 246 static inline void SimulateFullSpace(v8::internal::NewSpace* space) {
247 int new_linear_size = static_cast<int>( 247 int new_linear_size = static_cast<int>(
248 *space->allocation_limit_address() - *space->allocation_top_address()); 248 *space->allocation_limit_address() - *space->allocation_top_address());
249 v8::internal::MaybeObject* maybe = space->AllocateRaw(new_linear_size); 249 v8::internal::MaybeObject* maybe = space->AllocateRaw(new_linear_size);
250 v8::internal::FreeListNode* node = v8::internal::FreeListNode::cast(maybe); 250 v8::internal::FreeListNode* node = v8::internal::FreeListNode::cast(maybe);
251 node->set_size(space->heap(), new_linear_size); 251 node->set_size(space->heap(), new_linear_size);
252 } 252 }
253 253
254 254
255 // Helper function that simulates a full old-space in the heap. 255 // Helper function that simulates a full old-space in the heap.
256 static inline void SimulateFullSpace(v8::internal::PagedSpace* space) { 256 static inline void SimulateFullSpace(v8::internal::PagedSpace* space) {
257 int old_linear_size = static_cast<int>(space->limit() - space->top()); 257 int old_linear_size = static_cast<int>(space->limit() - space->top());
258 space->Free(space->top(), old_linear_size); 258 space->Free(space->top(), old_linear_size);
259 space->SetTop(space->limit(), space->limit()); 259 space->SetTop(space->limit(), space->limit());
260 space->ResetFreeList(); 260 space->ResetFreeList();
261 space->ClearStats(); 261 space->ClearStats();
262 } 262 }
263 263
264 264
265 #endif // ifndef CCTEST_H_ 265 #endif // ifndef CCTEST_H_
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698