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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 ASSERT(!info->shared_info()->is_compiled()); | 772 ASSERT(!info->shared_info()->is_compiled()); |
773 bool result = Compiler::CompileLazy(info); | 773 bool result = Compiler::CompileLazy(info); |
774 ASSERT(result != Top::has_pending_exception()); | 774 ASSERT(result != Top::has_pending_exception()); |
775 if (!result && flag == CLEAR_EXCEPTION) Top::clear_pending_exception(); | 775 if (!result && flag == CLEAR_EXCEPTION) Top::clear_pending_exception(); |
776 return result; | 776 return result; |
777 } | 777 } |
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 LazySharedCompilationInfo 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 ClearExceptionFlag flag) { | 788 ClearExceptionFlag flag) { |
789 if (function->shared()->is_compiled()) { | 789 if (function->shared()->is_compiled()) { |
790 function->set_code(function->shared()->code()); | 790 function->set_code(function->shared()->code()); |
791 function->shared()->set_code_age(0); | 791 function->shared()->set_code_age(0); |
792 return true; | 792 return true; |
793 } else { | 793 } else { |
794 CompilationInfo info(function, 0); | 794 LazyFunctionCompilationInfo info(function, 0); |
795 bool result = CompileLazyHelper(&info, flag); | 795 bool result = CompileLazyHelper(&info, flag); |
796 PROFILE(FunctionCreateEvent(*function)); | 796 PROFILE(FunctionCreateEvent(*function)); |
797 return result; | 797 return result; |
798 } | 798 } |
799 } | 799 } |
800 | 800 |
801 | 801 |
802 bool CompileLazyInLoop(Handle<JSFunction> function, | 802 bool CompileLazyInLoop(Handle<JSFunction> function, |
803 ClearExceptionFlag flag) { | 803 ClearExceptionFlag flag) { |
804 if (function->shared()->is_compiled()) { | 804 if (function->shared()->is_compiled()) { |
805 function->set_code(function->shared()->code()); | 805 function->set_code(function->shared()->code()); |
806 function->shared()->set_code_age(0); | 806 function->shared()->set_code_age(0); |
807 return true; | 807 return true; |
808 } else { | 808 } else { |
809 CompilationInfo info(function, 1); | 809 LazyFunctionCompilationInfo info(function, 1); |
810 bool result = CompileLazyHelper(&info, flag); | 810 bool result = CompileLazyHelper(&info, flag); |
811 PROFILE(FunctionCreateEvent(*function)); | 811 PROFILE(FunctionCreateEvent(*function)); |
812 return result; | 812 return result; |
813 } | 813 } |
814 } | 814 } |
815 | 815 |
816 | 816 |
817 OptimizedObjectForAddingMultipleProperties:: | 817 OptimizedObjectForAddingMultipleProperties:: |
818 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, | 818 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, |
819 int expected_additional_properties, | 819 int expected_additional_properties, |
(...skipping 17 matching lines...) Expand all Loading... |
837 | 837 |
838 OptimizedObjectForAddingMultipleProperties:: | 838 OptimizedObjectForAddingMultipleProperties:: |
839 ~OptimizedObjectForAddingMultipleProperties() { | 839 ~OptimizedObjectForAddingMultipleProperties() { |
840 // Reoptimize the object to allow fast property access. | 840 // Reoptimize the object to allow fast property access. |
841 if (has_been_transformed_) { | 841 if (has_been_transformed_) { |
842 TransformToFastProperties(object_, unused_property_fields_); | 842 TransformToFastProperties(object_, unused_property_fields_); |
843 } | 843 } |
844 } | 844 } |
845 | 845 |
846 } } // namespace v8::internal | 846 } } // namespace v8::internal |
OLD | NEW |