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

Side by Side Diff: src/handles.cc

Issue 6551011: Fix CPU profiling for Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 10 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 | Annotate | Revision Log
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 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 bool result = true; 840 bool result = true;
841 if (function->shared()->is_compiled()) { 841 if (function->shared()->is_compiled()) {
842 function->ReplaceCode(function->shared()->code()); 842 function->ReplaceCode(function->shared()->code());
843 function->shared()->set_code_age(0); 843 function->shared()->set_code_age(0);
844 } else { 844 } else {
845 CompilationInfo info(function); 845 CompilationInfo info(function);
846 if (in_loop_flag == IN_LOOP) info.MarkAsInLoop(); 846 if (in_loop_flag == IN_LOOP) info.MarkAsInLoop();
847 result = CompileLazyHelper(&info, flag); 847 result = CompileLazyHelper(&info, flag);
848 ASSERT(!result || function->is_compiled()); 848 ASSERT(!result || function->is_compiled());
849 } 849 }
850 if (result && function->is_compiled()) {
851 PROFILE(FunctionCreateEvent(*function));
852 }
853 return result; 850 return result;
854 } 851 }
855 852
856 853
857 bool CompileLazy(Handle<JSFunction> function, 854 bool CompileLazy(Handle<JSFunction> function,
858 ClearExceptionFlag flag) { 855 ClearExceptionFlag flag) {
859 return CompileLazyFunction(function, flag, NOT_IN_LOOP); 856 return CompileLazyFunction(function, flag, NOT_IN_LOOP);
860 } 857 }
861 858
862 859
863 bool CompileLazyInLoop(Handle<JSFunction> function, 860 bool CompileLazyInLoop(Handle<JSFunction> function,
864 ClearExceptionFlag flag) { 861 ClearExceptionFlag flag) {
865 return CompileLazyFunction(function, flag, IN_LOOP); 862 return CompileLazyFunction(function, flag, IN_LOOP);
866 } 863 }
867 864
868 865
869 bool CompileOptimized(Handle<JSFunction> function, int osr_ast_id) { 866 bool CompileOptimized(Handle<JSFunction> function, int osr_ast_id) {
870 CompilationInfo info(function); 867 CompilationInfo info(function);
871 info.SetOptimizing(osr_ast_id); 868 info.SetOptimizing(osr_ast_id);
872 bool result = CompileLazyHelper(&info, KEEP_EXCEPTION); 869 bool result = CompileLazyHelper(&info, KEEP_EXCEPTION);
Vitaly Repeshko 2011/02/22 15:11:19 Temporary "result" variable is now unnecessary.
mnaganov (inactive) 2011/02/22 16:18:22 Done.
873 if (result) PROFILE(FunctionCreateEvent(*function));
874 return result; 870 return result;
875 } 871 }
876 872
877 873
878 OptimizedObjectForAddingMultipleProperties:: 874 OptimizedObjectForAddingMultipleProperties::
879 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, 875 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object,
880 int expected_additional_properties, 876 int expected_additional_properties,
881 bool condition) { 877 bool condition) {
882 object_ = object; 878 object_ = object;
883 if (condition && object_->HasFastProperties() && !object->IsJSGlobalProxy()) { 879 if (condition && object_->HasFastProperties() && !object->IsJSGlobalProxy()) {
(...skipping 14 matching lines...) Expand all
898 894
899 OptimizedObjectForAddingMultipleProperties:: 895 OptimizedObjectForAddingMultipleProperties::
900 ~OptimizedObjectForAddingMultipleProperties() { 896 ~OptimizedObjectForAddingMultipleProperties() {
901 // Reoptimize the object to allow fast property access. 897 // Reoptimize the object to allow fast property access.
902 if (has_been_transformed_) { 898 if (has_been_transformed_) {
903 TransformToFastProperties(object_, unused_property_fields_); 899 TransformToFastProperties(object_, unused_property_fields_);
904 } 900 }
905 } 901 }
906 902
907 } } // namespace v8::internal 903 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698