| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 node->set_next(data->deoptimizing_code_list_); | 193 node->set_next(data->deoptimizing_code_list_); |
| 194 data->deoptimizing_code_list_ = node; | 194 data->deoptimizing_code_list_ = node; |
| 195 | 195 |
| 196 // We might be in the middle of incremental marking with compaction. | 196 // We might be in the middle of incremental marking with compaction. |
| 197 // Tell collector to treat this code object in a special way and | 197 // Tell collector to treat this code object in a special way and |
| 198 // ignore all slots that might have been recorded on it. | 198 // ignore all slots that might have been recorded on it. |
| 199 isolate->heap()->mark_compact_collector()->InvalidateCode(code); | 199 isolate->heap()->mark_compact_collector()->InvalidateCode(code); |
| 200 | 200 |
| 201 // Iterate over all the functions which share the same code object | 201 // Iterate over all the functions which share the same code object |
| 202 // and make them use unoptimized version. | 202 // and make them use unoptimized version. |
| 203 Context* context = function->context()->global_context(); | 203 Context* context = function->context()->native_context(); |
| 204 Object* element = context->get(Context::OPTIMIZED_FUNCTIONS_LIST); | 204 Object* element = context->get(Context::OPTIMIZED_FUNCTIONS_LIST); |
| 205 SharedFunctionInfo* shared = function->shared(); | 205 SharedFunctionInfo* shared = function->shared(); |
| 206 while (!element->IsUndefined()) { | 206 while (!element->IsUndefined()) { |
| 207 JSFunction* func = JSFunction::cast(element); | 207 JSFunction* func = JSFunction::cast(element); |
| 208 // Grab element before code replacement as ReplaceCode alters the list. | 208 // Grab element before code replacement as ReplaceCode alters the list. |
| 209 element = func->next_function_link(); | 209 element = func->next_function_link(); |
| 210 if (func->code() == code) { | 210 if (func->code() == code) { |
| 211 func->ReplaceCode(shared->code()); | 211 func->ReplaceCode(shared->code()); |
| 212 } | 212 } |
| 213 } | 213 } |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 } | 1094 } |
| 1095 __ bind(&done); | 1095 __ bind(&done); |
| 1096 } | 1096 } |
| 1097 | 1097 |
| 1098 #undef __ | 1098 #undef __ |
| 1099 | 1099 |
| 1100 | 1100 |
| 1101 } } // namespace v8::internal | 1101 } } // namespace v8::internal |
| 1102 | 1102 |
| 1103 #endif // V8_TARGET_ARCH_IA32 | 1103 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |