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