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

Unified Diff: src/func-name-inferrer.h

Issue 7206015: Fix issue 1354: Bad function name inference. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/func-name-inferrer.cc » ('j') | src/func-name-inferrer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | src/func-name-inferrer.cc » ('j') | src/func-name-inferrer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698