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 4528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4539 | 4539 |
4540 // Lookup support for serialized scope info. Returns the local context slot | 4540 // Lookup support for serialized scope info. Returns the local context slot |
4541 // index for a given slot name if the slot is present; otherwise | 4541 // index for a given slot name if the slot is present; otherwise |
4542 // returns a value < 0. The name must be an internalized string. | 4542 // returns a value < 0. The name must be an internalized string. |
4543 // If the slot is present and mode != NULL, sets *mode to the corresponding | 4543 // If the slot is present and mode != NULL, sets *mode to the corresponding |
4544 // mode for that variable. | 4544 // mode for that variable. |
4545 static int ContextSlotIndex(Handle<ScopeInfo> scope_info, Handle<String> name, | 4545 static int ContextSlotIndex(Handle<ScopeInfo> scope_info, Handle<String> name, |
4546 VariableMode* mode, InitializationFlag* init_flag, | 4546 VariableMode* mode, InitializationFlag* init_flag, |
4547 MaybeAssignedFlag* maybe_assigned_flag); | 4547 MaybeAssignedFlag* maybe_assigned_flag); |
4548 | 4548 |
4549 // Lookup metadata of a MODULE-allocated variable. Return a negative value if | 4549 // Lookup metadata of a MODULE-allocated variable. Return 0 if there is no |
4550 // there is no module variable with the given name. | 4550 // module variable with the given name (the index value of a MODUULE variable |
adamk
2016/10/31 18:25:04
Typo: s/MODUULE/MODULE/
neis
2016/11/03 10:43:48
Done.
| |
4551 // is never 0). | |
4551 int ModuleIndex(Handle<String> name, VariableMode* mode, | 4552 int ModuleIndex(Handle<String> name, VariableMode* mode, |
4552 InitializationFlag* init_flag, | 4553 InitializationFlag* init_flag, |
4553 MaybeAssignedFlag* maybe_assigned_flag); | 4554 MaybeAssignedFlag* maybe_assigned_flag); |
4554 | 4555 |
4555 // Lookup the name of a certain context slot by its index. | 4556 // Lookup the name of a certain context slot by its index. |
4556 String* ContextSlotName(int slot_index); | 4557 String* ContextSlotName(int slot_index); |
4557 | 4558 |
4558 // Lookup support for serialized scope info. Returns the | 4559 // Lookup support for serialized scope info. Returns the |
4559 // parameter index for a given parameter name if the parameter is present; | 4560 // parameter index for a given parameter name if the parameter is present; |
4560 // otherwise returns a value < 0. The name must be an internalized string. | 4561 // otherwise returns a value < 0. The name must be an internalized string. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4733 friend class ScopeIterator; | 4734 friend class ScopeIterator; |
4734 }; | 4735 }; |
4735 | 4736 |
4736 class ModuleInfoEntry : public FixedArray { | 4737 class ModuleInfoEntry : public FixedArray { |
4737 public: | 4738 public: |
4738 DECLARE_CAST(ModuleInfoEntry) | 4739 DECLARE_CAST(ModuleInfoEntry) |
4739 static Handle<ModuleInfoEntry> New(Isolate* isolate, | 4740 static Handle<ModuleInfoEntry> New(Isolate* isolate, |
4740 Handle<Object> export_name, | 4741 Handle<Object> export_name, |
4741 Handle<Object> local_name, | 4742 Handle<Object> local_name, |
4742 Handle<Object> import_name, | 4743 Handle<Object> import_name, |
4743 Handle<Object> module_request, int beg_pos, | 4744 int module_request, int cell_index, |
4744 int end_pos); | 4745 int beg_pos, int end_pos); |
4745 inline Object* export_name() const; | 4746 inline Object* export_name() const; |
4746 inline Object* local_name() const; | 4747 inline Object* local_name() const; |
4747 inline Object* import_name() const; | 4748 inline Object* import_name() const; |
4748 inline Object* module_request() const; | 4749 inline int module_request() const; |
4750 inline int cell_index() const; | |
4749 inline int beg_pos() const; | 4751 inline int beg_pos() const; |
4750 inline int end_pos() const; | 4752 inline int end_pos() const; |
4751 | 4753 |
4752 private: | 4754 private: |
4753 friend class Factory; | 4755 friend class Factory; |
4754 enum { | 4756 enum { |
4755 kExportNameIndex, | 4757 kExportNameIndex, |
4756 kLocalNameIndex, | 4758 kLocalNameIndex, |
4757 kImportNameIndex, | 4759 kImportNameIndex, |
4758 kModuleRequestIndex, | 4760 kModuleRequestIndex, |
4761 kCellIndexIndex, | |
4759 kBegPosIndex, | 4762 kBegPosIndex, |
4760 kEndPosIndex, | 4763 kEndPosIndex, |
4761 kLength | 4764 kLength |
4762 }; | 4765 }; |
4763 }; | 4766 }; |
4764 | 4767 |
4765 // ModuleInfo is to ModuleDescriptor what ScopeInfo is to Scope. | 4768 // ModuleInfo is to ModuleDescriptor what ScopeInfo is to Scope. |
4769 // TODO(neis): Use Struct instead of FixedArray. | |
4766 class ModuleInfo : public FixedArray { | 4770 class ModuleInfo : public FixedArray { |
4767 public: | 4771 public: |
4768 DECLARE_CAST(ModuleInfo) | 4772 DECLARE_CAST(ModuleInfo) |
4769 | 4773 |
4770 static Handle<ModuleInfo> New(Isolate* isolate, Zone* zone, | 4774 static Handle<ModuleInfo> New(Isolate* isolate, Zone* zone, |
4771 ModuleDescriptor* descr); | 4775 ModuleDescriptor* descr); |
4772 | 4776 |
4773 inline FixedArray* module_requests() const; | 4777 inline FixedArray* module_requests() const; |
4774 inline FixedArray* special_exports() const; | 4778 inline FixedArray* special_exports() const; |
4775 inline FixedArray* regular_exports() const; | 4779 inline FixedArray* regular_exports() const; |
(...skipping 6988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11764 } | 11768 } |
11765 return value; | 11769 return value; |
11766 } | 11770 } |
11767 }; | 11771 }; |
11768 | 11772 |
11769 | 11773 |
11770 } // NOLINT, false-positive due to second-order macros. | 11774 } // NOLINT, false-positive due to second-order macros. |
11771 } // NOLINT, false-positive due to second-order macros. | 11775 } // NOLINT, false-positive due to second-order macros. |
11772 | 11776 |
11773 #endif // V8_OBJECTS_H_ | 11777 #endif // V8_OBJECTS_H_ |
OLD | NEW |