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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 no 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 |
| 575 // breaks the one-to-one relation between SharedFunctionInfo and Code. |
| 576 if (shared_info->native()) { |
| 577 return false; |
| 578 } |
| 579 |
574 if (FLAG_age_code) { | 580 if (FLAG_age_code) { |
575 return shared_info->code()->IsOld(); | 581 return shared_info->code()->IsOld(); |
576 } else { | 582 } else { |
577 // How many collections newly compiled code object will survive before being | 583 // How many collections newly compiled code object will survive before being |
578 // flushed. | 584 // flushed. |
579 static const int kCodeAgeThreshold = 5; | 585 static const int kCodeAgeThreshold = 5; |
580 | 586 |
581 // Age this shared function info. | 587 // Age this shared function info. |
582 if (shared_info->code_age() < kCodeAgeThreshold) { | 588 if (shared_info->code_age() < kCodeAgeThreshold) { |
583 shared_info->set_code_age(shared_info->code_age() + 1); | 589 shared_info->set_code_age(shared_info->code_age() + 1); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 RelocIterator it(this, mode_mask); | 725 RelocIterator it(this, mode_mask); |
720 for (; !it.done(); it.next()) { | 726 for (; !it.done(); it.next()) { |
721 it.rinfo()->template Visit<StaticVisitor>(heap); | 727 it.rinfo()->template Visit<StaticVisitor>(heap); |
722 } | 728 } |
723 } | 729 } |
724 | 730 |
725 | 731 |
726 } } // namespace v8::internal | 732 } } // namespace v8::internal |
727 | 733 |
728 #endif // V8_OBJECTS_VISITING_INL_H_ | 734 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |