OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_PARSER_H_ | 5 #ifndef V8_PARSER_H_ |
6 #define V8_PARSER_H_ | 6 #define V8_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 #include "src/compiler.h" // For CachedDataMode | 10 #include "src/compiler.h" // For CachedDataMode |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 // TODO(marja): To be removed. The Traits object should contain all the data | 348 // TODO(marja): To be removed. The Traits object should contain all the data |
349 // it needs. | 349 // it needs. |
350 typedef v8::internal::Parser* Parser; | 350 typedef v8::internal::Parser* Parser; |
351 | 351 |
352 // Used by FunctionState and BlockState. | 352 // Used by FunctionState and BlockState. |
353 typedef v8::internal::Scope Scope; | 353 typedef v8::internal::Scope Scope; |
354 typedef v8::internal::Scope* ScopePtr; | 354 typedef v8::internal::Scope* ScopePtr; |
355 typedef Variable GeneratorVariable; | 355 typedef Variable GeneratorVariable; |
356 typedef v8::internal::Zone Zone; | 356 typedef v8::internal::Zone Zone; |
357 | 357 |
| 358 class Checkpoint BASE_EMBEDDED { |
| 359 public: |
| 360 template <typename Parser> |
| 361 explicit Checkpoint(Parser* parser) { |
| 362 isolate_ = parser->zone()->isolate(); |
| 363 saved_ast_node_id_ = isolate_->ast_node_id(); |
| 364 } |
| 365 |
| 366 void Restore() { isolate_->set_ast_node_id(saved_ast_node_id_); } |
| 367 |
| 368 private: |
| 369 Isolate* isolate_; |
| 370 int saved_ast_node_id_; |
| 371 }; |
| 372 |
358 typedef v8::internal::AstProperties AstProperties; | 373 typedef v8::internal::AstProperties AstProperties; |
359 typedef Vector<VariableProxy*> ParameterIdentifierVector; | 374 typedef Vector<VariableProxy*> ParameterIdentifierVector; |
360 | 375 |
361 // Return types for traversing functions. | 376 // Return types for traversing functions. |
362 typedef const AstRawString* Identifier; | 377 typedef const AstRawString* Identifier; |
363 typedef v8::internal::Expression* Expression; | 378 typedef v8::internal::Expression* Expression; |
364 typedef Yield* YieldExpression; | 379 typedef Yield* YieldExpression; |
365 typedef v8::internal::FunctionLiteral* FunctionLiteral; | 380 typedef v8::internal::FunctionLiteral* FunctionLiteral; |
366 typedef v8::internal::Literal* Literal; | 381 typedef v8::internal::Literal* Literal; |
367 typedef ObjectLiteral::Property* ObjectLiteralProperty; | 382 typedef ObjectLiteral::Property* ObjectLiteralProperty; |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 private: | 898 private: |
884 static const int kLiteralTypeSlot = 0; | 899 static const int kLiteralTypeSlot = 0; |
885 static const int kElementsSlot = 1; | 900 static const int kElementsSlot = 1; |
886 | 901 |
887 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 902 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
888 }; | 903 }; |
889 | 904 |
890 } } // namespace v8::internal | 905 } } // namespace v8::internal |
891 | 906 |
892 #endif // V8_PARSER_H_ | 907 #endif // V8_PARSER_H_ |
OLD | NEW |