| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 node->set_next(data->deoptimizing_code_list_); | 95 node->set_next(data->deoptimizing_code_list_); |
| 96 data->deoptimizing_code_list_ = node; | 96 data->deoptimizing_code_list_ = node; |
| 97 | 97 |
| 98 // We might be in the middle of incremental marking with compaction. | 98 // We might be in the middle of incremental marking with compaction. |
| 99 // Tell collector to treat this code object in a special way and | 99 // Tell collector to treat this code object in a special way and |
| 100 // ignore all slots that might have been recorded on it. | 100 // ignore all slots that might have been recorded on it. |
| 101 isolate->heap()->mark_compact_collector()->InvalidateCode(code); | 101 isolate->heap()->mark_compact_collector()->InvalidateCode(code); |
| 102 | 102 |
| 103 // Iterate over all the functions which share the same code object | 103 // Iterate over all the functions which share the same code object |
| 104 // and make them use unoptimized version. | 104 // and make them use unoptimized version. |
| 105 Context* context = function->context()->global_context(); | 105 Context* context = function->context()->native_context(); |
| 106 Object* element = context->get(Context::OPTIMIZED_FUNCTIONS_LIST); | 106 Object* element = context->get(Context::OPTIMIZED_FUNCTIONS_LIST); |
| 107 SharedFunctionInfo* shared = function->shared(); | 107 SharedFunctionInfo* shared = function->shared(); |
| 108 while (!element->IsUndefined()) { | 108 while (!element->IsUndefined()) { |
| 109 JSFunction* func = JSFunction::cast(element); | 109 JSFunction* func = JSFunction::cast(element); |
| 110 // Grab element before code replacement as ReplaceCode alters the list. | 110 // Grab element before code replacement as ReplaceCode alters the list. |
| 111 element = func->next_function_link(); | 111 element = func->next_function_link(); |
| 112 if (func->code() == code) { | 112 if (func->code() == code) { |
| 113 func->ReplaceCode(shared->code()); | 113 func->ReplaceCode(shared->code()); |
| 114 } | 114 } |
| 115 } | 115 } |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 } | 1015 } |
| 1016 | 1016 |
| 1017 ASSERT_EQ(masm()->SizeOfCodeGeneratedSince(&table_start), | 1017 ASSERT_EQ(masm()->SizeOfCodeGeneratedSince(&table_start), |
| 1018 count() * table_entry_size_); | 1018 count() * table_entry_size_); |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 #undef __ | 1021 #undef __ |
| 1022 | 1022 |
| 1023 | 1023 |
| 1024 } } // namespace v8::internal | 1024 } } // namespace v8::internal |
| OLD | NEW |