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

Side by Side Diff: src/func-name-inferrer.h

Issue 8112007: Fix incorrect function name inference in case of assignment / global assignment. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/parser.cc » ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 void PushVariableName(Handle<String> name); 64 void PushVariableName(Handle<String> name);
65 65
66 // Adds a function to infer name for. 66 // Adds a function to infer name for.
67 void AddFunction(FunctionLiteral* func_to_infer) { 67 void AddFunction(FunctionLiteral* func_to_infer) {
68 if (IsOpen()) { 68 if (IsOpen()) {
69 funcs_to_infer_.Add(func_to_infer); 69 funcs_to_infer_.Add(func_to_infer);
70 } 70 }
71 } 71 }
72 72
73 void RemoveLastFunction() {
74 if (IsOpen() && !funcs_to_infer_.is_empty()) {
75 funcs_to_infer_.RemoveLast();
76 }
77 }
78
73 // Infers a function name and leaves names collection state. 79 // Infers a function name and leaves names collection state.
74 void Infer() { 80 void Infer() {
75 ASSERT(IsOpen()); 81 ASSERT(IsOpen());
76 if (!funcs_to_infer_.is_empty()) { 82 if (!funcs_to_infer_.is_empty()) {
77 InferFunctionsNames(); 83 InferFunctionsNames();
78 } 84 }
79 } 85 }
80 86
81 // Leaves names collection state. 87 // Leaves names collection state.
82 void Leave() { 88 void Leave() {
(...skipping 29 matching lines...) Expand all
112 ZoneList<Name> names_stack_; 118 ZoneList<Name> names_stack_;
113 ZoneList<FunctionLiteral*> funcs_to_infer_; 119 ZoneList<FunctionLiteral*> funcs_to_infer_;
114 120
115 DISALLOW_COPY_AND_ASSIGN(FuncNameInferrer); 121 DISALLOW_COPY_AND_ASSIGN(FuncNameInferrer);
116 }; 122 };
117 123
118 124
119 } } // namespace v8::internal 125 } } // namespace v8::internal
120 126
121 #endif // V8_FUNC_NAME_INFERRER_H_ 127 #endif // V8_FUNC_NAME_INFERRER_H_
OLDNEW
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698