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

Side by Side Diff: src/ast.cc

Issue 6825042: Change the list of statements that are inlineable into a black-list. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 8 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/ast.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 op_ = assignment->binary_op(); 342 op_ = assignment->binary_op();
343 left_ = assignment->target(); 343 left_ = assignment->target();
344 right_ = assignment->value(); 344 right_ = assignment->value();
345 pos_ = assignment->position(); 345 pos_ = assignment->position();
346 } 346 }
347 347
348 348
349 // ---------------------------------------------------------------------------- 349 // ----------------------------------------------------------------------------
350 // Inlining support 350 // Inlining support
351 351
352 bool Declaration::IsInlineable() const {
353 UNREACHABLE();
354 return false;
355 }
356
357
358 bool TargetCollector::IsInlineable() const {
359 UNREACHABLE();
360 return false;
361 }
362
363
364 bool Slot::IsInlineable() const {
365 UNREACHABLE();
366 return false;
367 }
368
369
370 bool ForStatement::IsInlineable() const {
371 return false;
372 }
373
374
375 bool WhileStatement::IsInlineable() const {
376 return false;
377 }
378
379
380 bool DoWhileStatement::IsInlineable() const {
381 return false;
382 }
383
384
385 bool ForInStatement::IsInlineable() const {
386 return false;
387 }
388
389
390 bool ContinueStatement::IsInlineable() const {
391 return false;
392 }
393
394
395 bool BreakStatement::IsInlineable() const {
396 return false;
397 }
398
399
400 bool WithEnterStatement::IsInlineable() const {
401 return false;
402 }
403
404
405 bool WithExitStatement::IsInlineable() const {
406 return false;
407 }
408
409
410 bool SwitchStatement::IsInlineable() const {
411 return false;
412 }
413
414
415 bool TryStatement::IsInlineable() const {
416 return false;
417 }
418
419
420 bool TryCatchStatement::IsInlineable() const {
421 return false;
422 }
423
424
425 bool TryFinallyStatement::IsInlineable() const {
426 return false;
427 }
428
429
430 bool CatchExtensionObject::IsInlineable() const {
431 return false;
432 }
433
434
435 bool DebuggerStatement::IsInlineable() const {
436 return false;
437 }
438
439
440 bool Throw::IsInlineable() const {
441 // TODO(1143): Make functions containing throw inlineable.
442 return false;
443 }
444
445
446 bool MaterializedLiteral::IsInlineable() const {
447 // TODO(1322): Allow materialized literals.
448 return false;
449 }
450
451
452 bool FunctionLiteral::IsInlineable() const {
453 // TODO(1322): Allow materialized literals.
454 return false;
455 }
456
457
458 bool ThisFunction::IsInlineable() const {
459 return false;
460 }
461
462
463 bool SharedFunctionInfoLiteral::IsInlineable() const {
464 return false;
465 }
466
467
468 bool ValidLeftHandSideSentinel::IsInlineable() const {
469 UNREACHABLE();
470 return false;
471 }
472
473
474 bool EmptyStatement::IsInlineable() const {
475 return true;
476 }
477
478
479 bool Literal::IsInlineable() const {
480 return true;
481 }
482
483
352 bool Block::IsInlineable() const { 484 bool Block::IsInlineable() const {
353 const int count = statements_.length(); 485 const int count = statements_.length();
354 for (int i = 0; i < count; ++i) { 486 for (int i = 0; i < count; ++i) {
355 if (!statements_[i]->IsInlineable()) return false; 487 if (!statements_[i]->IsInlineable()) return false;
356 } 488 }
357 return true; 489 return true;
358 } 490 }
359 491
360 492
361 bool ExpressionStatement::IsInlineable() const { 493 bool ExpressionStatement::IsInlineable() const {
362 return expression()->IsInlineable(); 494 return expression()->IsInlineable();
363 } 495 }
364 496
365 497
366 bool IfStatement::IsInlineable() const { 498 bool IfStatement::IsInlineable() const {
367 return condition()->IsInlineable() && then_statement()->IsInlineable() && 499 return condition()->IsInlineable()
368 else_statement()->IsInlineable(); 500 && then_statement()->IsInlineable()
501 && else_statement()->IsInlineable();
369 } 502 }
370 503
371 504
372 bool ReturnStatement::IsInlineable() const { 505 bool ReturnStatement::IsInlineable() const {
373 return expression()->IsInlineable(); 506 return expression()->IsInlineable();
374 } 507 }
375 508
376 509
377 bool Conditional::IsInlineable() const { 510 bool Conditional::IsInlineable() const {
378 return condition()->IsInlineable() && then_expression()->IsInlineable() && 511 return condition()->IsInlineable() && then_expression()->IsInlineable() &&
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 ZoneList<Statement*>* statements, 1140 ZoneList<Statement*>* statements,
1008 int pos) 1141 int pos)
1009 : label_(label), 1142 : label_(label),
1010 statements_(statements), 1143 statements_(statements),
1011 position_(pos), 1144 position_(pos),
1012 compare_type_(NONE), 1145 compare_type_(NONE),
1013 entry_id_(AstNode::GetNextId()) { 1146 entry_id_(AstNode::GetNextId()) {
1014 } 1147 }
1015 1148
1016 } } // namespace v8::internal 1149 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698