Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: src/handles.cc

Issue 3557007: Add assert to make sure that function refers to compiled code in handles.cc (Closed)
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 ClearExceptionFlag flag) { 781 ClearExceptionFlag flag) {
782 LazySharedCompilationInfo 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 PROFILE(FunctionCreateEvent(*function));
791 function->shared()->set_code_age(0); 792 function->shared()->set_code_age(0);
792 return true; 793 return true;
793 } else { 794 } else {
794 LazyFunctionCompilationInfo info(function, 0); 795 LazyFunctionCompilationInfo info(function, 0);
795 bool result = CompileLazyHelper(&info, flag); 796 bool result = CompileLazyHelper(&info, flag);
796 PROFILE(FunctionCreateEvent(*function)); 797 PROFILE(FunctionCreateEvent(*function));
797 return result; 798 return result;
798 } 799 }
799 } 800 }
800 801
801 802
802 bool CompileLazyInLoop(Handle<JSFunction> function, 803 bool CompileLazyInLoop(Handle<JSFunction> function,
803 ClearExceptionFlag flag) { 804 ClearExceptionFlag flag) {
804 if (function->shared()->is_compiled()) { 805 if (function->shared()->is_compiled()) {
805 function->set_code(function->shared()->code()); 806 function->set_code(function->shared()->code());
807 PROFILE(FunctionCreateEvent(*function));
806 function->shared()->set_code_age(0); 808 function->shared()->set_code_age(0);
807 return true; 809 return true;
808 } else { 810 } else {
809 LazyFunctionCompilationInfo info(function, 1); 811 LazyFunctionCompilationInfo info(function, 1);
810 bool result = CompileLazyHelper(&info, flag); 812 bool result = CompileLazyHelper(&info, flag);
811 PROFILE(FunctionCreateEvent(*function)); 813 PROFILE(FunctionCreateEvent(*function));
Rico 2010/10/04 12:27:31 Maybee assert that the code on the function object
mnaganov (inactive) 2010/10/04 12:37:58 OK, added!
812 return result; 814 return result;
813 } 815 }
814 } 816 }
815 817
816 818
817 OptimizedObjectForAddingMultipleProperties:: 819 OptimizedObjectForAddingMultipleProperties::
818 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, 820 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object,
819 int expected_additional_properties, 821 int expected_additional_properties,
820 bool condition) { 822 bool condition) {
821 object_ = object; 823 object_ = object;
(...skipping 15 matching lines...) Expand all
837 839
838 OptimizedObjectForAddingMultipleProperties:: 840 OptimizedObjectForAddingMultipleProperties::
839 ~OptimizedObjectForAddingMultipleProperties() { 841 ~OptimizedObjectForAddingMultipleProperties() {
840 // Reoptimize the object to allow fast property access. 842 // Reoptimize the object to allow fast property access.
841 if (has_been_transformed_) { 843 if (has_been_transformed_) {
842 TransformToFastProperties(object_, unused_property_fields_); 844 TransformToFastProperties(object_, unused_property_fields_);
843 } 845 }
844 } 846 }
845 847
846 } } // namespace v8::internal 848 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698