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

Side by Side Diff: src/rewriter.cc

Issue 5753005: Make closures optimizable by Crankshaft compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Next round Created 9 years, 11 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/objects-inl.h ('k') | src/runtime.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 UNREACHABLE(); 971 UNREACHABLE();
972 } 972 }
973 973
974 974
975 void Processor::VisitThisFunction(ThisFunction* node) { 975 void Processor::VisitThisFunction(ThisFunction* node) {
976 USE(node); 976 USE(node);
977 UNREACHABLE(); 977 UNREACHABLE();
978 } 978 }
979 979
980 980
981 // Assumes code has been parsed and scopes hve been analyzed. Mutates the 981 // Assumes code has been parsed and scopes have been analyzed. Mutates the
982 // AST, so the AST should not continue to be used in the case of failure. 982 // AST, so the AST should not continue to be used in the case of failure.
983 bool Rewriter::Rewrite(CompilationInfo* info) { 983 bool Rewriter::Rewrite(CompilationInfo* info) {
984 FunctionLiteral* function = info->function(); 984 FunctionLiteral* function = info->function();
985 ASSERT(function != NULL); 985 ASSERT(function != NULL);
986 Scope* scope = function->scope(); 986 Scope* scope = function->scope();
987 ASSERT(scope != NULL); 987 ASSERT(scope != NULL);
988 if (scope->is_function_scope()) return true; 988 if (scope->is_function_scope()) return true;
989 989
990 ZoneList<Statement*>* body = function->body(); 990 ZoneList<Statement*>* body = function->body();
991 if (!body->is_empty()) { 991 if (!body->is_empty()) {
(...skipping 22 matching lines...) Expand all
1014 if (FLAG_optimize_ast && !body->is_empty()) { 1014 if (FLAG_optimize_ast && !body->is_empty()) {
1015 AstOptimizer optimizer; 1015 AstOptimizer optimizer;
1016 optimizer.Optimize(body); 1016 optimizer.Optimize(body);
1017 if (optimizer.HasStackOverflow()) return false; 1017 if (optimizer.HasStackOverflow()) return false;
1018 } 1018 }
1019 return true; 1019 return true;
1020 } 1020 }
1021 1021
1022 1022
1023 } } // namespace v8::internal 1023 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698