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

Unified Diff: test/cctest/test-heap.cc

Issue 307583002: Repairs to FLAG_pretenure_call_new. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Patch One. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/type-info.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 54ddff17500d67e2ff8e7fd542924856bc44da8c..34d8b9e7a4e0841342454e41e7ccca9f11684f63 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -2531,6 +2531,9 @@ TEST(OptimizedPretenuringConstructorCalls) {
v8::HandleScope scope(CcTest::isolate());
i::ScopedVector<char> source(1024);
+ // Call new is doing slack tracking for the first
+ // JSFunction::kGenerousAllocationCount allocations, and we can't find
+ // mementos during that time.
i::OS::SNPrintF(
source,
"var number_elements = %d;"
@@ -2549,7 +2552,8 @@ TEST(OptimizedPretenuringConstructorCalls) {
"f(); f();"
"%%OptimizeFunctionOnNextCall(f);"
"f();",
- AllocationSite::kPretenureMinimumCreated);
+ AllocationSite::kPretenureMinimumCreated +
+ JSFunction::kGenerousAllocationCount);
v8::Local<v8::Value> res = CompileRun(source.start());
@@ -2573,9 +2577,12 @@ TEST(OptimizedPretenuringCallNew) {
v8::HandleScope scope(CcTest::isolate());
i::ScopedVector<char> source(1024);
+ // Call new is doing slack tracking for the first
+ // JSFunction::kGenerousAllocationCount allocations, and we can't find
+ // mementos during that time.
i::OS::SNPrintF(
source,
- "var number_elements = 100;"
+ "var number_elements = %d;"
"var elements = new Array(number_elements);"
"function g() { this.a = 0; }"
"function f() {"
@@ -2588,7 +2595,8 @@ TEST(OptimizedPretenuringCallNew) {
"f(); f();"
"%%OptimizeFunctionOnNextCall(f);"
"f();",
- AllocationSite::kPretenureMinimumCreated);
+ AllocationSite::kPretenureMinimumCreated +
+ JSFunction::kGenerousAllocationCount);
v8::Local<v8::Value> res = CompileRun(source.start());
@@ -3803,7 +3811,7 @@ TEST(EnsureAllocationSiteDependentCodesProcessed) {
// Now make sure that a gc should get rid of the function, even though we
// still have the allocation site alive.
for (int i = 0; i < 4; i++) {
- heap->CollectAllGarbage(false);
+ heap->CollectAllGarbage(Heap::kNoGCFlags);
}
// The site still exists because of our global handle, but the code is no
« no previous file with comments | « src/type-info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698