| 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 CHECK(!g_function->is_compiled()); | 1549 // TODO(mvstanton): change to check that g is *not* compiled when optimized |
| 1550 // cache |
| 1551 // map lookup moves to the compile lazy builtin. |
| 1552 CHECK(g_function->is_compiled()); |
| 1550 | 1553 |
| 1551 SimulateIncrementalMarking(heap); | 1554 SimulateIncrementalMarking(heap); |
| 1552 CompileRun("%OptimizeFunctionOnNextCall(f); f();"); | 1555 CompileRun("%OptimizeFunctionOnNextCall(f); f();"); |
| 1553 | 1556 |
| 1554 // g should now have available an optimized function, unmarked by gc. The | 1557 // g should now have available an optimized function, unmarked by gc. The |
| 1555 // CompileLazy built-in will discover it and install it in the closure, and | 1558 // CompileLazy built-in will discover it and install it in the closure, and |
| 1556 // the incremental write barrier should be used. | 1559 // the incremental write barrier should be used. |
| 1557 CompileRun("g();"); | 1560 CompileRun("g();"); |
| 1558 CHECK(g_function->is_compiled()); | 1561 CHECK(g_function->is_compiled()); |
| 1559 } | 1562 } |
| (...skipping 5038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6598 heap->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>(arrays[j], N - 1); | 6601 heap->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>(arrays[j], N - 1); |
| 6599 } | 6602 } |
| 6600 } | 6603 } |
| 6601 // Force allocation from the free list. | 6604 // Force allocation from the free list. |
| 6602 heap->set_force_oom(true); | 6605 heap->set_force_oom(true); |
| 6603 heap->CollectGarbage(OLD_SPACE); | 6606 heap->CollectGarbage(OLD_SPACE); |
| 6604 } | 6607 } |
| 6605 | 6608 |
| 6606 } // namespace internal | 6609 } // namespace internal |
| 6607 } // namespace v8 | 6610 } // namespace v8 |
| OLD | NEW |