| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 if (builder.cfg() == NULL) { | 429 if (builder.cfg() == NULL) { |
| 430 BAILOUT("unsupported expression in expression statement"); | 430 BAILOUT("unsupported expression in expression statement"); |
| 431 } | 431 } |
| 432 // Here's a temporary hack: we bang on the last instruction of the | 432 // Here's a temporary hack: we bang on the last instruction of the |
| 433 // expression (if any) to set its location to Effect. | 433 // expression (if any) to set its location to Effect. |
| 434 if (!builder.cfg()->is_empty()) { | 434 if (!builder.cfg()->is_empty()) { |
| 435 InstructionBlock* block = InstructionBlock::cast(builder.cfg()->exit()); | 435 InstructionBlock* block = InstructionBlock::cast(builder.cfg()->exit()); |
| 436 Instruction* instr = block->instructions()->last(); | 436 Instruction* instr = block->instructions()->last(); |
| 437 instr->set_location(CfgGlobals::current()->effect_location()); | 437 instr->set_location(CfgGlobals::current()->effect_location()); |
| 438 } | 438 } |
| 439 cfg_->Append(new PositionInstr(stmt->statement_pos())); |
| 439 cfg_->Concatenate(builder.cfg()); | 440 cfg_->Concatenate(builder.cfg()); |
| 440 } | 441 } |
| 441 | 442 |
| 442 | 443 |
| 443 void StatementBuilder::VisitEmptyStatement(EmptyStatement* stmt) { | 444 void StatementBuilder::VisitEmptyStatement(EmptyStatement* stmt) { |
| 444 // Nothing to do. | 445 // Nothing to do. |
| 445 } | 446 } |
| 446 | 447 |
| 447 | 448 |
| 448 void StatementBuilder::VisitIfStatement(IfStatement* stmt) { | 449 void StatementBuilder::VisitIfStatement(IfStatement* stmt) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 460 } | 461 } |
| 461 | 462 |
| 462 | 463 |
| 463 void StatementBuilder::VisitReturnStatement(ReturnStatement* stmt) { | 464 void StatementBuilder::VisitReturnStatement(ReturnStatement* stmt) { |
| 464 ExpressionBuilder builder; | 465 ExpressionBuilder builder; |
| 465 builder.Build(stmt->expression()); | 466 builder.Build(stmt->expression()); |
| 466 if (builder.cfg() == NULL) { | 467 if (builder.cfg() == NULL) { |
| 467 BAILOUT("unsupported expression in return statement"); | 468 BAILOUT("unsupported expression in return statement"); |
| 468 } | 469 } |
| 469 | 470 |
| 471 cfg_->Append(new PositionInstr(stmt->statement_pos())); |
| 470 cfg_->Concatenate(builder.cfg()); | 472 cfg_->Concatenate(builder.cfg()); |
| 471 cfg_->AppendReturnInstruction(builder.value()); | 473 cfg_->AppendReturnInstruction(builder.value()); |
| 472 } | 474 } |
| 473 | 475 |
| 474 | 476 |
| 475 void StatementBuilder::VisitWithEnterStatement(WithEnterStatement* stmt) { | 477 void StatementBuilder::VisitWithEnterStatement(WithEnterStatement* stmt) { |
| 476 BAILOUT("WithEnterStatement"); | 478 BAILOUT("WithEnterStatement"); |
| 477 } | 479 } |
| 478 | 480 |
| 479 | 481 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 void ExitNode::Print() { | 597 void ExitNode::Print() { |
| 596 if (!is_marked_) { | 598 if (!is_marked_) { |
| 597 is_marked_ = true; | 599 is_marked_ = true; |
| 598 PrintF("L%d:\nExit\n\n", number()); | 600 PrintF("L%d:\nExit\n\n", number()); |
| 599 } | 601 } |
| 600 } | 602 } |
| 601 | 603 |
| 602 #endif // DEBUG | 604 #endif // DEBUG |
| 603 | 605 |
| 604 } } // namespace v8::internal | 606 } } // namespace v8::internal |
| OLD | NEW |