Index: test/cctest/heap/test-heap.cc |
diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc |
index a4cbed3d95007336897cff8e4af2293995fa9ff2..94dd1bb7741250e30987d9c7b2d586c60206eaa9 100644 |
--- a/test/cctest/heap/test-heap.cc |
+++ b/test/cctest/heap/test-heap.cc |
@@ -4766,17 +4766,19 @@ TEST(CellsInOptimizedCodeAreWeak) { |
LocalContext context; |
HandleScope scope(heap->isolate()); |
- CompileRun("bar = (function() {" |
- " function bar() {" |
- " return foo(1);" |
- " };" |
- " var foo = function(x) { with (x) { return 1 + x; } };" |
- " bar(foo);" |
- " bar(foo);" |
- " bar(foo);" |
- " %OptimizeFunctionOnNextCall(bar);" |
- " bar(foo);" |
- " return bar;})();"); |
+ CompileRun( |
+ "bar = (function() {" |
+ " function bar() {" |
+ " return foo(1);" |
+ " };" |
+ " var foo = function(x) { with (x) { return 1 + x; } };" |
+ " %NeverOptimizeFunction(foo);" |
+ " bar(foo);" |
+ " bar(foo);" |
+ " bar(foo);" |
+ " %OptimizeFunctionOnNextCall(bar);" |
+ " bar(foo);" |
+ " return bar;})();"); |
Handle<JSFunction> bar = Handle<JSFunction>::cast(v8::Utils::OpenHandle( |
*v8::Local<v8::Function>::Cast(CcTest::global() |
@@ -4809,15 +4811,17 @@ TEST(ObjectsInOptimizedCodeAreWeak) { |
LocalContext context; |
HandleScope scope(heap->isolate()); |
- CompileRun("function bar() {" |
- " return foo(1);" |
- "};" |
- "function foo(x) { with (x) { return 1 + x; } };" |
- "bar();" |
- "bar();" |
- "bar();" |
- "%OptimizeFunctionOnNextCall(bar);" |
- "bar();"); |
+ CompileRun( |
+ "function bar() {" |
+ " return foo(1);" |
+ "};" |
+ "function foo(x) { with (x) { return 1 + x; } };" |
+ "%NeverOptimizeFunction(foo);" |
+ "bar();" |
+ "bar();" |
+ "bar();" |
+ "%OptimizeFunctionOnNextCall(bar);" |
+ "bar();"); |
Handle<JSFunction> bar = Handle<JSFunction>::cast(v8::Utils::OpenHandle( |
*v8::Local<v8::Function>::Cast(CcTest::global() |