Chromium Code Reviews| Index: test/cctest/test-heap.cc |
| diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
| index be1098cc4c3877b8c3734a4ba4da99bea9c8509a..2ce341ecd54213f63229cd7e1ee2e3f69510568c 100644 |
| --- a/test/cctest/test-heap.cc |
| +++ b/test/cctest/test-heap.cc |
| @@ -1342,17 +1342,22 @@ TEST(TestInternalWeakLists) { |
| "function f4() { };" |
| "function f5() { };"; |
| CompileRun(source); |
| - CHECK_EQ(0, CountOptimizedUserFunctions(ctx[i])); |
| + int optimized_user_functions_base = CountOptimizedUserFunctions(ctx[i]); |
|
Michael Starzinger
2013/07/05 12:28:46
Can we move up getting the base number of optimize
|
| CompileRun("f1()"); |
| - CHECK_EQ(opt ? 1 : 0, CountOptimizedUserFunctions(ctx[i])); |
| + CHECK_EQ(opt ? optimized_user_functions_base + 1 : 0, |
| + CountOptimizedUserFunctions(ctx[i])); |
| CompileRun("f2()"); |
| - CHECK_EQ(opt ? 2 : 0, CountOptimizedUserFunctions(ctx[i])); |
| + CHECK_EQ(opt ? optimized_user_functions_base + 2 : 0, |
| + CountOptimizedUserFunctions(ctx[i])); |
| CompileRun("f3()"); |
| - CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[i])); |
| + CHECK_EQ(opt ? optimized_user_functions_base + 3 : 0, |
| + CountOptimizedUserFunctions(ctx[i])); |
| CompileRun("f4()"); |
| - CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctions(ctx[i])); |
| + CHECK_EQ(opt ? optimized_user_functions_base + 4 : 0, |
| + CountOptimizedUserFunctions(ctx[i])); |
| CompileRun("f5()"); |
| - CHECK_EQ(opt ? 5 : 0, CountOptimizedUserFunctions(ctx[i])); |
| + CHECK_EQ(opt ? optimized_user_functions_base + 5 : 0, |
| + CountOptimizedUserFunctions(ctx[i])); |
| // Remove function f1, and |
| CompileRun("f1=null"); |
| @@ -1360,29 +1365,35 @@ TEST(TestInternalWeakLists) { |
| // Scavenge treats these references as strong. |
| for (int j = 0; j < 10; j++) { |
| HEAP->PerformScavenge(); |
| - CHECK_EQ(opt ? 5 : 0, CountOptimizedUserFunctions(ctx[i])); |
| + CHECK_EQ(opt ? optimized_user_functions_base + 5 : 0, |
| + CountOptimizedUserFunctions(ctx[i])); |
| } |
| // Mark compact handles the weak references. |
| isolate->compilation_cache()->Clear(); |
| heap->CollectAllGarbage(Heap::kNoGCFlags); |
| - CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctions(ctx[i])); |
| + CHECK_EQ(opt ? optimized_user_functions_base + 4 : 0, |
| + CountOptimizedUserFunctions(ctx[i])); |
| // Get rid of f3 and f5 in the same way. |
| CompileRun("f3=null"); |
| for (int j = 0; j < 10; j++) { |
| HEAP->PerformScavenge(); |
| - CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctions(ctx[i])); |
| + CHECK_EQ(opt ? optimized_user_functions_base + 4 : 0, |
| + CountOptimizedUserFunctions(ctx[i])); |
| } |
| HEAP->CollectAllGarbage(Heap::kNoGCFlags); |
| - CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[i])); |
| + CHECK_EQ(opt ? optimized_user_functions_base + 3 : 0, |
| + CountOptimizedUserFunctions(ctx[i])); |
| CompileRun("f5=null"); |
| for (int j = 0; j < 10; j++) { |
| HEAP->PerformScavenge(); |
| - CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[i])); |
| + CHECK_EQ(opt ? optimized_user_functions_base + 3 : 0, |
| + CountOptimizedUserFunctions(ctx[i])); |
| } |
| HEAP->CollectAllGarbage(Heap::kNoGCFlags); |
| - CHECK_EQ(opt ? 2 : 0, CountOptimizedUserFunctions(ctx[i])); |
| + CHECK_EQ(opt ? optimized_user_functions_base + 2 : 0, |
| + CountOptimizedUserFunctions(ctx[i])); |
| ctx[i]->Exit(); |
| } |