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

Side by Side Diff: src/rewriter.cc

Issue 7618007: Simplify handling of exits from with and catch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Incorporate review comments Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/prettyprinter.cc ('k') | src/x64/frames-x64.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 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 void Processor::VisitContinueStatement(ContinueStatement* node) { 190 void Processor::VisitContinueStatement(ContinueStatement* node) {
191 is_set_ = false; 191 is_set_ = false;
192 } 192 }
193 193
194 194
195 void Processor::VisitBreakStatement(BreakStatement* node) { 195 void Processor::VisitBreakStatement(BreakStatement* node) {
196 is_set_ = false; 196 is_set_ = false;
197 } 197 }
198 198
199 199
200 void Processor::VisitWithStatement(WithStatement* node) {
201 bool set_after_body = is_set_;
202 Visit(node->statement());
203 is_set_ = is_set_ && set_after_body;
204 }
205
206
200 // Do nothing: 207 // Do nothing:
201 void Processor::VisitDeclaration(Declaration* node) {} 208 void Processor::VisitDeclaration(Declaration* node) {}
202 void Processor::VisitEmptyStatement(EmptyStatement* node) {} 209 void Processor::VisitEmptyStatement(EmptyStatement* node) {}
203 void Processor::VisitReturnStatement(ReturnStatement* node) {} 210 void Processor::VisitReturnStatement(ReturnStatement* node) {}
204 void Processor::VisitEnterWithContextStatement(
205 EnterWithContextStatement* node) {
206 }
207 void Processor::VisitExitContextStatement(ExitContextStatement* node) {} 211 void Processor::VisitExitContextStatement(ExitContextStatement* node) {}
208 void Processor::VisitDebuggerStatement(DebuggerStatement* node) {} 212 void Processor::VisitDebuggerStatement(DebuggerStatement* node) {}
209 213
210 214
211 // Expressions are never visited yet. 215 // Expressions are never visited yet.
212 #define DEF_VISIT(type) \ 216 #define DEF_VISIT(type) \
213 void Processor::Visit##type(type* expr) { UNREACHABLE(); } 217 void Processor::Visit##type(type* expr) { UNREACHABLE(); }
214 EXPRESSION_NODE_LIST(DEF_VISIT) 218 EXPRESSION_NODE_LIST(DEF_VISIT)
215 #undef DEF_VISIT 219 #undef DEF_VISIT
216 220
(...skipping 21 matching lines...) Expand all
238 VariableProxy* result_proxy = new(zone) VariableProxy(isolate, result); 242 VariableProxy* result_proxy = new(zone) VariableProxy(isolate, result);
239 body->Add(new(zone) ReturnStatement(result_proxy)); 243 body->Add(new(zone) ReturnStatement(result_proxy));
240 } 244 }
241 } 245 }
242 246
243 return true; 247 return true;
244 } 248 }
245 249
246 250
247 } } // namespace v8::internal 251 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/prettyprinter.cc ('k') | src/x64/frames-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698