OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 void Processor::VisitBreakStatement(BreakStatement* node) { | 191 void Processor::VisitBreakStatement(BreakStatement* node) { |
192 is_set_ = false; | 192 is_set_ = false; |
193 } | 193 } |
194 | 194 |
195 | 195 |
196 // Do nothing: | 196 // Do nothing: |
197 void Processor::VisitDeclaration(Declaration* node) {} | 197 void Processor::VisitDeclaration(Declaration* node) {} |
198 void Processor::VisitEmptyStatement(EmptyStatement* node) {} | 198 void Processor::VisitEmptyStatement(EmptyStatement* node) {} |
199 void Processor::VisitReturnStatement(ReturnStatement* node) {} | 199 void Processor::VisitReturnStatement(ReturnStatement* node) {} |
200 void Processor::VisitWithEnterStatement(WithEnterStatement* node) {} | 200 void Processor::VisitWithEnterStatement(WithEnterStatement* node) {} |
201 void Processor::VisitWithExitStatement(WithExitStatement* node) {} | 201 void Processor::VisitContextExitStatement(ContextExitStatement* node) {} |
202 void Processor::VisitDebuggerStatement(DebuggerStatement* node) {} | 202 void Processor::VisitDebuggerStatement(DebuggerStatement* node) {} |
203 | 203 |
204 | 204 |
205 // Expressions are never visited yet. | 205 // Expressions are never visited yet. |
206 void Processor::VisitFunctionLiteral(FunctionLiteral* node) { | 206 #define DEF_VISIT(type) \ |
207 USE(node); | 207 void Processor::Visit##type(type* expr) { UNREACHABLE(); } |
208 UNREACHABLE(); | 208 EXPRESSION_NODE_LIST(DEF_VISIT) |
209 } | 209 #undef DEF_VISIT |
210 | |
211 | |
212 void Processor::VisitSharedFunctionInfoLiteral( | |
213 SharedFunctionInfoLiteral* node) { | |
214 USE(node); | |
215 UNREACHABLE(); | |
216 } | |
217 | |
218 | |
219 void Processor::VisitConditional(Conditional* node) { | |
220 USE(node); | |
221 UNREACHABLE(); | |
222 } | |
223 | |
224 | |
225 void Processor::VisitVariableProxy(VariableProxy* node) { | |
226 USE(node); | |
227 UNREACHABLE(); | |
228 } | |
229 | |
230 | |
231 void Processor::VisitLiteral(Literal* node) { | |
232 USE(node); | |
233 UNREACHABLE(); | |
234 } | |
235 | |
236 | |
237 void Processor::VisitRegExpLiteral(RegExpLiteral* node) { | |
238 USE(node); | |
239 UNREACHABLE(); | |
240 } | |
241 | |
242 | |
243 void Processor::VisitArrayLiteral(ArrayLiteral* node) { | |
244 USE(node); | |
245 UNREACHABLE(); | |
246 } | |
247 | |
248 | |
249 void Processor::VisitObjectLiteral(ObjectLiteral* node) { | |
250 USE(node); | |
251 UNREACHABLE(); | |
252 } | |
253 | |
254 | |
255 void Processor::VisitAssignment(Assignment* node) { | |
256 USE(node); | |
257 UNREACHABLE(); | |
258 } | |
259 | |
260 | |
261 void Processor::VisitThrow(Throw* node) { | |
262 USE(node); | |
263 UNREACHABLE(); | |
264 } | |
265 | |
266 | |
267 void Processor::VisitProperty(Property* node) { | |
268 USE(node); | |
269 UNREACHABLE(); | |
270 } | |
271 | |
272 | |
273 void Processor::VisitCall(Call* node) { | |
274 USE(node); | |
275 UNREACHABLE(); | |
276 } | |
277 | |
278 | |
279 void Processor::VisitCallNew(CallNew* node) { | |
280 USE(node); | |
281 UNREACHABLE(); | |
282 } | |
283 | |
284 | |
285 void Processor::VisitCallRuntime(CallRuntime* node) { | |
286 USE(node); | |
287 UNREACHABLE(); | |
288 } | |
289 | |
290 | |
291 void Processor::VisitUnaryOperation(UnaryOperation* node) { | |
292 USE(node); | |
293 UNREACHABLE(); | |
294 } | |
295 | |
296 | |
297 void Processor::VisitCountOperation(CountOperation* node) { | |
298 USE(node); | |
299 UNREACHABLE(); | |
300 } | |
301 | |
302 | |
303 void Processor::VisitBinaryOperation(BinaryOperation* node) { | |
304 USE(node); | |
305 UNREACHABLE(); | |
306 } | |
307 | |
308 | |
309 void Processor::VisitCompareOperation(CompareOperation* node) { | |
310 USE(node); | |
311 UNREACHABLE(); | |
312 } | |
313 | |
314 | |
315 void Processor::VisitCompareToNull(CompareToNull* node) { | |
316 USE(node); | |
317 UNREACHABLE(); | |
318 } | |
319 | |
320 | |
321 void Processor::VisitThisFunction(ThisFunction* node) { | |
322 USE(node); | |
323 UNREACHABLE(); | |
324 } | |
325 | 210 |
326 | 211 |
327 // Assumes code has been parsed and scopes have been analyzed. Mutates the | 212 // Assumes code has been parsed and scopes have been analyzed. Mutates the |
328 // AST, so the AST should not continue to be used in the case of failure. | 213 // AST, so the AST should not continue to be used in the case of failure. |
329 bool Rewriter::Rewrite(CompilationInfo* info) { | 214 bool Rewriter::Rewrite(CompilationInfo* info) { |
330 FunctionLiteral* function = info->function(); | 215 FunctionLiteral* function = info->function(); |
331 ASSERT(function != NULL); | 216 ASSERT(function != NULL); |
332 Scope* scope = function->scope(); | 217 Scope* scope = function->scope(); |
333 ASSERT(scope != NULL); | 218 ASSERT(scope != NULL); |
334 if (scope->is_function_scope()) return true; | 219 if (scope->is_function_scope()) return true; |
(...skipping 10 matching lines...) Expand all Loading... |
345 VariableProxy* result_proxy = new VariableProxy(result); | 230 VariableProxy* result_proxy = new VariableProxy(result); |
346 body->Add(new ReturnStatement(result_proxy)); | 231 body->Add(new ReturnStatement(result_proxy)); |
347 } | 232 } |
348 } | 233 } |
349 | 234 |
350 return true; | 235 return true; |
351 } | 236 } |
352 | 237 |
353 | 238 |
354 } } // namespace v8::internal | 239 } } // namespace v8::internal |
OLD | NEW |