OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 // Set the optimization hints after performing lazy compilation, as | 645 // Set the optimization hints after performing lazy compilation, as |
646 // these are not set when the function is set up as a lazily | 646 // these are not set when the function is set up as a lazily |
647 // compiled function. | 647 // compiled function. |
648 shared->SetThisPropertyAssignmentsInfo( | 648 shared->SetThisPropertyAssignmentsInfo( |
649 lit->has_only_simple_this_property_assignments(), | 649 lit->has_only_simple_this_property_assignments(), |
650 *lit->this_property_assignments()); | 650 *lit->this_property_assignments()); |
651 | 651 |
652 // Check the function has compiled code. | 652 // Check the function has compiled code. |
653 ASSERT(shared->is_compiled()); | 653 ASSERT(shared->is_compiled()); |
654 shared->set_code_age(0); | 654 shared->set_code_age(0); |
| 655 shared->set_dont_crankshaft( |
| 656 lit->ast_properties()->flags()->Contains(kDontCrankshaft)); |
| 657 shared->set_dont_inline( |
| 658 lit->ast_properties()->flags()->Contains(kDontInline)); |
655 | 659 |
656 if (info->AllowOptimize() && !shared->optimization_disabled()) { | 660 if (info->AllowOptimize() && !shared->optimization_disabled()) { |
657 // If we're asked to always optimize, we compile the optimized | 661 // If we're asked to always optimize, we compile the optimized |
658 // version of the function right away - unless the debugger is | 662 // version of the function right away - unless the debugger is |
659 // active as it makes no sense to compile optimized code then. | 663 // active as it makes no sense to compile optimized code then. |
660 if (FLAG_always_opt && | 664 if (FLAG_always_opt && |
661 !Isolate::Current()->DebuggerHasBreakPoints()) { | 665 !Isolate::Current()->DebuggerHasBreakPoints()) { |
662 CompilationInfo optimized(function); | 666 CompilationInfo optimized(function); |
663 optimized.SetOptimizing(AstNode::kNoNumber); | 667 optimized.SetOptimizing(AstNode::kNoNumber); |
664 return CompileLazy(&optimized); | 668 return CompileLazy(&optimized); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 function_info->set_is_anonymous(lit->is_anonymous()); | 747 function_info->set_is_anonymous(lit->is_anonymous()); |
744 function_info->set_is_toplevel(is_toplevel); | 748 function_info->set_is_toplevel(is_toplevel); |
745 function_info->set_inferred_name(*lit->inferred_name()); | 749 function_info->set_inferred_name(*lit->inferred_name()); |
746 function_info->SetThisPropertyAssignmentsInfo( | 750 function_info->SetThisPropertyAssignmentsInfo( |
747 lit->has_only_simple_this_property_assignments(), | 751 lit->has_only_simple_this_property_assignments(), |
748 *lit->this_property_assignments()); | 752 *lit->this_property_assignments()); |
749 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); | 753 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); |
750 function_info->set_language_mode(lit->language_mode()); | 754 function_info->set_language_mode(lit->language_mode()); |
751 function_info->set_uses_arguments(lit->scope()->arguments() != NULL); | 755 function_info->set_uses_arguments(lit->scope()->arguments() != NULL); |
752 function_info->set_has_duplicate_parameters(lit->has_duplicate_parameters()); | 756 function_info->set_has_duplicate_parameters(lit->has_duplicate_parameters()); |
| 757 function_info->set_ast_node_count(lit->AstNodeCount()); |
| 758 function_info->set_dont_crankshaft( |
| 759 lit->ast_properties()->flags()->Contains(kDontCrankshaft)); |
| 760 function_info->set_dont_inline( |
| 761 lit->ast_properties()->flags()->Contains(kDontInline)); |
753 } | 762 } |
754 | 763 |
755 | 764 |
756 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, | 765 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, |
757 CompilationInfo* info, | 766 CompilationInfo* info, |
758 Handle<SharedFunctionInfo> shared) { | 767 Handle<SharedFunctionInfo> shared) { |
759 // SharedFunctionInfo is passed separately, because if CompilationInfo | 768 // SharedFunctionInfo is passed separately, because if CompilationInfo |
760 // was created using Script object, it will not have it. | 769 // was created using Script object, it will not have it. |
761 | 770 |
762 // Log the code generation. If source information is available include | 771 // Log the code generation. If source information is available include |
(...skipping 23 matching lines...) Expand all Loading... |
786 } | 795 } |
787 } | 796 } |
788 | 797 |
789 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 798 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
790 Handle<Script>(info->script()), | 799 Handle<Script>(info->script()), |
791 Handle<Code>(info->code()), | 800 Handle<Code>(info->code()), |
792 info)); | 801 info)); |
793 } | 802 } |
794 | 803 |
795 } } // namespace v8::internal | 804 } } // namespace v8::internal |
OLD | NEW |