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 4668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4679 int FunctionNameInfoIndex(); | 4679 int FunctionNameInfoIndex(); |
4680 int OuterScopeInfoIndex(); | 4680 int OuterScopeInfoIndex(); |
4681 int ModuleInfoIndex(); | 4681 int ModuleInfoIndex(); |
4682 int ModuleVariableCountIndex(); | 4682 int ModuleVariableCountIndex(); |
4683 int ModuleVariablesIndex(); | 4683 int ModuleVariablesIndex(); |
4684 | 4684 |
4685 int Lookup(Handle<String> name, int start, int end, VariableMode* mode, | 4685 int Lookup(Handle<String> name, int start, int end, VariableMode* mode, |
4686 VariableLocation* location, InitializationFlag* init_flag, | 4686 VariableLocation* location, InitializationFlag* init_flag, |
4687 MaybeAssignedFlag* maybe_assigned_flag); | 4687 MaybeAssignedFlag* maybe_assigned_flag); |
4688 | 4688 |
| 4689 // Get metadata of i-th MODULE-allocated variable, where 0 <= i < |
| 4690 // ModuleVariableCount. The metadata is returned via out-arguments, which may |
| 4691 // be nullptr if the corresponding information is not requested |
| 4692 void ModuleVariable(int i, String** name, int* index, |
| 4693 VariableMode* mode = nullptr, |
| 4694 InitializationFlag* init_flag = nullptr, |
| 4695 MaybeAssignedFlag* maybe_assigned_flag = nullptr); |
| 4696 |
4689 // Used for the function name variable for named function expressions, and for | 4697 // Used for the function name variable for named function expressions, and for |
4690 // the receiver. | 4698 // the receiver. |
4691 enum VariableAllocationInfo { NONE, STACK, CONTEXT, UNUSED }; | 4699 enum VariableAllocationInfo { NONE, STACK, CONTEXT, UNUSED }; |
4692 | 4700 |
4693 // Properties of scopes. | 4701 // Properties of scopes. |
4694 class ScopeTypeField : public BitField<ScopeType, 0, 4> {}; | 4702 class ScopeTypeField : public BitField<ScopeType, 0, 4> {}; |
4695 class CallsEvalField : public BitField<bool, ScopeTypeField::kNext, 1> {}; | 4703 class CallsEvalField : public BitField<bool, ScopeTypeField::kNext, 1> {}; |
4696 STATIC_ASSERT(LANGUAGE_END == 2); | 4704 STATIC_ASSERT(LANGUAGE_END == 2); |
4697 class LanguageModeField | 4705 class LanguageModeField |
4698 : public BitField<LanguageMode, CallsEvalField::kNext, 1> {}; | 4706 : public BitField<LanguageMode, CallsEvalField::kNext, 1> {}; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4746 kImportNameIndex, | 4754 kImportNameIndex, |
4747 kModuleRequestIndex, | 4755 kModuleRequestIndex, |
4748 kLength | 4756 kLength |
4749 }; | 4757 }; |
4750 }; | 4758 }; |
4751 | 4759 |
4752 // ModuleInfo is to ModuleDescriptor what ScopeInfo is to Scope. | 4760 // ModuleInfo is to ModuleDescriptor what ScopeInfo is to Scope. |
4753 class ModuleInfo : public FixedArray { | 4761 class ModuleInfo : public FixedArray { |
4754 public: | 4762 public: |
4755 DECLARE_CAST(ModuleInfo) | 4763 DECLARE_CAST(ModuleInfo) |
| 4764 |
4756 static Handle<ModuleInfo> New(Isolate* isolate, Zone* zone, | 4765 static Handle<ModuleInfo> New(Isolate* isolate, Zone* zone, |
4757 ModuleDescriptor* descr); | 4766 ModuleDescriptor* descr); |
| 4767 |
4758 inline FixedArray* module_requests() const; | 4768 inline FixedArray* module_requests() const; |
4759 inline FixedArray* special_exports() const; | 4769 inline FixedArray* special_exports() const; |
4760 inline FixedArray* regular_exports() const; | 4770 inline FixedArray* regular_exports() const; |
4761 inline FixedArray* namespace_imports() const; | 4771 inline FixedArray* namespace_imports() const; |
4762 inline FixedArray* regular_imports() const; | 4772 inline FixedArray* regular_imports() const; |
4763 | 4773 |
| 4774 static Handle<ModuleInfoEntry> LookupRegularImport(Handle<ModuleInfo> info, |
| 4775 Handle<String> local_name); |
| 4776 |
4764 #ifdef DEBUG | 4777 #ifdef DEBUG |
4765 inline bool Equals(ModuleInfo* other) const; | 4778 inline bool Equals(ModuleInfo* other) const; |
4766 #endif | 4779 #endif |
4767 | 4780 |
4768 private: | 4781 private: |
4769 friend class Factory; | 4782 friend class Factory; |
4770 enum { | 4783 enum { |
4771 kModuleRequestsIndex, | 4784 kModuleRequestsIndex, |
4772 kSpecialExportsIndex, | 4785 kSpecialExportsIndex, |
4773 kRegularExportsIndex, | 4786 kRegularExportsIndex, |
(...skipping 6969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11743 } | 11756 } |
11744 return value; | 11757 return value; |
11745 } | 11758 } |
11746 }; | 11759 }; |
11747 | 11760 |
11748 | 11761 |
11749 } // NOLINT, false-positive due to second-order macros. | 11762 } // NOLINT, false-positive due to second-order macros. |
11750 } // NOLINT, false-positive due to second-order macros. | 11763 } // NOLINT, false-positive due to second-order macros. |
11751 | 11764 |
11752 #endif // V8_OBJECTS_H_ | 11765 #endif // V8_OBJECTS_H_ |
OLD | NEW |