OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_SCOPES_H_ | 5 #ifndef VM_SCOPES_H_ |
6 #define VM_SCOPES_H_ | 6 #define VM_SCOPES_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 // assigning a frame slot index or a context slot index. | 295 // assigning a frame slot index or a context slot index. |
296 // Parameters to be allocated in the frame must all appear in the top scope | 296 // Parameters to be allocated in the frame must all appear in the top scope |
297 // and not in its children (we do not yet handle register parameters). | 297 // and not in its children (we do not yet handle register parameters). |
298 // Locals must be listed after parameters in top scope and in its children. | 298 // Locals must be listed after parameters in top scope and in its children. |
299 // Two locals in different sibling scopes may share the same frame slot. | 299 // Two locals in different sibling scopes may share the same frame slot. |
300 // Return the index of the next available frame slot. | 300 // Return the index of the next available frame slot. |
301 int AllocateVariables(int first_parameter_index, | 301 int AllocateVariables(int first_parameter_index, |
302 int num_parameters, | 302 int num_parameters, |
303 int first_frame_index, | 303 int first_frame_index, |
304 LocalScope* loop_owner, | 304 LocalScope* loop_owner, |
305 LocalScope** context_owner); | 305 LocalScope** context_owner, |
| 306 bool* found_captured_variables); |
306 | 307 |
307 // Creates variable info for the scope and all its nested scopes. | 308 // Creates variable info for the scope and all its nested scopes. |
308 // Must be called after AllocateVariables() has been called. | 309 // Must be called after AllocateVariables() has been called. |
309 RawLocalVarDescriptors* GetVarDescriptors(const Function& func); | 310 RawLocalVarDescriptors* GetVarDescriptors(const Function& func); |
310 | 311 |
311 // Create a ContextScope object describing all captured variables referenced | 312 // Create a ContextScope object describing all captured variables referenced |
312 // from this scope and belonging to outer scopes. | 313 // from this scope and belonging to outer scopes. |
313 RawContextScope* PreserveOuterScope(int current_context_level) const; | 314 RawContextScope* PreserveOuterScope(int current_context_level) const; |
314 | 315 |
315 // Creates a LocalScope representing the outer scope of a local function to be | 316 // Creates a LocalScope representing the outer scope of a local function to be |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 // List of names referenced in this scope and its children that | 357 // List of names referenced in this scope and its children that |
357 // are not resolved to local variables. | 358 // are not resolved to local variables. |
358 GrowableArray<NameReference*> referenced_; | 359 GrowableArray<NameReference*> referenced_; |
359 | 360 |
360 DISALLOW_COPY_AND_ASSIGN(LocalScope); | 361 DISALLOW_COPY_AND_ASSIGN(LocalScope); |
361 }; | 362 }; |
362 | 363 |
363 } // namespace dart | 364 } // namespace dart |
364 | 365 |
365 #endif // VM_SCOPES_H_ | 366 #endif // VM_SCOPES_H_ |
OLD | NEW |