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

Side by Side Diff: src/objects.h

Issue 981203003: Stack allocate lexical locals + hoist stack slots (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Clean-up Created 5 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/parser.cc » ('j') | src/parser.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 4248 matching lines...) Expand 10 before | Expand all | Expand 10 after
4259 4259
4260 // Return the name of the given parameter. 4260 // Return the name of the given parameter.
4261 String* ParameterName(int var); 4261 String* ParameterName(int var);
4262 4262
4263 // Return the name of the given local. 4263 // Return the name of the given local.
4264 String* LocalName(int var); 4264 String* LocalName(int var);
4265 4265
4266 // Return the name of the given stack local. 4266 // Return the name of the given stack local.
4267 String* StackLocalName(int var); 4267 String* StackLocalName(int var);
4268 4268
4269 // Return the name of the given stack local.
4270 int StackLocalIndex(int var);
4271
4269 // Return the name of the given context local. 4272 // Return the name of the given context local.
4270 String* ContextLocalName(int var); 4273 String* ContextLocalName(int var);
4271 4274
4272 // Return the mode of the given context local. 4275 // Return the mode of the given context local.
4273 VariableMode ContextLocalMode(int var); 4276 VariableMode ContextLocalMode(int var);
4274 4277
4275 // Return the initialization flag of the given context local. 4278 // Return the initialization flag of the given context local.
4276 InitializationFlag ContextLocalInitFlag(int var); 4279 InitializationFlag ContextLocalInitFlag(int var);
4277 4280
4278 // Return the initialization flag of the given context local. 4281 // Return the initialization flag of the given context local.
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
4367 #undef FOR_EACH_NUMERIC_FIELD 4370 #undef FOR_EACH_NUMERIC_FIELD
4368 kVariablePartIndex 4371 kVariablePartIndex
4369 }; 4372 };
4370 4373
4371 // The layout of the variable part of a ScopeInfo is as follows: 4374 // The layout of the variable part of a ScopeInfo is as follows:
4372 // 1. ParameterEntries: 4375 // 1. ParameterEntries:
4373 // This part stores the names of the parameters for function scopes. One 4376 // This part stores the names of the parameters for function scopes. One
4374 // slot is used per parameter, so in total this part occupies 4377 // slot is used per parameter, so in total this part occupies
4375 // ParameterCount() slots in the array. For other scopes than function 4378 // ParameterCount() slots in the array. For other scopes than function
4376 // scopes ParameterCount() is 0. 4379 // scopes ParameterCount() is 0.
4380 // 2a.StackLocalFirstSlot:
rossberg 2015/04/21 14:41:02 Nit: care to renumber?
Dmitry Lomov (no reviews) 2015/04/21 16:59:24 Done.
4381 // Index of a first stack slot for stack local.
rossberg 2015/04/21 14:41:01 Can you please expand on this comment? It is rathe
Dmitry Lomov (no reviews) 2015/04/21 16:59:24 Done.
4377 // 2. StackLocalEntries: 4382 // 2. StackLocalEntries:
4378 // Contains the names of local variables that are allocated on the stack, 4383 // Contains the names of local variables that are allocated on the stack,
4379 // in increasing order of the stack slot index. One slot is used per stack 4384 // in increasing order of the stack slot index. One slot is used per stack
4380 // local, so in total this part occupies StackLocalCount() slots in the 4385 // local, so in total this part occupies StackLocalCount() slots in the
4381 // array. 4386 // array.
4382 // 3. ContextLocalNameEntries: 4387 // 3. ContextLocalNameEntries:
4383 // Contains the names of local variables and parameters that are allocated 4388 // Contains the names of local variables and parameters that are allocated
4384 // in the context. They are stored in increasing order of the context slot 4389 // in the context. They are stored in increasing order of the context slot
4385 // index starting with Context::MIN_CONTEXT_SLOTS. One slot is used per 4390 // index starting with Context::MIN_CONTEXT_SLOTS. One slot is used per
4386 // context local, so in total this part occupies ContextLocalCount() slots 4391 // context local, so in total this part occupies ContextLocalCount() slots
4387 // in the array. 4392 // in the array.
4388 // 4. ContextLocalInfoEntries: 4393 // 4. ContextLocalInfoEntries:
4389 // Contains the variable modes and initialization flags corresponding to 4394 // Contains the variable modes and initialization flags corresponding to
4390 // the context locals in ContextLocalNameEntries. One slot is used per 4395 // the context locals in ContextLocalNameEntries. One slot is used per
4391 // context local, so in total this part occupies ContextLocalCount() 4396 // context local, so in total this part occupies ContextLocalCount()
4392 // slots in the array. 4397 // slots in the array.
4393 // 5. StrongModeFreeVariableNameEntries: 4398 // 5. StrongModeFreeVariableNameEntries:
4394 // Stores the names of strong mode free variables. 4399 // Stores the names of strong mode free variables.
4395 // 6. StrongModeFreeVariablePositionEntries: 4400 // 6. StrongModeFreeVariablePositionEntries:
4396 // Stores the locations (start and end position) of strong mode free 4401 // Stores the locations (start and end position) of strong mode free
4397 // variables. 4402 // variables.
4398 // 7. FunctionNameEntryIndex: 4403 // 7. FunctionNameEntryIndex:
4399 // If the scope belongs to a named function expression this part contains 4404 // If the scope belongs to a named function expression this part contains
4400 // information about the function variable. It always occupies two array 4405 // information about the function variable. It always occupies two array
4401 // slots: a. The name of the function variable. 4406 // slots: a. The name of the function variable.
4402 // b. The context or stack slot index for the variable. 4407 // b. The context or stack slot index for the variable.
4403 int ParameterEntriesIndex(); 4408 int ParameterEntriesIndex();
4409 int StackLocalFirstSlotIndex();
4404 int StackLocalEntriesIndex(); 4410 int StackLocalEntriesIndex();
4405 int ContextLocalNameEntriesIndex(); 4411 int ContextLocalNameEntriesIndex();
4406 int ContextLocalInfoEntriesIndex(); 4412 int ContextLocalInfoEntriesIndex();
4407 int StrongModeFreeVariableNameEntriesIndex(); 4413 int StrongModeFreeVariableNameEntriesIndex();
4408 int StrongModeFreeVariablePositionEntriesIndex(); 4414 int StrongModeFreeVariablePositionEntriesIndex();
4409 int FunctionNameEntryIndex(); 4415 int FunctionNameEntryIndex();
4410 4416
4411 // Location of the function variable for named function expressions. 4417 // Location of the function variable for named function expressions.
4412 enum FunctionVariableInfo { 4418 enum FunctionVariableInfo {
4413 NONE, // No function name present. 4419 NONE, // No function name present.
(...skipping 6677 matching lines...) Expand 10 before | Expand all | Expand 10 after
11091 } else { 11097 } else {
11092 value &= ~(1 << bit_position); 11098 value &= ~(1 << bit_position);
11093 } 11099 }
11094 return value; 11100 return value;
11095 } 11101 }
11096 }; 11102 };
11097 11103
11098 } } // namespace v8::internal 11104 } } // namespace v8::internal
11099 11105
11100 #endif // V8_OBJECTS_H_ 11106 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/parser.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698