| 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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 | 778 |
| 779 | 779 |
| 780 bool CompileLazyShared(Handle<SharedFunctionInfo> shared, | 780 bool CompileLazyShared(Handle<SharedFunctionInfo> shared, |
| 781 ClearExceptionFlag flag) { | 781 ClearExceptionFlag flag) { |
| 782 CompilationInfo info(shared); | 782 CompilationInfo info(shared); |
| 783 return CompileLazyHelper(&info, flag); | 783 return CompileLazyHelper(&info, flag); |
| 784 } | 784 } |
| 785 | 785 |
| 786 | 786 |
| 787 bool CompileLazy(Handle<JSFunction> function, | 787 bool CompileLazy(Handle<JSFunction> function, |
| 788 Handle<Object> receiver, | |
| 789 ClearExceptionFlag flag) { | 788 ClearExceptionFlag flag) { |
| 790 if (function->shared()->is_compiled()) { | 789 if (function->shared()->is_compiled()) { |
| 791 function->set_code(function->shared()->code()); | 790 function->set_code(function->shared()->code()); |
| 792 function->shared()->set_code_age(0); | 791 function->shared()->set_code_age(0); |
| 793 return true; | 792 return true; |
| 794 } else { | 793 } else { |
| 795 CompilationInfo info(function, 0, receiver); | 794 CompilationInfo info(function, 0); |
| 796 bool result = CompileLazyHelper(&info, flag); | 795 bool result = CompileLazyHelper(&info, flag); |
| 797 PROFILE(FunctionCreateEvent(*function)); | 796 PROFILE(FunctionCreateEvent(*function)); |
| 798 return result; | 797 return result; |
| 799 } | 798 } |
| 800 } | 799 } |
| 801 | 800 |
| 802 | 801 |
| 803 bool CompileLazyInLoop(Handle<JSFunction> function, | 802 bool CompileLazyInLoop(Handle<JSFunction> function, |
| 804 Handle<Object> receiver, | |
| 805 ClearExceptionFlag flag) { | 803 ClearExceptionFlag flag) { |
| 806 if (function->shared()->is_compiled()) { | 804 if (function->shared()->is_compiled()) { |
| 807 function->set_code(function->shared()->code()); | 805 function->set_code(function->shared()->code()); |
| 808 function->shared()->set_code_age(0); | 806 function->shared()->set_code_age(0); |
| 809 return true; | 807 return true; |
| 810 } else { | 808 } else { |
| 811 CompilationInfo info(function, 1, receiver); | 809 CompilationInfo info(function, 1); |
| 812 bool result = CompileLazyHelper(&info, flag); | 810 bool result = CompileLazyHelper(&info, flag); |
| 813 PROFILE(FunctionCreateEvent(*function)); | 811 PROFILE(FunctionCreateEvent(*function)); |
| 814 return result; | 812 return result; |
| 815 } | 813 } |
| 816 } | 814 } |
| 817 | 815 |
| 818 | 816 |
| 819 OptimizedObjectForAddingMultipleProperties:: | 817 OptimizedObjectForAddingMultipleProperties:: |
| 820 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, | 818 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, |
| 821 int expected_additional_properties, | 819 int expected_additional_properties, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 839 | 837 |
| 840 OptimizedObjectForAddingMultipleProperties:: | 838 OptimizedObjectForAddingMultipleProperties:: |
| 841 ~OptimizedObjectForAddingMultipleProperties() { | 839 ~OptimizedObjectForAddingMultipleProperties() { |
| 842 // Reoptimize the object to allow fast property access. | 840 // Reoptimize the object to allow fast property access. |
| 843 if (has_been_transformed_) { | 841 if (has_been_transformed_) { |
| 844 TransformToFastProperties(object_, unused_property_fields_); | 842 TransformToFastProperties(object_, unused_property_fields_); |
| 845 } | 843 } |
| 846 } | 844 } |
| 847 | 845 |
| 848 } } // namespace v8::internal | 846 } } // namespace v8::internal |
| OLD | NEW |