https://chromiumcodereview.appspot.com/9221011/diff/13003/src/ast.cc File src/ast.cc (right):
https://chromiumcodereview.appspot.com/9221011/diff/13003/src/ast.cc#newcode1020 src/ast.cc:1020: // proxy()->var()->IsStackAllocated() && fun() == NULL; Forgotten commented code? https://chromiumcodereview.appspot.com/9221011/diff/13003/src/ast.h File src/ast.h (right): https://chromiumcodereview.appspot.com/9221011/diff/13003/src/ast.h#newcode1492 src/ast.h:1492: ? static_cast<int>(GetNextId(isolate)) GetNextId returns unsigned, yet all ast ids are stored as int. Does it just work changing GetNextId to return an int instead? https://chromiumcodereview.appspot.com/9221011/diff/13003/src/ast.h#newcode2329 src/ast.h:2329: virtual void Visit##type(type* node); It seems that none of the functions actually recursively visit their children. In this case you can avoid inheriting from AstVisitor and make all the functions non-virtual. https://chromiumcodereview.appspot.com/9221011/diff/13003/src/ast.h#newcode2340 src/ast.h:2340: // hold the results; is passed to VariableProxies upon their construction Comment outdated? VariableProxies don't update their info later anymore, do they? https://chromiumcodereview.appspot.com/9221011/diff/13003/src/ast.h#newcode2356 src/ast.h:2356: zone_(zone), Maybe simplify initialization to: zone_(zone != NULL ? zone : isolate->zone()), https://chromiumcodereview.appspot.com/9221011/diff/13003/src/ast.h#newcode2370 src/ast.h:2370: visitor_->Visit##NodeType(node); \ Suggestion for further optimization: If the visitor was embedded in the AstNodeFactory (or even AstNodeFactory includes all from AstConstructionVisitor), you could get rid of the additional indirection and avoid checking visitor_ == NULL for each New* call. You could create a templated version of AstNodeFactory<bool is_visiting> where the template parameters controls if you do the visitor-action or not. I think it would be a minimal change to the code overall. The FunctionState then would have an instance of AstNodeFactory embedded instead of having an AstConstructionVisitor and save/restore while parsing it in the FunctionState constructor/destructor. https://chromiumcodereview.appspot.com/9221011/diff/13003/src/compiler.h File src/compiler.h (right): https://chromiumcodereview.appspot.com/9221011/diff/13003/src/compiler.h#newcode1 src/compiler.h:1: // Copyright 2012 the V8 project authors. All rights reserved. No changes in this file. https://chromiumcodereview.appspot.com/9221011/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
