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

Side by Side Diff: test/cctest/heap/test-heap.cc

Issue 1670143002: Visit the Optimized Code Map on first call rather than closure creation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed overly-restrictive assert. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « test/cctest/cctest.status ('k') | test/cctest/test-compiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 Handle<Object> f_value = 1539 Handle<Object> f_value =
1540 Object::GetProperty(isolate->global_object(), f_name).ToHandleChecked(); 1540 Object::GetProperty(isolate->global_object(), f_name).ToHandleChecked();
1541 Handle<JSFunction> f_function = Handle<JSFunction>::cast(f_value); 1541 Handle<JSFunction> f_function = Handle<JSFunction>::cast(f_value);
1542 CHECK(f_function->is_compiled()); 1542 CHECK(f_function->is_compiled());
1543 1543
1544 // Check g is not compiled. 1544 // Check g is not compiled.
1545 Handle<String> g_name = factory->InternalizeUtf8String("g"); 1545 Handle<String> g_name = factory->InternalizeUtf8String("g");
1546 Handle<Object> g_value = 1546 Handle<Object> g_value =
1547 Object::GetProperty(isolate->global_object(), g_name).ToHandleChecked(); 1547 Object::GetProperty(isolate->global_object(), g_name).ToHandleChecked();
1548 Handle<JSFunction> g_function = Handle<JSFunction>::cast(g_value); 1548 Handle<JSFunction> g_function = Handle<JSFunction>::cast(g_value);
1549 // TODO(mvstanton): change to check that g is *not* compiled when optimized 1549 CHECK(!g_function->is_compiled());
1550 // cache
1551 // map lookup moves to the compile lazy builtin.
1552 CHECK(g_function->is_compiled());
1553 1550
1554 SimulateIncrementalMarking(heap); 1551 SimulateIncrementalMarking(heap);
1555 CompileRun("%OptimizeFunctionOnNextCall(f); f();"); 1552 CompileRun("%OptimizeFunctionOnNextCall(f); f();");
1556 1553
1557 // g should now have available an optimized function, unmarked by gc. The 1554 // g should now have available an optimized function, unmarked by gc. The
1558 // CompileLazy built-in will discover it and install it in the closure, and 1555 // CompileLazy built-in will discover it and install it in the closure, and
1559 // the incremental write barrier should be used. 1556 // the incremental write barrier should be used.
1560 CompileRun("g();"); 1557 CompileRun("g();");
1561 CHECK(g_function->is_compiled()); 1558 CHECK(g_function->is_compiled());
1562 } 1559 }
(...skipping 5042 matching lines...) Expand 10 before | Expand all | Expand 10 after
6605 heap->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>(arrays[j], N - 1); 6602 heap->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>(arrays[j], N - 1);
6606 } 6603 }
6607 } 6604 }
6608 // Force allocation from the free list. 6605 // Force allocation from the free list.
6609 heap->set_force_oom(true); 6606 heap->set_force_oom(true);
6610 heap->CollectGarbage(OLD_SPACE); 6607 heap->CollectGarbage(OLD_SPACE);
6611 } 6608 }
6612 6609
6613 } // namespace internal 6610 } // namespace internal
6614 } // namespace v8 6611 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/cctest.status ('k') | test/cctest/test-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698