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 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2053 | 2053 |
2054 // Scan the heap for all non-optimized functions which have no | 2054 // Scan the heap for all non-optimized functions which have no |
2055 // debug break slots and are not active or inlined into an active | 2055 // debug break slots and are not active or inlined into an active |
2056 // function and mark them for lazy compilation. | 2056 // function and mark them for lazy compilation. |
2057 HeapIterator iterator(heap); | 2057 HeapIterator iterator(heap); |
2058 HeapObject* obj = NULL; | 2058 HeapObject* obj = NULL; |
2059 while (((obj = iterator.next()) != NULL)) { | 2059 while (((obj = iterator.next()) != NULL)) { |
2060 if (obj->IsJSFunction()) { | 2060 if (obj->IsJSFunction()) { |
2061 JSFunction* function = JSFunction::cast(obj); | 2061 JSFunction* function = JSFunction::cast(obj); |
2062 SharedFunctionInfo* shared = function->shared(); | 2062 SharedFunctionInfo* shared = function->shared(); |
2063 if (shared->allows_lazy_compilation() && | 2063 |
2064 shared->script()->IsScript() && | 2064 if (!shared->allows_lazy_compilation()) continue; |
2065 function->code()->kind() == Code::FUNCTION && | 2065 if (!shared->script()->IsScript()) continue; |
2066 !function->code()->has_debug_break_slots() && | 2066 if (shared->code()->gc_metadata() == active_code_marker) continue; |
2067 shared->code()->gc_metadata() != active_code_marker) { | 2067 |
| 2068 Code::Kind kind = function->code()->kind(); |
| 2069 if (kind == Code::FUNCTION && |
| 2070 !function->code()->has_debug_break_slots()) { |
2068 function->set_code(*lazy_compile); | 2071 function->set_code(*lazy_compile); |
2069 function->shared()->set_code(*lazy_compile); | 2072 function->shared()->set_code(*lazy_compile); |
| 2073 } else if (kind == Code::BUILTIN && |
| 2074 (function->IsMarkedForInstallingRecompiledCode() || |
| 2075 function->IsInRecompileQueue() || |
| 2076 function->IsMarkedForLazyRecompilation() || |
| 2077 function->IsMarkedForParallelRecompilation())) { |
| 2078 // Abort in-flight compilation. |
| 2079 Code* shared_code = function->shared()->code(); |
| 2080 if (shared_code->kind() == Code::FUNCTION && |
| 2081 shared_code->has_debug_break_slots()) { |
| 2082 function->set_code(shared_code); |
| 2083 } else { |
| 2084 function->set_code(*lazy_compile); |
| 2085 function->shared()->set_code(*lazy_compile); |
| 2086 } |
2070 } | 2087 } |
2071 } | 2088 } |
2072 } | 2089 } |
2073 | 2090 |
2074 // Clear gc_metadata field. | 2091 // Clear gc_metadata field. |
2075 for (int i = 0; i < active_functions.length(); i++) { | 2092 for (int i = 0; i < active_functions.length(); i++) { |
2076 Handle<JSFunction> function = active_functions[i]; | 2093 Handle<JSFunction> function = active_functions[i]; |
2077 function->shared()->code()->set_gc_metadata(Smi::FromInt(0)); | 2094 function->shared()->code()->set_gc_metadata(Smi::FromInt(0)); |
2078 } | 2095 } |
2079 } | 2096 } |
(...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3814 { | 3831 { |
3815 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); | 3832 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); |
3816 isolate_->debugger()->CallMessageDispatchHandler(); | 3833 isolate_->debugger()->CallMessageDispatchHandler(); |
3817 } | 3834 } |
3818 } | 3835 } |
3819 } | 3836 } |
3820 | 3837 |
3821 #endif // ENABLE_DEBUGGER_SUPPORT | 3838 #endif // ENABLE_DEBUGGER_SUPPORT |
3822 | 3839 |
3823 } } // namespace v8::internal | 3840 } } // namespace v8::internal |
OLD | NEW |