5 #ifndef V8_PARSING_PREPARSED_SCOPE_DATA_H_ 6 #define V8_PARSING_PREPARSED_SCOPE_DATA_H_ 8 #include "src/globals.h" 9 #include "src/handles.h" 10 #include "src/maybe-handles.h" 11 #include "src/zone/zone-chunk-list.h" 12 #include "src/zone/zone-containers.h" 21 class PreParsedScopeData;
22 class ZonePreParsedScopeData;
105 bool bailed_out()
const {
return bailed_out_; }
108 bool ThisOrParentBailedOut()
const {
112 if (parent_ ==
nullptr) {
115 return parent_->ThisOrParentBailedOut();
119 bool ContainsInnerFunctions()
const;
121 static bool ScopeNeedsData(Scope* scope);
122 static bool ScopeIsSkippableFunctionScope(Scope* scope);
123 void AddSkippableFunction(
int start_position,
int end_position,
124 int num_parameters,
int num_inner_functions,
125 LanguageMode language_mode,
126 bool uses_super_property);
129 friend class BuilderProducedPreParsedScopeData;
131 virtual MaybeHandle<PreParsedScopeData> Serialize(Isolate* isolate);
132 virtual ZonePreParsedScopeData* Serialize(Zone* zone);
134 void SaveDataForScope(Scope* scope);
135 void SaveDataForVariable(Variable* var);
136 void SaveDataForInnerScopes(Scope* scope);
138 PreParsedScopeDataBuilder* parent_;
140 ByteData* byte_data_;
141 ZoneChunkList<PreParsedScopeDataBuilder*> data_for_inner_functions_;
146 DISALLOW_COPY_AND_ASSIGN(PreParsedScopeDataBuilder);
181 static std::unique_ptr<ConsumedPreParsedScopeData> For(
186 static std::unique_ptr<ConsumedPreParsedScopeData> For(
192 Zone* zone,
int start_position,
int* end_position,
int* num_parameters,
193 int* num_inner_functions,
bool* uses_super_property,
194 LanguageMode* language_mode) = 0;
210 #endif // V8_PARSING_PREPARSED_SCOPE_DATA_H_