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

Side by Side Diff: src/scopeinfo.cc

Issue 6266007: Properly create variables to access outer arguments and function names. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebasing Created 9 years, 11 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/scopes.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-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 context_modes_.Add(Variable::INTERNAL); 145 context_modes_.Add(Variable::INTERNAL);
146 } 146 }
147 } 147 }
148 } 148 }
149 149
150 150
151 // Encoding format in a FixedArray object: 151 // Encoding format in a FixedArray object:
152 // 152 //
153 // - function name 153 // - function name
154 // 154 //
155 // - calls eval boolean flag
156 //
155 // - number of variables in the context object (smi) (= function context 157 // - number of variables in the context object (smi) (= function context
156 // slot index + 1) 158 // slot index + 1)
157 // - list of pairs (name, Var mode) of context-allocated variables (starting 159 // - list of pairs (name, Var mode) of context-allocated variables (starting
158 // with context slot 0) 160 // with context slot 0)
159 // - NULL (sentinel)
160 // 161 //
161 // - number of parameters (smi) 162 // - number of parameters (smi)
162 // - list of parameter names (starting with parameter 0 first) 163 // - list of parameter names (starting with parameter 0 first)
163 // - NULL (sentinel)
164 // 164 //
165 // - number of variables on the stack (smi) 165 // - number of variables on the stack (smi)
166 // - list of names of stack-allocated variables (starting with stack slot 0) 166 // - list of names of stack-allocated variables (starting with stack slot 0)
167 // - NULL (sentinel)
168 167
169 // The ScopeInfo representation could be simplified and the ScopeInfo 168 // The ScopeInfo representation could be simplified and the ScopeInfo
170 // re-implemented (with almost the same interface). Here is a 169 // re-implemented (with almost the same interface). Here is a
171 // suggestion for the new format: 170 // suggestion for the new format:
172 // 171 //
173 // - have a single list with all variable names (parameters, stack locals, 172 // - have a single list with all variable names (parameters, stack locals,
174 // context locals), followed by a list of non-Object* values containing 173 // context locals), followed by a list of non-Object* values containing
175 // the variables information (what kind, index, attributes) 174 // the variables information (what kind, index, attributes)
176 // - searching the linear list of names is fast and yields an index into the 175 // - searching the linear list of names is fast and yields an index into the
177 // list if the variable name is found 176 // list if the variable name is found
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 } 627 }
629 #endif // DEBUG 628 #endif // DEBUG
630 629
631 630
632 // Make sure the classes get instantiated by the template system. 631 // Make sure the classes get instantiated by the template system.
633 template class ScopeInfo<FreeStoreAllocationPolicy>; 632 template class ScopeInfo<FreeStoreAllocationPolicy>;
634 template class ScopeInfo<PreallocatedStorage>; 633 template class ScopeInfo<PreallocatedStorage>;
635 template class ScopeInfo<ZoneListAllocationPolicy>; 634 template class ScopeInfo<ZoneListAllocationPolicy>;
636 635
637 } } // namespace v8::internal 636 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698