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

Side by Side Diff: src/rewriter.cc

Issue 1301583005: Rename ParserInfo::function() and CompilationInfo::function() to literal(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/ppc/lithium-codegen-ppc.cc ('k') | src/runtime/runtime-internal.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/rewriter.h" 5 #include "src/rewriter.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/parser.h" 8 #include "src/parser.h"
9 #include "src/scopes.h" 9 #include "src/scopes.h"
10 10
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // Expressions are never visited yet. 203 // Expressions are never visited yet.
204 #define DEF_VISIT(type) \ 204 #define DEF_VISIT(type) \
205 void Processor::Visit##type(type* expr) { UNREACHABLE(); } 205 void Processor::Visit##type(type* expr) { UNREACHABLE(); }
206 EXPRESSION_NODE_LIST(DEF_VISIT) 206 EXPRESSION_NODE_LIST(DEF_VISIT)
207 #undef DEF_VISIT 207 #undef DEF_VISIT
208 208
209 209
210 // Assumes code has been parsed. Mutates the AST, so the AST should not 210 // Assumes code has been parsed. Mutates the AST, so the AST should not
211 // continue to be used in the case of failure. 211 // continue to be used in the case of failure.
212 bool Rewriter::Rewrite(ParseInfo* info) { 212 bool Rewriter::Rewrite(ParseInfo* info) {
213 FunctionLiteral* function = info->function(); 213 FunctionLiteral* function = info->literal();
214 DCHECK(function != NULL); 214 DCHECK(function != NULL);
215 Scope* scope = function->scope(); 215 Scope* scope = function->scope();
216 DCHECK(scope != NULL); 216 DCHECK(scope != NULL);
217 if (!scope->is_script_scope() && !scope->is_eval_scope()) return true; 217 if (!scope->is_script_scope() && !scope->is_eval_scope()) return true;
218 218
219 ZoneList<Statement*>* body = function->body(); 219 ZoneList<Statement*>* body = function->body();
220 if (!body->is_empty()) { 220 if (!body->is_empty()) {
221 Variable* result = 221 Variable* result =
222 scope->NewTemporary(info->ast_value_factory()->dot_result_string()); 222 scope->NewTemporary(info->ast_value_factory()->dot_result_string());
223 // The name string must be internalized at this point. 223 // The name string must be internalized at this point.
(...skipping 18 matching lines...) Expand all
242 body->Add(result_statement, info->zone()); 242 body->Add(result_statement, info->zone());
243 } 243 }
244 } 244 }
245 245
246 return true; 246 return true;
247 } 247 }
248 248
249 249
250 } // namespace internal 250 } // namespace internal
251 } // namespace v8 251 } // namespace v8
OLDNEW
« no previous file with comments | « src/ppc/lithium-codegen-ppc.cc ('k') | src/runtime/runtime-internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698