Ivan, thanks for comments!
http://codereview.chromium.org/62146/diff/4001/4015 File src/rewriter.cc (right): http://codereview.chromium.org/62146/diff/4001/4015#newcode278 Line 278: bool must_leave_inferrer = false; On 2009/04/13 21:12:30, iposva wrote: > It might make sense to create a stack allocated object that will automatically > call InferAndLeave() on destruction if inferring has been requested. Such as > follows: > class NeedBetterName { > public: > NeedBetterName(FuncNameInferrer* inferrer) : inferrer_(inferrer), > entered_(false) {}; > ~ NeedBetterName() { > if (entered_) { > inferrer_->InferAndLeave(); > } > } > void Enter() { > inferrer_->Enter(); > entered_ = true; > } > private: > FuncNameInferrer* inferrer_; > bool entered_; > }; > Which will automatically leave the inferrer. This way you are guaranteed to not > forget to call InferAndLeave() even across complicated control flow. Great advice. And thanks for the boilerplate code! http://codereview.chromium.org/62146/diff/4001/4020 File tools/v8.xcodeproj/project.pbxproj (right): http://codereview.chromium.org/62146/diff/4001/4020#newcode1180 Line 1180: 9F92FAA90F8F28AD0089F02C /* func-name-inferrer.cc in Sources */, On 2009/04/13 20:49:42, iposva wrote: > Please keep this list sorted. If you need help just stop by my office. Done. http://codereview.chromium.org/62146/diff/4001/4020#newcode1282 Line 1282: 9F92FAAA0F8F28AD0089F02C /* func-name-inferrer.cc in Sources */, On 2009/04/13 20:49:42, iposva wrote: > ditto. This should be a sorted list. Done. http://codereview.chromium.org/62146 --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
