OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 class ConsString; | 872 class ConsString; |
873 class ElementsAccessor; | 873 class ElementsAccessor; |
874 class FixedArrayBase; | 874 class FixedArrayBase; |
875 class FunctionLiteral; | 875 class FunctionLiteral; |
876 class JSGlobalObject; | 876 class JSGlobalObject; |
877 class KeyAccumulator; | 877 class KeyAccumulator; |
878 class LayoutDescriptor; | 878 class LayoutDescriptor; |
879 class LiteralsArray; | 879 class LiteralsArray; |
880 class LookupIterator; | 880 class LookupIterator; |
881 class FieldType; | 881 class FieldType; |
| 882 class ModuleInfo; |
882 class ObjectHashTable; | 883 class ObjectHashTable; |
883 class ObjectVisitor; | 884 class ObjectVisitor; |
884 class PropertyCell; | 885 class PropertyCell; |
885 class PropertyDescriptor; | 886 class PropertyDescriptor; |
886 class SafepointEntry; | 887 class SafepointEntry; |
887 class SharedFunctionInfo; | 888 class SharedFunctionInfo; |
888 class StringStream; | 889 class StringStream; |
889 class TypeFeedbackInfo; | 890 class TypeFeedbackInfo; |
890 class TypeFeedbackMetadata; | 891 class TypeFeedbackMetadata; |
891 class TypeFeedbackVector; | 892 class TypeFeedbackVector; |
(...skipping 3414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4306 inline bool IsAsmModule(); | 4307 inline bool IsAsmModule(); |
4307 | 4308 |
4308 // Return if this is a nested function within an asm module scope. | 4309 // Return if this is a nested function within an asm module scope. |
4309 inline bool IsAsmFunction(); | 4310 inline bool IsAsmFunction(); |
4310 | 4311 |
4311 inline bool HasSimpleParameters(); | 4312 inline bool HasSimpleParameters(); |
4312 | 4313 |
4313 // Return the function_name if present. | 4314 // Return the function_name if present. |
4314 String* FunctionName(); | 4315 String* FunctionName(); |
4315 | 4316 |
| 4317 ModuleInfo* ModuleDescriptorInfo(); |
| 4318 |
4316 // Return the name of the given parameter. | 4319 // Return the name of the given parameter. |
4317 String* ParameterName(int var); | 4320 String* ParameterName(int var); |
4318 | 4321 |
4319 // Return the name of the given local. | 4322 // Return the name of the given local. |
4320 String* LocalName(int var); | 4323 String* LocalName(int var); |
4321 | 4324 |
4322 // Return the name of the given stack local. | 4325 // Return the name of the given stack local. |
4323 String* StackLocalName(int var); | 4326 String* StackLocalName(int var); |
4324 | 4327 |
4325 // Return the name of the given stack local. | 4328 // Return the name of the given stack local. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4359 // Similar to ContextSlotIndex() but this method searches only among | 4362 // Similar to ContextSlotIndex() but this method searches only among |
4360 // global slots of the serialized scope info. Returns the context slot index | 4363 // global slots of the serialized scope info. Returns the context slot index |
4361 // for a given slot name if the slot is present; otherwise returns a | 4364 // for a given slot name if the slot is present; otherwise returns a |
4362 // value < 0. The name must be an internalized string. If the slot is present | 4365 // value < 0. The name must be an internalized string. If the slot is present |
4363 // and mode != NULL, sets *mode to the corresponding mode for that variable. | 4366 // and mode != NULL, sets *mode to the corresponding mode for that variable. |
4364 static int ContextGlobalSlotIndex(Handle<ScopeInfo> scope_info, | 4367 static int ContextGlobalSlotIndex(Handle<ScopeInfo> scope_info, |
4365 Handle<String> name, VariableMode* mode, | 4368 Handle<String> name, VariableMode* mode, |
4366 InitializationFlag* init_flag, | 4369 InitializationFlag* init_flag, |
4367 MaybeAssignedFlag* maybe_assigned_flag); | 4370 MaybeAssignedFlag* maybe_assigned_flag); |
4368 | 4371 |
| 4372 // Lookup metadata of a MODULE-allocated variable. Return a negative value if |
| 4373 // there is no module variable with the given name. |
| 4374 static int ModuleIndex(Handle<ScopeInfo> scope_info, Handle<String> name, |
| 4375 VariableMode* mode, InitializationFlag* init_flag, |
| 4376 MaybeAssignedFlag* maybe_assigned_flag); |
| 4377 |
4369 // Lookup the name of a certain context slot by its index. | 4378 // Lookup the name of a certain context slot by its index. |
4370 String* ContextSlotName(int slot_index); | 4379 String* ContextSlotName(int slot_index); |
4371 | 4380 |
4372 // Lookup support for serialized scope info. Returns the | 4381 // Lookup support for serialized scope info. Returns the |
4373 // parameter index for a given parameter name if the parameter is present; | 4382 // parameter index for a given parameter name if the parameter is present; |
4374 // otherwise returns a value < 0. The name must be an internalized string. | 4383 // otherwise returns a value < 0. The name must be an internalized string. |
4375 int ParameterIndex(String* name); | 4384 int ParameterIndex(String* name); |
4376 | 4385 |
4377 // Lookup support for serialized scope info. Returns the function context | 4386 // Lookup support for serialized scope info. Returns the function context |
4378 // slot index if the function name is present and context-allocated (named | 4387 // slot index if the function name is present and context-allocated (named |
(...skipping 19 matching lines...) Expand all Loading... |
4398 #endif | 4407 #endif |
4399 | 4408 |
4400 // The layout of the static part of a ScopeInfo is as follows. Each entry is | 4409 // The layout of the static part of a ScopeInfo is as follows. Each entry is |
4401 // numeric and occupies one array slot. | 4410 // numeric and occupies one array slot. |
4402 // 1. A set of properties of the scope | 4411 // 1. A set of properties of the scope |
4403 // 2. The number of parameters. This only applies to function scopes. For | 4412 // 2. The number of parameters. This only applies to function scopes. For |
4404 // non-function scopes this is 0. | 4413 // non-function scopes this is 0. |
4405 // 3. The number of non-parameter variables allocated on the stack. | 4414 // 3. The number of non-parameter variables allocated on the stack. |
4406 // 4. The number of non-parameter and parameter variables allocated in the | 4415 // 4. The number of non-parameter and parameter variables allocated in the |
4407 // context. | 4416 // context. |
| 4417 // XXX |
4408 #define FOR_EACH_SCOPE_INFO_NUMERIC_FIELD(V) \ | 4418 #define FOR_EACH_SCOPE_INFO_NUMERIC_FIELD(V) \ |
4409 V(Flags) \ | 4419 V(Flags) \ |
4410 V(ParameterCount) \ | 4420 V(ParameterCount) \ |
4411 V(StackLocalCount) \ | 4421 V(StackLocalCount) \ |
4412 V(ContextLocalCount) \ | 4422 V(ContextLocalCount) \ |
4413 V(ContextGlobalCount) | 4423 V(ContextGlobalCount) |
4414 | 4424 |
4415 #define FIELD_ACCESSORS(name) \ | 4425 #define FIELD_ACCESSORS(name) \ |
4416 inline void Set##name(int value); \ | 4426 inline void Set##name(int value); \ |
4417 inline int name(); | 4427 inline int name(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4462 // b. The context or stack slot index for the variable. | 4472 // b. The context or stack slot index for the variable. |
4463 int ParameterEntriesIndex(); | 4473 int ParameterEntriesIndex(); |
4464 int StackLocalFirstSlotIndex(); | 4474 int StackLocalFirstSlotIndex(); |
4465 int StackLocalEntriesIndex(); | 4475 int StackLocalEntriesIndex(); |
4466 int ContextLocalNameEntriesIndex(); | 4476 int ContextLocalNameEntriesIndex(); |
4467 int ContextGlobalNameEntriesIndex(); | 4477 int ContextGlobalNameEntriesIndex(); |
4468 int ContextLocalInfoEntriesIndex(); | 4478 int ContextLocalInfoEntriesIndex(); |
4469 int ContextGlobalInfoEntriesIndex(); | 4479 int ContextGlobalInfoEntriesIndex(); |
4470 int ReceiverEntryIndex(); | 4480 int ReceiverEntryIndex(); |
4471 int FunctionNameEntryIndex(); | 4481 int FunctionNameEntryIndex(); |
| 4482 int ModuleInfoEntryIndex(); |
4472 | 4483 |
4473 int Lookup(Handle<String> name, int start, int end, VariableMode* mode, | 4484 int Lookup(Handle<String> name, int start, int end, VariableMode* mode, |
4474 VariableLocation* location, InitializationFlag* init_flag, | 4485 VariableLocation* location, InitializationFlag* init_flag, |
4475 MaybeAssignedFlag* maybe_assigned_flag); | 4486 MaybeAssignedFlag* maybe_assigned_flag); |
4476 | 4487 |
4477 // Used for the function name variable for named function expressions, and for | 4488 // Used for the function name variable for named function expressions, and for |
4478 // the receiver. | 4489 // the receiver. |
4479 enum VariableAllocationInfo { NONE, STACK, CONTEXT, UNUSED }; | 4490 enum VariableAllocationInfo { NONE, STACK, CONTEXT, UNUSED }; |
4480 | 4491 |
4481 // Properties of scopes. | 4492 // Properties of scopes. |
(...skipping 6689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11171 } | 11182 } |
11172 return value; | 11183 return value; |
11173 } | 11184 } |
11174 }; | 11185 }; |
11175 | 11186 |
11176 | 11187 |
11177 } // NOLINT, false-positive due to second-order macros. | 11188 } // NOLINT, false-positive due to second-order macros. |
11178 } // NOLINT, false-positive due to second-order macros. | 11189 } // NOLINT, false-positive due to second-order macros. |
11179 | 11190 |
11180 #endif // V8_OBJECTS_H_ | 11191 #endif // V8_OBJECTS_H_ |
OLD | NEW |