OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 5458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5469 static int sTraceLazy; | 5469 static int sTraceLazy; |
5470 }; | 5470 }; |
5471 | 5471 |
5472 int DeepEagerly::sTraceCalls = 0; | 5472 int DeepEagerly::sTraceCalls = 0; |
5473 int DeepEagerly::sTraceLazy = 0; | 5473 int DeepEagerly::sTraceLazy = 0; |
5474 | 5474 |
5475 TEST(HeapTest, TraceDeepEagerly) | 5475 TEST(HeapTest, TraceDeepEagerly) |
5476 { | 5476 { |
5477 #if !ENABLE(ASSERT) | 5477 #if !ENABLE(ASSERT) |
5478 DeepEagerly* obj = nullptr; | 5478 DeepEagerly* obj = nullptr; |
5479 for (int i = 0; i < 10000; i++) | 5479 for (int i = 0; i < 2000000; i++) |
5480 obj = new DeepEagerly(obj); | 5480 obj = new DeepEagerly(obj); |
5481 | 5481 |
5482 Persistent<DeepEagerly> persistent(obj); | 5482 Persistent<DeepEagerly> persistent(obj); |
5483 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); | 5483 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); |
5484 | 5484 |
5485 // Verify that the DeepEagerly chain isn't completely unravelled | 5485 // Verify that the DeepEagerly chain isn't completely unravelled |
5486 // by performing eager trace() calls, but the explicit mark | 5486 // by performing eager trace() calls, but the explicit mark |
5487 // stack is switched once some nesting limit is exceeded. | 5487 // stack is switched once some nesting limit is exceeded. |
5488 EXPECT_GT(DeepEagerly::sTraceLazy, 2); | 5488 EXPECT_GT(DeepEagerly::sTraceLazy, 2); |
5489 #endif | 5489 #endif |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5565 | 5565 |
5566 TEST(HeapTest, StackGrowthDirection) | 5566 TEST(HeapTest, StackGrowthDirection) |
5567 { | 5567 { |
5568 // The implementation of marking probes stack usage as it runs, | 5568 // The implementation of marking probes stack usage as it runs, |
5569 // and has a builtin assumption that the stack grows towards | 5569 // and has a builtin assumption that the stack grows towards |
5570 // lower addresses. | 5570 // lower addresses. |
5571 EXPECT_EQ(GrowsTowardsLower, stackGrowthDirection()); | 5571 EXPECT_EQ(GrowsTowardsLower, stackGrowthDirection()); |
5572 } | 5572 } |
5573 | 5573 |
5574 } // namespace blink | 5574 } // namespace blink |
OLD | NEW |