| 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 // Only flush code for functions. | 559 // Only flush code for functions. |
| 560 if (shared_info->code()->kind() != Code::FUNCTION) { | 560 if (shared_info->code()->kind() != Code::FUNCTION) { |
| 561 return false; | 561 return false; |
| 562 } | 562 } |
| 563 | 563 |
| 564 // Function must be lazy compilable. | 564 // Function must be lazy compilable. |
| 565 if (!shared_info->allows_lazy_compilation()) { | 565 if (!shared_info->allows_lazy_compilation()) { |
| 566 return false; | 566 return false; |
| 567 } | 567 } |
| 568 | 568 |
| 569 // If this is a full script wrapped in a function we do no flush the code. | 569 // If this is a full script wrapped in a function we do not flush the code. |
| 570 if (shared_info->is_toplevel()) { | 570 if (shared_info->is_toplevel()) { |
| 571 return false; | 571 return false; |
| 572 } | 572 } |
| 573 | 573 |
| 574 // If this is a native function we do not flush the code because %SetCode | 574 // If this is a function initialized with %SetCode then the one-to-one |
| 575 // breaks the one-to-one relation between SharedFunctionInfo and Code. | 575 // relation between SharedFunctionInfo and Code is broken. |
| 576 if (shared_info->native()) { | 576 if (shared_info->dont_flush()) { |
| 577 return false; | 577 return false; |
| 578 } | 578 } |
| 579 | 579 |
| 580 if (FLAG_age_code) { | 580 if (FLAG_age_code) { |
| 581 return shared_info->code()->IsOld(); | 581 return shared_info->code()->IsOld(); |
| 582 } else { | 582 } else { |
| 583 // How many collections newly compiled code object will survive before being | 583 // How many collections newly compiled code object will survive before being |
| 584 // flushed. | 584 // flushed. |
| 585 static const int kCodeAgeThreshold = 5; | 585 static const int kCodeAgeThreshold = 5; |
| 586 | 586 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 RelocIterator it(this, mode_mask); | 725 RelocIterator it(this, mode_mask); |
| 726 for (; !it.done(); it.next()) { | 726 for (; !it.done(); it.next()) { |
| 727 it.rinfo()->template Visit<StaticVisitor>(heap); | 727 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 728 } | 728 } |
| 729 } | 729 } |
| 730 | 730 |
| 731 | 731 |
| 732 } } // namespace v8::internal | 732 } } // namespace v8::internal |
| 733 | 733 |
| 734 #endif // V8_OBJECTS_VISITING_INL_H_ | 734 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |