| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 CompilationInfo info(shared); | 766 CompilationInfo info(shared); |
| 767 return CompileLazyHelper(&info, flag); | 767 return CompileLazyHelper(&info, flag); |
| 768 } | 768 } |
| 769 | 769 |
| 770 | 770 |
| 771 bool CompileLazy(Handle<JSFunction> function, | 771 bool CompileLazy(Handle<JSFunction> function, |
| 772 Handle<Object> receiver, | 772 Handle<Object> receiver, |
| 773 ClearExceptionFlag flag) { | 773 ClearExceptionFlag flag) { |
| 774 if (function->shared()->is_compiled()) { | 774 if (function->shared()->is_compiled()) { |
| 775 function->set_code(function->shared()->code()); | 775 function->set_code(function->shared()->code()); |
| 776 function->shared()->set_code_age(0); |
| 776 return true; | 777 return true; |
| 777 } else { | 778 } else { |
| 778 CompilationInfo info(function, 0, receiver); | 779 CompilationInfo info(function, 0, receiver); |
| 779 bool result = CompileLazyHelper(&info, flag); | 780 bool result = CompileLazyHelper(&info, flag); |
| 780 PROFILE(FunctionCreateEvent(*function)); | 781 PROFILE(FunctionCreateEvent(*function)); |
| 781 return result; | 782 return result; |
| 782 } | 783 } |
| 783 } | 784 } |
| 784 | 785 |
| 785 | 786 |
| 786 bool CompileLazyInLoop(Handle<JSFunction> function, | 787 bool CompileLazyInLoop(Handle<JSFunction> function, |
| 787 Handle<Object> receiver, | 788 Handle<Object> receiver, |
| 788 ClearExceptionFlag flag) { | 789 ClearExceptionFlag flag) { |
| 789 if (function->shared()->is_compiled()) { | 790 if (function->shared()->is_compiled()) { |
| 790 function->set_code(function->shared()->code()); | 791 function->set_code(function->shared()->code()); |
| 792 function->shared()->set_code_age(0); |
| 791 return true; | 793 return true; |
| 792 } else { | 794 } else { |
| 793 CompilationInfo info(function, 1, receiver); | 795 CompilationInfo info(function, 1, receiver); |
| 794 bool result = CompileLazyHelper(&info, flag); | 796 bool result = CompileLazyHelper(&info, flag); |
| 795 PROFILE(FunctionCreateEvent(*function)); | 797 PROFILE(FunctionCreateEvent(*function)); |
| 796 return result; | 798 return result; |
| 797 } | 799 } |
| 798 } | 800 } |
| 799 | 801 |
| 800 | 802 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 821 | 823 |
| 822 OptimizedObjectForAddingMultipleProperties:: | 824 OptimizedObjectForAddingMultipleProperties:: |
| 823 ~OptimizedObjectForAddingMultipleProperties() { | 825 ~OptimizedObjectForAddingMultipleProperties() { |
| 824 // Reoptimize the object to allow fast property access. | 826 // Reoptimize the object to allow fast property access. |
| 825 if (has_been_transformed_) { | 827 if (has_been_transformed_) { |
| 826 TransformToFastProperties(object_, unused_property_fields_); | 828 TransformToFastProperties(object_, unused_property_fields_); |
| 827 } | 829 } |
| 828 } | 830 } |
| 829 | 831 |
| 830 } } // namespace v8::internal | 832 } } // namespace v8::internal |
| OLD | NEW |