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

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

Issue 259173003: Kiss goodbye to MaybeObject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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
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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 return ::v8::internal::FLAG_crankshaft == false ? 100 : 390 return ::v8::internal::FLAG_crankshaft == false ? 100 :
391 ::v8::internal::FLAG_always_opt ? 200 : 0; 391 ::v8::internal::FLAG_always_opt ? 200 : 0;
392 } 392 }
393 393
394 394
395 // Helper function that simulates a full new-space in the heap. 395 // Helper function that simulates a full new-space in the heap.
396 static inline void SimulateFullSpace(v8::internal::NewSpace* space) { 396 static inline void SimulateFullSpace(v8::internal::NewSpace* space) {
397 int new_linear_size = static_cast<int>( 397 int new_linear_size = static_cast<int>(
398 *space->allocation_limit_address() - *space->allocation_top_address()); 398 *space->allocation_limit_address() - *space->allocation_top_address());
399 if (new_linear_size == 0) return; 399 if (new_linear_size == 0) return;
400 v8::internal::MaybeObject* maybe = space->AllocateRaw(new_linear_size); 400 v8::internal::AllocationResult allocation =
401 v8::internal::FreeListNode* node = v8::internal::FreeListNode::cast(maybe); 401 space->AllocateRaw(new_linear_size);
402 v8::internal::FreeListNode* node =
403 v8::internal::FreeListNode::cast(allocation.ToObjectChecked());
402 node->set_size(space->heap(), new_linear_size); 404 node->set_size(space->heap(), new_linear_size);
403 } 405 }
404 406
405 407
406 // Helper function that simulates a full old-space in the heap. 408 // Helper function that simulates a full old-space in the heap.
407 static inline void SimulateFullSpace(v8::internal::PagedSpace* space) { 409 static inline void SimulateFullSpace(v8::internal::PagedSpace* space) {
408 space->EmptyAllocationInfo(); 410 space->EmptyAllocationInfo();
409 space->ResetFreeList(); 411 space->ResetFreeList();
410 space->ClearStats(); 412 space->ClearStats();
411 } 413 }
(...skipping 15 matching lines...) Expand all
427 CHECK_EQ(0, heap_profiler_->heap_object_map()->FindUntrackedObjects()); 429 CHECK_EQ(0, heap_profiler_->heap_object_map()->FindUntrackedObjects());
428 heap_profiler_->StopHeapObjectsTracking(); 430 heap_profiler_->StopHeapObjectsTracking();
429 } 431 }
430 432
431 private: 433 private:
432 i::HeapProfiler* heap_profiler_; 434 i::HeapProfiler* heap_profiler_;
433 }; 435 };
434 436
435 437
436 #endif // ifndef CCTEST_H_ 438 #endif // ifndef CCTEST_H_
OLDNEW
« src/v8globals.h ('K') | « src/v8globals.h ('k') | test/cctest/test-alloc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698