OLD | NEW |
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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 } | 276 } |
277 | 277 |
278 | 278 |
279 static void GCEpilogueCallbackFunc() { | 279 static void GCEpilogueCallbackFunc() { |
280 CHECK(gc_starts == gc_ends + 1); | 280 CHECK(gc_starts == gc_ends + 1); |
281 gc_ends++; | 281 gc_ends++; |
282 } | 282 } |
283 | 283 |
284 | 284 |
285 TEST(GCCallback) { | 285 TEST(GCCallback) { |
| 286 i::FLAG_stress_compaction = false; |
286 CcTest::InitializeVM(); | 287 CcTest::InitializeVM(); |
287 | 288 |
288 HEAP->SetGlobalGCPrologueCallback(&GCPrologueCallbackFunc); | 289 HEAP->SetGlobalGCPrologueCallback(&GCPrologueCallbackFunc); |
289 HEAP->SetGlobalGCEpilogueCallback(&GCEpilogueCallbackFunc); | 290 HEAP->SetGlobalGCEpilogueCallback(&GCEpilogueCallbackFunc); |
290 | 291 |
291 // Scavenge does not call GC callback functions. | 292 // Scavenge does not call GC callback functions. |
292 HEAP->PerformScavenge(); | 293 HEAP->PerformScavenge(); |
293 | 294 |
294 CHECK_EQ(0, gc_starts); | 295 CHECK_EQ(0, gc_starts); |
295 CHECK_EQ(gc_ends, gc_starts); | 296 CHECK_EQ(gc_ends, gc_starts); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 if (v8::internal::Snapshot::IsEnabled()) { | 560 if (v8::internal::Snapshot::IsEnabled()) { |
560 CHECK_LE(delta, 2910 * 1024); | 561 CHECK_LE(delta, 2910 * 1024); |
561 } else { | 562 } else { |
562 CHECK_LE(delta, 3400 * 1024); | 563 CHECK_LE(delta, 3400 * 1024); |
563 } | 564 } |
564 } | 565 } |
565 } | 566 } |
566 } | 567 } |
567 | 568 |
568 #endif // __linux__ and !USE_SIMULATOR | 569 #endif // __linux__ and !USE_SIMULATOR |
OLD | NEW |