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 | |
4697 // Used for the function name variable for named function expressions, and for | 4689 // Used for the function name variable for named function expressions, and for |
4698 // the receiver. | 4690 // the receiver. |
4699 enum VariableAllocationInfo { NONE, STACK, CONTEXT, UNUSED }; | 4691 enum VariableAllocationInfo { NONE, STACK, CONTEXT, UNUSED }; |
4700 | 4692 |
4701 // Properties of scopes. | 4693 // Properties of scopes. |
4702 class ScopeTypeField : public BitField<ScopeType, 0, 4> {}; | 4694 class ScopeTypeField : public BitField<ScopeType, 0, 4> {}; |
4703 class CallsEvalField : public BitField<bool, ScopeTypeField::kNext, 1> {}; | 4695 class CallsEvalField : public BitField<bool, ScopeTypeField::kNext, 1> {}; |
4704 STATIC_ASSERT(LANGUAGE_END == 2); | 4696 STATIC_ASSERT(LANGUAGE_END == 2); |
4705 class LanguageModeField | 4697 class LanguageModeField |
4706 : public BitField<LanguageMode, CallsEvalField::kNext, 1> {}; | 4698 : public BitField<LanguageMode, CallsEvalField::kNext, 1> {}; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4754 kImportNameIndex, | 4746 kImportNameIndex, |
4755 kModuleRequestIndex, | 4747 kModuleRequestIndex, |
4756 kLength | 4748 kLength |
4757 }; | 4749 }; |
4758 }; | 4750 }; |
4759 | 4751 |
4760 // ModuleInfo is to ModuleDescriptor what ScopeInfo is to Scope. | 4752 // ModuleInfo is to ModuleDescriptor what ScopeInfo is to Scope. |
4761 class ModuleInfo : public FixedArray { | 4753 class ModuleInfo : public FixedArray { |
4762 public: | 4754 public: |
4763 DECLARE_CAST(ModuleInfo) | 4755 DECLARE_CAST(ModuleInfo) |
4764 | |
4765 static Handle<ModuleInfo> New(Isolate* isolate, Zone* zone, | 4756 static Handle<ModuleInfo> New(Isolate* isolate, Zone* zone, |
4766 ModuleDescriptor* descr); | 4757 ModuleDescriptor* descr); |
4767 | |
4768 inline FixedArray* module_requests() const; | 4758 inline FixedArray* module_requests() const; |
4769 inline FixedArray* special_exports() const; | 4759 inline FixedArray* special_exports() const; |
4770 inline FixedArray* regular_exports() const; | 4760 inline FixedArray* regular_exports() const; |
4771 inline FixedArray* namespace_imports() const; | 4761 inline FixedArray* namespace_imports() const; |
4772 inline FixedArray* regular_imports() const; | 4762 inline FixedArray* regular_imports() const; |
4773 | 4763 |
4774 static Handle<ModuleInfoEntry> LookupRegularImport(Handle<ModuleInfo> info, | |
4775 Handle<String> local_name); | |
4776 | |
4777 #ifdef DEBUG | 4764 #ifdef DEBUG |
4778 inline bool Equals(ModuleInfo* other) const; | 4765 inline bool Equals(ModuleInfo* other) const; |
4779 #endif | 4766 #endif |
4780 | 4767 |
4781 private: | 4768 private: |
4782 friend class Factory; | 4769 friend class Factory; |
4783 enum { | 4770 enum { |
4784 kModuleRequestsIndex, | 4771 kModuleRequestsIndex, |
4785 kSpecialExportsIndex, | 4772 kSpecialExportsIndex, |
4786 kRegularExportsIndex, | 4773 kRegularExportsIndex, |
(...skipping 6956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11743 } | 11730 } |
11744 return value; | 11731 return value; |
11745 } | 11732 } |
11746 }; | 11733 }; |
11747 | 11734 |
11748 | 11735 |
11749 } // NOLINT, false-positive due to second-order macros. | 11736 } // NOLINT, false-positive due to second-order macros. |
11750 } // NOLINT, false-positive due to second-order macros. | 11737 } // NOLINT, false-positive due to second-order macros. |
11751 | 11738 |
11752 #endif // V8_OBJECTS_H_ | 11739 #endif // V8_OBJECTS_H_ |
OLD | NEW |