| 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 return ::v8::internal::FLAG_crankshaft == false ? 100 : | 408 return ::v8::internal::FLAG_crankshaft == false ? 100 : |
| 409 ::v8::internal::FLAG_always_opt ? 200 : 0; | 409 ::v8::internal::FLAG_always_opt ? 200 : 0; |
| 410 } | 410 } |
| 411 | 411 |
| 412 | 412 |
| 413 // Helper function that simulates a full new-space in the heap. | 413 // Helper function that simulates a full new-space in the heap. |
| 414 static inline void SimulateFullSpace(v8::internal::NewSpace* space) { | 414 static inline void SimulateFullSpace(v8::internal::NewSpace* space) { |
| 415 int new_linear_size = static_cast<int>( | 415 int new_linear_size = static_cast<int>( |
| 416 *space->allocation_limit_address() - *space->allocation_top_address()); | 416 *space->allocation_limit_address() - *space->allocation_top_address()); |
| 417 if (new_linear_size == 0) return; | 417 if (new_linear_size == 0) return; |
| 418 v8::internal::MaybeObject* maybe = space->AllocateRaw(new_linear_size); | 418 v8::internal::AllocationResult allocation = |
| 419 v8::internal::FreeListNode* node = v8::internal::FreeListNode::cast(maybe); | 419 space->AllocateRaw(new_linear_size); |
| 420 v8::internal::FreeListNode* node = |
| 421 v8::internal::FreeListNode::cast(allocation.ToObjectChecked()); |
| 420 node->set_size(space->heap(), new_linear_size); | 422 node->set_size(space->heap(), new_linear_size); |
| 421 } | 423 } |
| 422 | 424 |
| 423 | 425 |
| 424 // Helper function that simulates a full old-space in the heap. | 426 // Helper function that simulates a full old-space in the heap. |
| 425 static inline void SimulateFullSpace(v8::internal::PagedSpace* space) { | 427 static inline void SimulateFullSpace(v8::internal::PagedSpace* space) { |
| 426 space->EmptyAllocationInfo(); | 428 space->EmptyAllocationInfo(); |
| 427 space->ResetFreeList(); | 429 space->ResetFreeList(); |
| 428 space->ClearStats(); | 430 space->ClearStats(); |
| 429 } | 431 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 445 CHECK_EQ(0, heap_profiler_->heap_object_map()->FindUntrackedObjects()); | 447 CHECK_EQ(0, heap_profiler_->heap_object_map()->FindUntrackedObjects()); |
| 446 heap_profiler_->StopHeapObjectsTracking(); | 448 heap_profiler_->StopHeapObjectsTracking(); |
| 447 } | 449 } |
| 448 | 450 |
| 449 private: | 451 private: |
| 450 i::HeapProfiler* heap_profiler_; | 452 i::HeapProfiler* heap_profiler_; |
| 451 }; | 453 }; |
| 452 | 454 |
| 453 | 455 |
| 454 #endif // ifndef CCTEST_H_ | 456 #endif // ifndef CCTEST_H_ |
| OLD | NEW |