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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 // and in its children scopes of the same function level. Allocating means | 311 // and in its children scopes of the same function level. Allocating means |
312 // assigning a frame slot index or a context slot index. | 312 // assigning a frame slot index or a context slot index. |
313 // Parameters to be allocated in the frame must all appear in the top scope | 313 // Parameters to be allocated in the frame must all appear in the top scope |
314 // and not in its children (we do not yet handle register parameters). | 314 // and not in its children (we do not yet handle register parameters). |
315 // Locals must be listed after parameters in top scope and in its children. | 315 // Locals must be listed after parameters in top scope and in its children. |
316 // Two locals in different sibling scopes may share the same frame slot. | 316 // Two locals in different sibling scopes may share the same frame slot. |
317 // Return the index of the next available frame slot. | 317 // Return the index of the next available frame slot. |
318 int AllocateVariables(int first_parameter_index, | 318 int AllocateVariables(int first_parameter_index, |
319 int num_parameters, | 319 int num_parameters, |
320 int first_frame_index, | 320 int first_frame_index, |
321 LocalScope* loop_owner, | 321 LocalScope* context_owner, |
322 LocalScope** context_owner, | |
323 bool* found_captured_variables); | 322 bool* found_captured_variables); |
324 | 323 |
325 // Creates variable info for the scope and all its nested scopes. | 324 // Creates variable info for the scope and all its nested scopes. |
326 // Must be called after AllocateVariables() has been called. | 325 // Must be called after AllocateVariables() has been called. |
327 RawLocalVarDescriptors* GetVarDescriptors(const Function& func); | 326 RawLocalVarDescriptors* GetVarDescriptors(const Function& func); |
328 | 327 |
329 // Create a ContextScope object describing all captured variables referenced | 328 // Create a ContextScope object describing all captured variables referenced |
330 // from this scope and belonging to outer scopes. | 329 // from this scope and belonging to outer scopes. |
331 RawContextScope* PreserveOuterScope(int current_context_level) const; | 330 RawContextScope* PreserveOuterScope(int current_context_level) const; |
332 | 331 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 // List of names referenced in this scope and its children that | 378 // List of names referenced in this scope and its children that |
380 // are not resolved to local variables. | 379 // are not resolved to local variables. |
381 GrowableArray<NameReference*> referenced_; | 380 GrowableArray<NameReference*> referenced_; |
382 | 381 |
383 DISALLOW_COPY_AND_ASSIGN(LocalScope); | 382 DISALLOW_COPY_AND_ASSIGN(LocalScope); |
384 }; | 383 }; |
385 | 384 |
386 } // namespace dart | 385 } // namespace dart |
387 | 386 |
388 #endif // VM_SCOPES_H_ | 387 #endif // VM_SCOPES_H_ |
OLD | NEW |