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

Unified Diff: src/cfg.cc

Issue 162006: Added support for expression statements to the CFG builder and... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cfg.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cfg.cc
===================================================================
--- src/cfg.cc (revision 2628)
+++ src/cfg.cc (working copy)
@@ -424,7 +424,19 @@
void StatementBuilder::VisitExpressionStatement(ExpressionStatement* stmt) {
- BAILOUT("ExpressionStatement");
+ ExpressionBuilder builder;
+ builder.Build(stmt->expression());
+ if (builder.cfg() == NULL) {
+ BAILOUT("unsupported expression in expression statement");
+ }
+ // Here's a temporary hack: we bang on the last instruction of the
+ // expression (if any) to set its location to Effect.
+ if (!builder.cfg()->is_empty()) {
+ InstructionBlock* block = InstructionBlock::cast(builder.cfg()->exit());
+ Instruction* instr = block->instructions()->last();
+ instr->set_location(CfgGlobals::current()->effect_location());
+ }
+ cfg_->Concatenate(builder.cfg());
Lasse Reichstein 2009/08/06 07:42:33 Call it graph_ or flow_graph_ or even control_flow
}
« no previous file with comments | « src/cfg.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698