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

Side by Side Diff: src/rewriter.cc

Issue 115344: Add more detailed timers of the various compilation passes. The... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/usage-analyzer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 } 796 }
797 797
798 798
799 void Processor::VisitThisFunction(ThisFunction* node) { 799 void Processor::VisitThisFunction(ThisFunction* node) {
800 USE(node); 800 USE(node);
801 UNREACHABLE(); 801 UNREACHABLE();
802 } 802 }
803 803
804 804
805 bool Rewriter::Process(FunctionLiteral* function) { 805 bool Rewriter::Process(FunctionLiteral* function) {
806 HistogramTimerScope timer(&Counters::rewriting);
806 Scope* scope = function->scope(); 807 Scope* scope = function->scope();
807 if (scope->is_function_scope()) return true; 808 if (scope->is_function_scope()) return true;
808 809
809 ZoneList<Statement*>* body = function->body(); 810 ZoneList<Statement*>* body = function->body();
810 if (body->is_empty()) return true; 811 if (body->is_empty()) return true;
811 812
812 VariableProxy* result = scope->NewTemporary(Factory::result_symbol()); 813 VariableProxy* result = scope->NewTemporary(Factory::result_symbol());
813 Processor processor(result); 814 Processor processor(result);
814 processor.Process(body); 815 processor.Process(body);
815 if (processor.HasStackOverflow()) return false; 816 if (processor.HasStackOverflow()) return false;
816 817
817 if (processor.result_assigned()) body->Add(new ReturnStatement(result)); 818 if (processor.result_assigned()) body->Add(new ReturnStatement(result));
818 return true; 819 return true;
819 } 820 }
820 821
821 822
822 bool Rewriter::Optimize(FunctionLiteral* function) { 823 bool Rewriter::Optimize(FunctionLiteral* function) {
823 ZoneList<Statement*>* body = function->body(); 824 ZoneList<Statement*>* body = function->body();
824 825
825 if (FLAG_optimize_ast && !body->is_empty()) { 826 if (FLAG_optimize_ast && !body->is_empty()) {
827 HistogramTimerScope timer(&Counters::ast_optimization);
826 AstOptimizer optimizer(function->name()); 828 AstOptimizer optimizer(function->name());
827 optimizer.Optimize(body); 829 optimizer.Optimize(body);
828 if (optimizer.HasStackOverflow()) { 830 if (optimizer.HasStackOverflow()) {
829 return false; 831 return false;
830 } 832 }
831 } 833 }
832 return true; 834 return true;
833 } 835 }
834 836
835 837
836 } } // namespace v8::internal 838 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/usage-analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698