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

Side by Side Diff: src/compiler.cc

Issue 8677008: Relax inlining limits for simple leaf functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Save/restore node count in FunctionState, add comments. Created 9 years 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
« no previous file with comments | « src/ast.h ('k') | src/hydrogen.h » ('j') | src/hydrogen.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 // Set the optimization hints after performing lazy compilation, as 655 // Set the optimization hints after performing lazy compilation, as
656 // these are not set when the function is set up as a lazily 656 // these are not set when the function is set up as a lazily
657 // compiled function. 657 // compiled function.
658 shared->SetThisPropertyAssignmentsInfo( 658 shared->SetThisPropertyAssignmentsInfo(
659 lit->has_only_simple_this_property_assignments(), 659 lit->has_only_simple_this_property_assignments(),
660 *lit->this_property_assignments()); 660 *lit->this_property_assignments());
661 661
662 // Check the function has compiled code. 662 // Check the function has compiled code.
663 ASSERT(shared->is_compiled()); 663 ASSERT(shared->is_compiled());
664 shared->set_code_age(0); 664 shared->set_code_age(0);
665 shared->set_ast_node_count(lit->ast_node_count());
666 shared->set_is_primitive(lit->is_primitive());
665 667
666 if (info->AllowOptimize() && !shared->optimization_disabled()) { 668 if (info->AllowOptimize() && !shared->optimization_disabled()) {
667 // If we're asked to always optimize, we compile the optimized 669 // If we're asked to always optimize, we compile the optimized
668 // version of the function right away - unless the debugger is 670 // version of the function right away - unless the debugger is
669 // active as it makes no sense to compile optimized code then. 671 // active as it makes no sense to compile optimized code then.
670 if (FLAG_always_opt && 672 if (FLAG_always_opt &&
671 !Isolate::Current()->DebuggerHasBreakPoints()) { 673 !Isolate::Current()->DebuggerHasBreakPoints()) {
672 CompilationInfo optimized(function); 674 CompilationInfo optimized(function);
673 optimized.SetOptimizing(AstNode::kNoNumber); 675 optimized.SetOptimizing(AstNode::kNoNumber);
674 return CompileLazy(&optimized); 676 return CompileLazy(&optimized);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 function_info->set_is_anonymous(lit->is_anonymous()); 755 function_info->set_is_anonymous(lit->is_anonymous());
754 function_info->set_is_toplevel(is_toplevel); 756 function_info->set_is_toplevel(is_toplevel);
755 function_info->set_inferred_name(*lit->inferred_name()); 757 function_info->set_inferred_name(*lit->inferred_name());
756 function_info->SetThisPropertyAssignmentsInfo( 758 function_info->SetThisPropertyAssignmentsInfo(
757 lit->has_only_simple_this_property_assignments(), 759 lit->has_only_simple_this_property_assignments(),
758 *lit->this_property_assignments()); 760 *lit->this_property_assignments());
759 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); 761 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation());
760 function_info->set_strict_mode_flag(lit->strict_mode_flag()); 762 function_info->set_strict_mode_flag(lit->strict_mode_flag());
761 function_info->set_uses_arguments(lit->scope()->arguments() != NULL); 763 function_info->set_uses_arguments(lit->scope()->arguments() != NULL);
762 function_info->set_has_duplicate_parameters(lit->has_duplicate_parameters()); 764 function_info->set_has_duplicate_parameters(lit->has_duplicate_parameters());
765 function_info->set_is_primitive(lit->is_primitive());
766 function_info->set_ast_node_count(lit->ast_node_count());
763 } 767 }
764 768
765 769
766 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, 770 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag,
767 CompilationInfo* info, 771 CompilationInfo* info,
768 Handle<SharedFunctionInfo> shared) { 772 Handle<SharedFunctionInfo> shared) {
769 // SharedFunctionInfo is passed separately, because if CompilationInfo 773 // SharedFunctionInfo is passed separately, because if CompilationInfo
770 // was created using Script object, it will not have it. 774 // was created using Script object, it will not have it.
771 775
772 // Log the code generation. If source information is available include 776 // Log the code generation. If source information is available include
(...skipping 23 matching lines...) Expand all
796 } 800 }
797 } 801 }
798 802
799 GDBJIT(AddCode(Handle<String>(shared->DebugName()), 803 GDBJIT(AddCode(Handle<String>(shared->DebugName()),
800 Handle<Script>(info->script()), 804 Handle<Script>(info->script()),
801 Handle<Code>(info->code()), 805 Handle<Code>(info->code()),
802 info)); 806 info));
803 } 807 }
804 808
805 } } // namespace v8::internal 809 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/hydrogen.h » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698