Index: test/cctest/test-mementos.cc |
diff --git a/test/cctest/test-mementos.cc b/test/cctest/test-mementos.cc |
index 4aee57c53e6257ced4f57b62b5be3bff9eab6cfd..a377b4a4c6f31c0a8139f3dc9d1ae95ee37de817 100644 |
--- a/test/cctest/test-mementos.cc |
+++ b/test/cctest/test-mementos.cc |
@@ -89,7 +89,10 @@ TEST(PretenuringCallNew) { |
Isolate* isolate = CcTest::i_isolate(); |
Heap* heap = isolate->heap(); |
+ // We need to create several instances to get past the slack-tracking |
+ // phase, where mementos aren't emitted. |
int call_count = 10; |
+ CHECK_GE(call_count, SharedFunctionInfo::kGenerousAllocationCount); |
i::ScopedVector<char> test_buf(1024); |
const char* program = |
"function f() {" |
@@ -114,8 +117,8 @@ TEST(PretenuringCallNew) { |
CHECK_EQ(memento->map(), heap->allocation_memento_map()); |
// Furthermore, how many mementos did we create? The count should match |
- // call_count. Note, that mementos are allocated during the inobject slack |
- // tracking phase. |
+ // call_count - SharedFunctionInfo::kGenerousAllocationCount. |
AllocationSite* site = memento->GetAllocationSite(); |
- CHECK_EQ(call_count, site->pretenure_create_count()->value()); |
+ CHECK_EQ(call_count - SharedFunctionInfo::kGenerousAllocationCount, |
+ site->pretenure_create_count()->value()); |
} |