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(lit->flags()->Contains(kDontCrankshaft)); |
| 656 shared->set_dont_inline(lit->flags()->Contains(kDontInline)); |
655 | 657 |
656 if (info->AllowOptimize() && !shared->optimization_disabled()) { | 658 if (info->AllowOptimize() && !shared->optimization_disabled()) { |
657 // If we're asked to always optimize, we compile the optimized | 659 // If we're asked to always optimize, we compile the optimized |
658 // version of the function right away - unless the debugger is | 660 // version of the function right away - unless the debugger is |
659 // active as it makes no sense to compile optimized code then. | 661 // active as it makes no sense to compile optimized code then. |
660 if (FLAG_always_opt && | 662 if (FLAG_always_opt && |
661 !Isolate::Current()->DebuggerHasBreakPoints()) { | 663 !Isolate::Current()->DebuggerHasBreakPoints()) { |
662 CompilationInfo optimized(function); | 664 CompilationInfo optimized(function); |
663 optimized.SetOptimizing(AstNode::kNoNumber); | 665 optimized.SetOptimizing(AstNode::kNoNumber); |
664 return CompileLazy(&optimized); | 666 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()); | 745 function_info->set_is_anonymous(lit->is_anonymous()); |
744 function_info->set_is_toplevel(is_toplevel); | 746 function_info->set_is_toplevel(is_toplevel); |
745 function_info->set_inferred_name(*lit->inferred_name()); | 747 function_info->set_inferred_name(*lit->inferred_name()); |
746 function_info->SetThisPropertyAssignmentsInfo( | 748 function_info->SetThisPropertyAssignmentsInfo( |
747 lit->has_only_simple_this_property_assignments(), | 749 lit->has_only_simple_this_property_assignments(), |
748 *lit->this_property_assignments()); | 750 *lit->this_property_assignments()); |
749 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); | 751 function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation()); |
750 function_info->set_language_mode(lit->language_mode()); | 752 function_info->set_language_mode(lit->language_mode()); |
751 function_info->set_uses_arguments(lit->scope()->arguments() != NULL); | 753 function_info->set_uses_arguments(lit->scope()->arguments() != NULL); |
752 function_info->set_has_duplicate_parameters(lit->has_duplicate_parameters()); | 754 function_info->set_has_duplicate_parameters(lit->has_duplicate_parameters()); |
| 755 function_info->set_ast_node_count(lit->ast_node_count()); |
| 756 function_info->set_dont_crankshaft(lit->flags()->Contains(kDontCrankshaft)); |
| 757 function_info->set_dont_inline(lit->flags()->Contains(kDontInline)); |
753 } | 758 } |
754 | 759 |
755 | 760 |
756 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, | 761 void Compiler::RecordFunctionCompilation(Logger::LogEventsAndTags tag, |
757 CompilationInfo* info, | 762 CompilationInfo* info, |
758 Handle<SharedFunctionInfo> shared) { | 763 Handle<SharedFunctionInfo> shared) { |
759 // SharedFunctionInfo is passed separately, because if CompilationInfo | 764 // SharedFunctionInfo is passed separately, because if CompilationInfo |
760 // was created using Script object, it will not have it. | 765 // was created using Script object, it will not have it. |
761 | 766 |
762 // Log the code generation. If source information is available include | 767 // Log the code generation. If source information is available include |
(...skipping 23 matching lines...) Expand all Loading... |
786 } | 791 } |
787 } | 792 } |
788 | 793 |
789 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 794 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
790 Handle<Script>(info->script()), | 795 Handle<Script>(info->script()), |
791 Handle<Code>(info->code()), | 796 Handle<Code>(info->code()), |
792 info)); | 797 info)); |
793 } | 798 } |
794 | 799 |
795 } } // namespace v8::internal | 800 } } // namespace v8::internal |
OLD | NEW |