Chromium Code Reviews| 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 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 inline static bool IsFlushable(Heap* heap, JSFunction* function) { | 1007 inline static bool IsFlushable(Heap* heap, JSFunction* function) { |
| 1008 SharedFunctionInfo* shared_info = function->unchecked_shared(); | 1008 SharedFunctionInfo* shared_info = function->unchecked_shared(); |
| 1009 | 1009 |
| 1010 // Code is either on stack, in compilation cache or referenced | 1010 // Code is either on stack, in compilation cache or referenced |
| 1011 // by optimized version of function. | 1011 // by optimized version of function. |
| 1012 MarkBit code_mark = | 1012 MarkBit code_mark = |
| 1013 Marking::MarkBitFrom(function->unchecked_code()); | 1013 Marking::MarkBitFrom(function->unchecked_code()); |
| 1014 if (code_mark.Get()) { | 1014 if (code_mark.Get()) { |
| 1015 shared_info->set_code_age(0); | 1015 if (!Marking::MarkBitFrom(shared_info).Get()) { |
|
ulan
2011/11/21 17:36:15
Do not reset the code age if the shared info visit
| |
| 1016 shared_info->set_code_age(0); | |
| 1017 } | |
| 1016 return false; | 1018 return false; |
| 1017 } | 1019 } |
| 1018 | 1020 |
| 1019 // We do not flush code for optimized functions. | 1021 // We do not flush code for optimized functions. |
| 1020 if (function->code() != shared_info->unchecked_code()) { | 1022 if (function->code() != shared_info->unchecked_code()) { |
| 1021 return false; | 1023 return false; |
| 1022 } | 1024 } |
| 1023 | 1025 |
| 1024 return IsFlushable(heap, shared_info); | 1026 return IsFlushable(heap, shared_info); |
| 1025 } | 1027 } |
| 1026 | 1028 |
| 1027 inline static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info) { | 1029 inline static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info) { |
| 1028 // Code is either on stack, in compilation cache or referenced | 1030 // Code is either on stack, in compilation cache or referenced |
| 1029 // by optimized version of function. | 1031 // by optimized version of function. |
| 1030 MarkBit code_mark = | 1032 MarkBit code_mark = |
| 1031 Marking::MarkBitFrom(shared_info->unchecked_code()); | 1033 Marking::MarkBitFrom(shared_info->unchecked_code()); |
| 1032 if (code_mark.Get()) { | 1034 if (code_mark.Get()) { |
| 1033 shared_info->set_code_age(0); | |
|
ulan
2011/11/21 17:36:15
Do not reset the code age, the JSFunction visitor(
| |
| 1034 return false; | 1035 return false; |
| 1035 } | 1036 } |
| 1036 | 1037 |
| 1037 // The function must be compiled and have the source code available, | 1038 // The function must be compiled and have the source code available, |
| 1038 // to be able to recompile it in case we need the function again. | 1039 // to be able to recompile it in case we need the function again. |
| 1039 if (!(shared_info->is_compiled() && HasSourceCode(heap, shared_info))) { | 1040 if (!(shared_info->is_compiled() && HasSourceCode(heap, shared_info))) { |
| 1040 return false; | 1041 return false; |
| 1041 } | 1042 } |
| 1042 | 1043 |
| 1043 // We never flush code for Api functions. | 1044 // We never flush code for Api functions. |
| (...skipping 2730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3774 while (buffer != NULL) { | 3775 while (buffer != NULL) { |
| 3775 SlotsBuffer* next_buffer = buffer->next(); | 3776 SlotsBuffer* next_buffer = buffer->next(); |
| 3776 DeallocateBuffer(buffer); | 3777 DeallocateBuffer(buffer); |
| 3777 buffer = next_buffer; | 3778 buffer = next_buffer; |
| 3778 } | 3779 } |
| 3779 *buffer_address = NULL; | 3780 *buffer_address = NULL; |
| 3780 } | 3781 } |
| 3781 | 3782 |
| 3782 | 3783 |
| 3783 } } // namespace v8::internal | 3784 } } // namespace v8::internal |
| OLD | NEW |