OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |