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

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

Issue 67165: Change the function name collector to tolerate expressions that contain... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 8 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 | no next file » | 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 64
65 void PushName(Handle<String> name) { 65 void PushName(Handle<String> name) {
66 if (IsOpen()) { 66 if (IsOpen()) {
67 names_stack_.Add(name); 67 names_stack_.Add(name);
68 } 68 }
69 } 69 }
70 70
71 void SetFuncToInfer(FunctionLiteral* func_to_infer) { 71 void SetFuncToInfer(FunctionLiteral* func_to_infer) {
72 if (IsOpen()) { 72 if (IsOpen()) {
73 ASSERT(func_to_infer_ == NULL); 73 // If we encounter another function literal after already having
74 // encountered one, the second one replaces the first.
74 func_to_infer_ = func_to_infer; 75 func_to_infer_ = func_to_infer;
75 } 76 }
76 } 77 }
77 78
78 void InferAndLeave() { 79 void InferAndLeave() {
79 ASSERT(IsOpen()); 80 ASSERT(IsOpen());
80 MaybeInferFunctionName(); 81 MaybeInferFunctionName();
81 Leave(); 82 Leave();
82 } 83 }
83 84
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 FuncNameInferrer* inferrer_; 118 FuncNameInferrer* inferrer_;
118 bool is_entered_; 119 bool is_entered_;
119 120
120 DISALLOW_COPY_AND_ASSIGN(ScopedFuncNameInferrer); 121 DISALLOW_COPY_AND_ASSIGN(ScopedFuncNameInferrer);
121 }; 122 };
122 123
123 124
124 } } // namespace v8::internal 125 } } // namespace v8::internal
125 126
126 #endif // V8_FUNC_NAME_INFERRER_H_ 127 #endif // V8_FUNC_NAME_INFERRER_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698