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

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

Issue 429433003: DO NOT SUBMIT: Only for ES6 Collections try job (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix test-heap Created 6 years, 4 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 | « test/cctest/test-api.cc ('k') | test/cctest/test-heap-profiler.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 3002 matching lines...) Expand 10 before | Expand all | Expand 10 after
3013 CHECK_EQ(1, old_pointer_space->CountTotalPages()); 3013 CHECK_EQ(1, old_pointer_space->CountTotalPages());
3014 for (int i = 0; i < number_of_test_pages; i++) { 3014 for (int i = 0; i < number_of_test_pages; i++) {
3015 AlwaysAllocateScope always_allocate(isolate); 3015 AlwaysAllocateScope always_allocate(isolate);
3016 SimulateFullSpace(old_pointer_space); 3016 SimulateFullSpace(old_pointer_space);
3017 factory->NewFixedArray(1, TENURED); 3017 factory->NewFixedArray(1, TENURED);
3018 } 3018 }
3019 CHECK_EQ(number_of_test_pages + 1, old_pointer_space->CountTotalPages()); 3019 CHECK_EQ(number_of_test_pages + 1, old_pointer_space->CountTotalPages());
3020 3020
3021 // Triggering one GC will cause a lot of garbage to be discovered but 3021 // Triggering one GC will cause a lot of garbage to be discovered but
3022 // even spread across all allocated pages. 3022 // even spread across all allocated pages.
3023 heap->CollectAllGarbage(Heap::kNoGCFlags, "triggered for preparation"); 3023 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask,
3024 "triggered for preparation");
3024 CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages()); 3025 CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages());
3025 3026
3026 // Triggering subsequent GCs should cause at least half of the pages 3027 // Triggering subsequent GCs should cause at least half of the pages
3027 // to be released to the OS after at most two cycles. 3028 // to be released to the OS after at most two cycles.
3028 heap->CollectAllGarbage(Heap::kNoGCFlags, "triggered by test 1"); 3029 heap->CollectAllGarbage(Heap::kNoGCFlags, "triggered by test 1");
3029 CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages()); 3030 CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages());
3030 heap->CollectAllGarbage(Heap::kNoGCFlags, "triggered by test 2"); 3031 heap->CollectAllGarbage(Heap::kNoGCFlags, "triggered by test 2");
3031 CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages() * 2); 3032 CHECK_GE(number_of_test_pages + 1, old_pointer_space->CountTotalPages() * 2);
3032 3033
3033 // Triggering a last-resort GC should cause all pages to be released to the 3034 // Triggering a last-resort GC should cause all pages to be released to the
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
4496 #ifdef DEBUG 4497 #ifdef DEBUG
4497 TEST(PathTracer) { 4498 TEST(PathTracer) {
4498 CcTest::InitializeVM(); 4499 CcTest::InitializeVM();
4499 v8::HandleScope scope(CcTest::isolate()); 4500 v8::HandleScope scope(CcTest::isolate());
4500 4501
4501 v8::Local<v8::Value> result = CompileRun("'abc'"); 4502 v8::Local<v8::Value> result = CompileRun("'abc'");
4502 Handle<Object> o = v8::Utils::OpenHandle(*result); 4503 Handle<Object> o = v8::Utils::OpenHandle(*result);
4503 CcTest::i_isolate()->heap()->TracePathToObject(*o); 4504 CcTest::i_isolate()->heap()->TracePathToObject(*o);
4504 } 4505 }
4505 #endif // DEBUG 4506 #endif // DEBUG
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698