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

Side by Side Diff: src/ast.cc

Issue 9388007: Allow inlining of functions containing object literals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added test case. Created 8 years, 10 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/arm/lithium-codegen-arm.cc ('k') | src/ia32/lithium-codegen-ia32.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 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 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 INCREASE_NODE_COUNT(ModuleUrl) 1002 INCREASE_NODE_COUNT(ModuleUrl)
1003 INCREASE_NODE_COUNT(Block) 1003 INCREASE_NODE_COUNT(Block)
1004 INCREASE_NODE_COUNT(ExpressionStatement) 1004 INCREASE_NODE_COUNT(ExpressionStatement)
1005 INCREASE_NODE_COUNT(EmptyStatement) 1005 INCREASE_NODE_COUNT(EmptyStatement)
1006 INCREASE_NODE_COUNT(IfStatement) 1006 INCREASE_NODE_COUNT(IfStatement)
1007 INCREASE_NODE_COUNT(ContinueStatement) 1007 INCREASE_NODE_COUNT(ContinueStatement)
1008 INCREASE_NODE_COUNT(BreakStatement) 1008 INCREASE_NODE_COUNT(BreakStatement)
1009 INCREASE_NODE_COUNT(ReturnStatement) 1009 INCREASE_NODE_COUNT(ReturnStatement)
1010 INCREASE_NODE_COUNT(Conditional) 1010 INCREASE_NODE_COUNT(Conditional)
1011 INCREASE_NODE_COUNT(Literal) 1011 INCREASE_NODE_COUNT(Literal)
1012 INCREASE_NODE_COUNT(ObjectLiteral)
1012 INCREASE_NODE_COUNT(Assignment) 1013 INCREASE_NODE_COUNT(Assignment)
1013 INCREASE_NODE_COUNT(Throw) 1014 INCREASE_NODE_COUNT(Throw)
1014 INCREASE_NODE_COUNT(Property) 1015 INCREASE_NODE_COUNT(Property)
1015 INCREASE_NODE_COUNT(UnaryOperation) 1016 INCREASE_NODE_COUNT(UnaryOperation)
1016 INCREASE_NODE_COUNT(CountOperation) 1017 INCREASE_NODE_COUNT(CountOperation)
1017 INCREASE_NODE_COUNT(BinaryOperation) 1018 INCREASE_NODE_COUNT(BinaryOperation)
1018 INCREASE_NODE_COUNT(CompareOperation) 1019 INCREASE_NODE_COUNT(CompareOperation)
1019 INCREASE_NODE_COUNT(ThisFunction) 1020 INCREASE_NODE_COUNT(ThisFunction)
1020 1021
1021 #undef INCREASE_NODE_COUNT 1022 #undef INCREASE_NODE_COUNT
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 // be inlined anyway. 1106 // be inlined anyway.
1106 } 1107 }
1107 1108
1108 1109
1109 void AstConstructionVisitor::VisitRegExpLiteral(RegExpLiteral* node) { 1110 void AstConstructionVisitor::VisitRegExpLiteral(RegExpLiteral* node) {
1110 increase_node_count(); 1111 increase_node_count();
1111 add_flag(kDontInline); // TODO(1322): Allow materialized literals. 1112 add_flag(kDontInline); // TODO(1322): Allow materialized literals.
1112 } 1113 }
1113 1114
1114 1115
1115 void AstConstructionVisitor::VisitObjectLiteral(ObjectLiteral* node) {
1116 increase_node_count();
1117 add_flag(kDontInline); // TODO(1322): Allow materialized literals.
1118 }
1119
1120
1121 void AstConstructionVisitor::VisitArrayLiteral(ArrayLiteral* node) { 1116 void AstConstructionVisitor::VisitArrayLiteral(ArrayLiteral* node) {
1122 increase_node_count(); 1117 increase_node_count();
1123 add_flag(kDontInline); // TODO(1322): Allow materialized literals. 1118 add_flag(kDontInline); // TODO(1322): Allow materialized literals.
1124 } 1119 }
1125 1120
1126 1121
1127 void AstConstructionVisitor::VisitCall(Call* node) { 1122 void AstConstructionVisitor::VisitCall(Call* node) {
1128 increase_node_count(); 1123 increase_node_count();
1129 add_flag(kDontSelfOptimize); 1124 add_flag(kDontSelfOptimize);
1130 } 1125 }
(...skipping 16 matching lines...) Expand all
1147 (node->name()->IsEqualTo(CStrVector("_ArgumentsLength")) || 1142 (node->name()->IsEqualTo(CStrVector("_ArgumentsLength")) ||
1148 node->name()->IsEqualTo(CStrVector("_Arguments")))) { 1143 node->name()->IsEqualTo(CStrVector("_Arguments")))) {
1149 // Don't inline the %_ArgumentsLength or %_Arguments because their 1144 // Don't inline the %_ArgumentsLength or %_Arguments because their
1150 // implementation will not work. There is no stack frame to get them 1145 // implementation will not work. There is no stack frame to get them
1151 // from. 1146 // from.
1152 add_flag(kDontInline); 1147 add_flag(kDontInline);
1153 } 1148 }
1154 } 1149 }
1155 1150
1156 } } // namespace v8::internal 1151 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698