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

Side by Side Diff: src/full-codegen/full-codegen.cc

Issue 2142233003: Templatize AstVisitor with its subclass (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 4 years, 5 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/full-codegen/full-codegen.h ('k') | src/interpreter/bytecode-generator.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 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/full-codegen/full-codegen.h" 5 #include "src/full-codegen/full-codegen.h"
6 6
7 #include "src/ast/ast-numbering.h" 7 #include "src/ast/ast-numbering.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/ast/scopeinfo.h" 10 #include "src/ast/scopeinfo.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 context->fall_through()); 383 context->fall_through());
384 } 384 }
385 385
386 386
387 void FullCodeGenerator::VisitDeclarations( 387 void FullCodeGenerator::VisitDeclarations(
388 ZoneList<Declaration*>* declarations) { 388 ZoneList<Declaration*>* declarations) {
389 ZoneList<Handle<Object> >* saved_globals = globals_; 389 ZoneList<Handle<Object> >* saved_globals = globals_;
390 ZoneList<Handle<Object> > inner_globals(10, zone()); 390 ZoneList<Handle<Object> > inner_globals(10, zone());
391 globals_ = &inner_globals; 391 globals_ = &inner_globals;
392 392
393 AstVisitor::VisitDeclarations(declarations); 393 AstVisitor<FullCodeGenerator>::VisitDeclarations(declarations);
394 394
395 if (!globals_->is_empty()) { 395 if (!globals_->is_empty()) {
396 // Invoke the platform-dependent code generator to do the actual 396 // Invoke the platform-dependent code generator to do the actual
397 // declaration of the global functions and variables. 397 // declaration of the global functions and variables.
398 Handle<FixedArray> array = 398 Handle<FixedArray> array =
399 isolate()->factory()->NewFixedArray(globals_->length(), TENURED); 399 isolate()->factory()->NewFixedArray(globals_->length(), TENURED);
400 for (int i = 0; i < globals_->length(); ++i) 400 for (int i = 0; i < globals_->length(); ++i)
401 array->set(i, *globals_->at(i)); 401 array->set(i, *globals_->at(i));
402 DeclareGlobals(array); 402 DeclareGlobals(array);
403 } 403 }
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1961 return var->scope()->is_nonlinear() || 1961 return var->scope()->is_nonlinear() ||
1962 var->initializer_position() >= proxy->position(); 1962 var->initializer_position() >= proxy->position();
1963 } 1963 }
1964 1964
1965 1965
1966 #undef __ 1966 #undef __
1967 1967
1968 1968
1969 } // namespace internal 1969 } // namespace internal
1970 } // namespace v8 1970 } // namespace v8
OLDNEW
« no previous file with comments | « src/full-codegen/full-codegen.h ('k') | src/interpreter/bytecode-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698