OLD | NEW |
1 // Copyright 2012 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 |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(kDontOptimize)); | 655 shared->set_dont_crankshaft(lit->flags()->Contains(kDontOptimize)); |
656 shared->set_dont_inline(lit->flags()->Contains(kDontInline)); | 656 shared->set_dont_inline(lit->flags()->Contains(kDontInline)); |
| 657 shared->set_ast_node_count(lit->ast_node_count()); |
657 | 658 |
658 if (info->AllowOptimize() && !shared->optimization_disabled()) { | 659 if (info->AllowOptimize() && !shared->optimization_disabled()) { |
659 // If we're asked to always optimize, we compile the optimized | 660 // If we're asked to always optimize, we compile the optimized |
660 // version of the function right away - unless the debugger is | 661 // version of the function right away - unless the debugger is |
661 // active as it makes no sense to compile optimized code then. | 662 // active as it makes no sense to compile optimized code then. |
662 if (FLAG_always_opt && | 663 if (FLAG_always_opt && |
663 !Isolate::Current()->DebuggerHasBreakPoints()) { | 664 !Isolate::Current()->DebuggerHasBreakPoints()) { |
664 CompilationInfo optimized(function); | 665 CompilationInfo optimized(function); |
665 optimized.SetOptimizing(AstNode::kNoNumber); | 666 optimized.SetOptimizing(AstNode::kNoNumber); |
666 return CompileLazy(&optimized); | 667 return CompileLazy(&optimized); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 } | 792 } |
792 } | 793 } |
793 | 794 |
794 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 795 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
795 Handle<Script>(info->script()), | 796 Handle<Script>(info->script()), |
796 Handle<Code>(info->code()), | 797 Handle<Code>(info->code()), |
797 info)); | 798 info)); |
798 } | 799 } |
799 | 800 |
800 } } // namespace v8::internal | 801 } } // namespace v8::internal |
OLD | NEW |