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

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

Issue 1148633005: Uncommit and shrink semi-spaces only on low allocation rate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/heap/spaces.h ('k') | no next file » | 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 5533 matching lines...) Expand 10 before | Expand all | Expand 10 after
5544 Isolate* isolate = CcTest::i_isolate(); 5544 Isolate* isolate = CcTest::i_isolate();
5545 Heap* heap = isolate->heap(); 5545 Heap* heap = isolate->heap();
5546 GCTracer* tracer = heap->tracer(); 5546 GCTracer* tracer = heap->tracer();
5547 int time1 = 100; 5547 int time1 = 100;
5548 size_t counter1 = 1000; 5548 size_t counter1 = 1000;
5549 tracer->SampleNewSpaceAllocation(time1, counter1); 5549 tracer->SampleNewSpaceAllocation(time1, counter1);
5550 int time2 = 200; 5550 int time2 = 200;
5551 size_t counter2 = 2000; 5551 size_t counter2 = 2000;
5552 tracer->SampleNewSpaceAllocation(time2, counter2); 5552 tracer->SampleNewSpaceAllocation(time2, counter2);
5553 size_t bytes = tracer->NewSpaceAllocatedBytesInLast(1000); 5553 size_t bytes = tracer->NewSpaceAllocatedBytesInLast(1000);
5554 CHECK_EQ(0, bytes); 5554 CHECK_EQ(10000, bytes);
5555 int time3 = 1000; 5555 int time3 = 1000;
5556 size_t counter3 = 30000; 5556 size_t counter3 = 30000;
5557 tracer->SampleNewSpaceAllocation(time3, counter3); 5557 tracer->SampleNewSpaceAllocation(time3, counter3);
5558 bytes = tracer->NewSpaceAllocatedBytesInLast(100); 5558 bytes = tracer->NewSpaceAllocatedBytesInLast(100);
5559 CHECK_EQ((counter3 - counter1) * 100 / (time3 - time1), bytes); 5559 CHECK_EQ((counter3 - counter1) * 100 / (time3 - time1), bytes);
5560 } 5560 }
OLDNEW
« no previous file with comments | « src/heap/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698