Chromium Code Reviews| Index: src/func-name-inferrer.h |
| diff --git a/src/func-name-inferrer.h b/src/func-name-inferrer.h |
| index 5aa2b35bb14b10db5480d40cf63f03f5229b051e..cfe7f90f9e0cb9a928638c0ea19960d8796e617a 100644 |
| --- a/src/func-name-inferrer.h |
| +++ b/src/func-name-inferrer.h |
| @@ -43,12 +43,7 @@ namespace internal { |
| // a name. |
| class FuncNameInferrer : public ZoneObject { |
| public: |
| - FuncNameInferrer() |
| - : entries_stack_(10), |
| - names_stack_(5), |
| - funcs_to_infer_(4), |
| - dot_(FACTORY->NewStringFromAscii(CStrVector("."))) { |
| - } |
| + FuncNameInferrer(); |
| // Returns whether we have entered name collection state. |
| bool IsOpen() const { return !entries_stack_.is_empty(); } |
| @@ -87,7 +82,22 @@ class FuncNameInferrer : public ZoneObject { |
| names_stack_.Rewind(entries_stack_.RemoveLast()); |
| } |
| + Handle<String> anonymous_function() { return anonymous_function_; } |
| + |
| + static const char* const kAnonymousFunctionName; |
| + |
| private: |
| + enum NameType { |
| + kEnclosingConstructorName, |
| + kLiteralName, |
| + kVariableName |
| + }; |
| + struct Name { |
| + Name(Handle<String> name, NameType type) : name(name), type(type) { } |
| + Handle<String> name; |
| + NameType type; |
| + }; |
| + |
| // Constructs a full name in dotted notation from gathered names. |
| Handle<String> MakeNameFromStack(); |
| @@ -98,9 +108,10 @@ class FuncNameInferrer : public ZoneObject { |
| void InferFunctionsNames(); |
| ZoneList<int> entries_stack_; |
| - ZoneList<Handle<String> > names_stack_; |
| + ZoneList<Name> names_stack_; |
| ZoneList<FunctionLiteral*> funcs_to_infer_; |
| Handle<String> dot_; |
|
Vitaly Repeshko
2011/06/22 13:21:30
Function name inference is an integral part of the
mnaganov (inactive)
2011/06/22 20:21:08
Done.
|
| + Handle<String> anonymous_function_; |
| DISALLOW_COPY_AND_ASSIGN(FuncNameInferrer); |
| }; |