| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_PARSING_PARSE_INFO_H_ | 5 #ifndef V8_PARSING_PARSE_INFO_H_ |
| 6 #define V8_PARSING_PARSE_INFO_H_ | 6 #define V8_PARSING_PARSE_INFO_H_ |
| 7 | 7 |
| 8 #include "include/v8.h" | 8 #include "include/v8.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/handles.h" | 10 #include "src/handles.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 } | 140 } |
| 141 | 141 |
| 142 int start_position() const { return start_position_; } | 142 int start_position() const { return start_position_; } |
| 143 void set_start_position(int start_position) { | 143 void set_start_position(int start_position) { |
| 144 start_position_ = start_position; | 144 start_position_ = start_position; |
| 145 } | 145 } |
| 146 | 146 |
| 147 int end_position() const { return end_position_; } | 147 int end_position() const { return end_position_; } |
| 148 void set_end_position(int end_position) { end_position_ = end_position; } | 148 void set_end_position(int end_position) { end_position_ = end_position; } |
| 149 | 149 |
| 150 int parameters_end_pos() const { return parameters_end_pos_; } |
| 151 void set_parameters_end_pos(int parameters_end_pos) { |
| 152 parameters_end_pos_ = parameters_end_pos; |
| 153 } |
| 154 |
| 150 // Getters for individual compiler hints. | 155 // Getters for individual compiler hints. |
| 151 bool is_declaration() const; | 156 bool is_declaration() const; |
| 152 bool requires_class_field_init() const; | 157 bool requires_class_field_init() const; |
| 153 bool is_class_field_initializer() const; | 158 bool is_class_field_initializer() const; |
| 154 FunctionKind function_kind() const; | 159 FunctionKind function_kind() const; |
| 155 | 160 |
| 156 //-------------------------------------------------------------------------- | 161 //-------------------------------------------------------------------------- |
| 157 // TODO(titzer): these should not be part of ParseInfo. | 162 // TODO(titzer): these should not be part of ParseInfo. |
| 158 //-------------------------------------------------------------------------- | 163 //-------------------------------------------------------------------------- |
| 159 Isolate* isolate() const { return isolate_; } | 164 Isolate* isolate() const { return isolate_; } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 Utf16CharacterStream* character_stream_; | 225 Utf16CharacterStream* character_stream_; |
| 221 v8::Extension* extension_; | 226 v8::Extension* extension_; |
| 222 ScriptCompiler::CompileOptions compile_options_; | 227 ScriptCompiler::CompileOptions compile_options_; |
| 223 DeclarationScope* script_scope_; | 228 DeclarationScope* script_scope_; |
| 224 UnicodeCache* unicode_cache_; | 229 UnicodeCache* unicode_cache_; |
| 225 uintptr_t stack_limit_; | 230 uintptr_t stack_limit_; |
| 226 uint32_t hash_seed_; | 231 uint32_t hash_seed_; |
| 227 int compiler_hints_; | 232 int compiler_hints_; |
| 228 int start_position_; | 233 int start_position_; |
| 229 int end_position_; | 234 int end_position_; |
| 235 int parameters_end_pos_; |
| 230 | 236 |
| 231 // TODO(titzer): Move handles and isolate out of ParseInfo. | 237 // TODO(titzer): Move handles and isolate out of ParseInfo. |
| 232 Isolate* isolate_; | 238 Isolate* isolate_; |
| 233 Handle<SharedFunctionInfo> shared_; | 239 Handle<SharedFunctionInfo> shared_; |
| 234 Handle<Script> script_; | 240 Handle<Script> script_; |
| 235 MaybeHandle<ScopeInfo> maybe_outer_scope_info_; | 241 MaybeHandle<ScopeInfo> maybe_outer_scope_info_; |
| 236 | 242 |
| 237 //----------- Inputs+Outputs of parsing and scope analysis ----------------- | 243 //----------- Inputs+Outputs of parsing and scope analysis ----------------- |
| 238 ScriptData** cached_data_; // used if available, populated if requested. | 244 ScriptData** cached_data_; // used if available, populated if requested. |
| 239 AstValueFactory* ast_value_factory_; // used if available, otherwise new. | 245 AstValueFactory* ast_value_factory_; // used if available, otherwise new. |
| 240 const AstRawString* function_name_; | 246 const AstRawString* function_name_; |
| 241 | 247 |
| 242 //----------- Output of parsing and scope analysis ------------------------ | 248 //----------- Output of parsing and scope analysis ------------------------ |
| 243 FunctionLiteral* literal_; | 249 FunctionLiteral* literal_; |
| 244 | 250 |
| 245 void SetFlag(Flag f) { flags_ |= f; } | 251 void SetFlag(Flag f) { flags_ |= f; } |
| 246 void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; } | 252 void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; } |
| 247 bool GetFlag(Flag f) const { return (flags_ & f) != 0; } | 253 bool GetFlag(Flag f) const { return (flags_ & f) != 0; } |
| 248 }; | 254 }; |
| 249 | 255 |
| 250 } // namespace internal | 256 } // namespace internal |
| 251 } // namespace v8 | 257 } // namespace v8 |
| 252 | 258 |
| 253 #endif // V8_PARSING_PARSE_INFO_H_ | 259 #endif // V8_PARSING_PARSE_INFO_H_ |
| OLD | NEW |