OLD | NEW |
---|---|
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 Loading... | |
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. |
Jakob Kummerow
2013/02/06 12:55:56
Yeah, I'm sure the GC stress bots were very unhapp
| |
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_ |
OLD | NEW |