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/ast.h

Issue 10746: Track loop nesting across function calls when the function... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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 | « no previous file | src/codegen.h » ('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 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 : name_(name), 1118 : name_(name),
1119 scope_(scope), 1119 scope_(scope),
1120 body_(body), 1120 body_(body),
1121 materialized_literal_count_(materialized_literal_count), 1121 materialized_literal_count_(materialized_literal_count),
1122 contains_array_literal_(contains_array_literal), 1122 contains_array_literal_(contains_array_literal),
1123 expected_property_count_(expected_property_count), 1123 expected_property_count_(expected_property_count),
1124 num_parameters_(num_parameters), 1124 num_parameters_(num_parameters),
1125 start_position_(start_position), 1125 start_position_(start_position),
1126 end_position_(end_position), 1126 end_position_(end_position),
1127 is_expression_(is_expression), 1127 is_expression_(is_expression),
1128 loop_nesting_(0),
1128 function_token_position_(RelocInfo::kNoPosition) { 1129 function_token_position_(RelocInfo::kNoPosition) {
1129 } 1130 }
1130 1131
1131 virtual void Accept(Visitor* v); 1132 virtual void Accept(Visitor* v);
1132 1133
1133 // Type testing & conversion 1134 // Type testing & conversion
1134 virtual FunctionLiteral* AsFunctionLiteral() { return this; } 1135 virtual FunctionLiteral* AsFunctionLiteral() { return this; }
1135 1136
1136 Handle<String> name() const { return name_; } 1137 Handle<String> name() const { return name_; }
1137 Scope* scope() const { return scope_; } 1138 Scope* scope() const { return scope_; }
1138 ZoneList<Statement*>* body() const { return body_; } 1139 ZoneList<Statement*>* body() const { return body_; }
1139 void set_function_token_position(int pos) { function_token_position_ = pos; } 1140 void set_function_token_position(int pos) { function_token_position_ = pos; }
1140 int function_token_position() const { return function_token_position_; } 1141 int function_token_position() const { return function_token_position_; }
1141 int start_position() const { return start_position_; } 1142 int start_position() const { return start_position_; }
1142 int end_position() const { return end_position_; } 1143 int end_position() const { return end_position_; }
1143 bool is_expression() const { return is_expression_; } 1144 bool is_expression() const { return is_expression_; }
1144 1145
1145 int materialized_literal_count() { return materialized_literal_count_; } 1146 int materialized_literal_count() { return materialized_literal_count_; }
1146 bool contains_array_literal() { return contains_array_literal_; } 1147 bool contains_array_literal() { return contains_array_literal_; }
1147 int expected_property_count() { return expected_property_count_; } 1148 int expected_property_count() { return expected_property_count_; }
1148 int num_parameters() { return num_parameters_; } 1149 int num_parameters() { return num_parameters_; }
1149 1150
1150 bool AllowsLazyCompilation(); 1151 bool AllowsLazyCompilation();
1151 1152
1153 bool loop_nesting() const { return loop_nesting_; }
1154 void set_loop_nesting(int nesting) { loop_nesting_ = nesting; }
1155
1152 private: 1156 private:
1153 Handle<String> name_; 1157 Handle<String> name_;
1154 Scope* scope_; 1158 Scope* scope_;
1155 ZoneList<Statement*>* body_; 1159 ZoneList<Statement*>* body_;
1156 int materialized_literal_count_; 1160 int materialized_literal_count_;
1157 bool contains_array_literal_; 1161 bool contains_array_literal_;
1158 int expected_property_count_; 1162 int expected_property_count_;
1159 int num_parameters_; 1163 int num_parameters_;
1160 int start_position_; 1164 int start_position_;
1161 int end_position_; 1165 int end_position_;
1162 bool is_expression_; 1166 bool is_expression_;
1167 int loop_nesting_;
1163 int function_token_position_; 1168 int function_token_position_;
1164 }; 1169 };
1165 1170
1166 1171
1167 class FunctionBoilerplateLiteral: public Expression { 1172 class FunctionBoilerplateLiteral: public Expression {
1168 public: 1173 public:
1169 explicit FunctionBoilerplateLiteral(Handle<JSFunction> boilerplate) 1174 explicit FunctionBoilerplateLiteral(Handle<JSFunction> boilerplate)
1170 : boilerplate_(boilerplate) { 1175 : boilerplate_(boilerplate) {
1171 ASSERT(boilerplate->IsBoilerplate()); 1176 ASSERT(boilerplate->IsBoilerplate());
1172 } 1177 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 #undef DEF_VISIT 1229 #undef DEF_VISIT
1225 1230
1226 private: 1231 private:
1227 bool stack_overflow_; 1232 bool stack_overflow_;
1228 }; 1233 };
1229 1234
1230 1235
1231 } } // namespace v8::internal 1236 } } // namespace v8::internal
1232 1237
1233 #endif // V8_AST_H_ 1238 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698