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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 node->set_next(data->deoptimizing_code_list_); | 99 node->set_next(data->deoptimizing_code_list_); |
100 data->deoptimizing_code_list_ = node; | 100 data->deoptimizing_code_list_ = node; |
101 | 101 |
102 // We might be in the middle of incremental marking with compaction. | 102 // We might be in the middle of incremental marking with compaction. |
103 // Tell collector to treat this code object in a special way and | 103 // Tell collector to treat this code object in a special way and |
104 // ignore all slots that might have been recorded on it. | 104 // ignore all slots that might have been recorded on it. |
105 isolate->heap()->mark_compact_collector()->InvalidateCode(code); | 105 isolate->heap()->mark_compact_collector()->InvalidateCode(code); |
106 | 106 |
107 // Iterate over all the functions which share the same code object | 107 // Iterate over all the functions which share the same code object |
108 // and make them use unoptimized version. | 108 // and make them use unoptimized version. |
109 Context* context = function->context()->global_context(); | 109 Context* context = function->context()->native_context(); |
110 Object* element = context->get(Context::OPTIMIZED_FUNCTIONS_LIST); | 110 Object* element = context->get(Context::OPTIMIZED_FUNCTIONS_LIST); |
111 SharedFunctionInfo* shared = function->shared(); | 111 SharedFunctionInfo* shared = function->shared(); |
112 while (!element->IsUndefined()) { | 112 while (!element->IsUndefined()) { |
113 JSFunction* func = JSFunction::cast(element); | 113 JSFunction* func = JSFunction::cast(element); |
114 // Grab element before code replacement as ReplaceCode alters the list. | 114 // Grab element before code replacement as ReplaceCode alters the list. |
115 element = func->next_function_link(); | 115 element = func->next_function_link(); |
116 if (func->code() == code) { | 116 if (func->code() == code) { |
117 func->ReplaceCode(shared->code()); | 117 func->ReplaceCode(shared->code()); |
118 } | 118 } |
119 } | 119 } |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 } | 998 } |
999 __ bind(&done); | 999 __ bind(&done); |
1000 } | 1000 } |
1001 | 1001 |
1002 #undef __ | 1002 #undef __ |
1003 | 1003 |
1004 | 1004 |
1005 } } // namespace v8::internal | 1005 } } // namespace v8::internal |
1006 | 1006 |
1007 #endif // V8_TARGET_ARCH_X64 | 1007 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |