| Index: src/parser.h
|
| diff --git a/src/parser.h b/src/parser.h
|
| index 2d5ce2f3760bc929fa04eb967c54ef39db691e63..89f40db8d60fbab2257c0283f11c0d54fc58162e 100644
|
| --- a/src/parser.h
|
| +++ b/src/parser.h
|
| @@ -339,6 +339,28 @@ class RegExpParser BASE_EMBEDDED {
|
| // ----------------------------------------------------------------------------
|
| // JAVASCRIPT PARSING
|
|
|
| +
|
| +class ParserCheckpoint BASE_EMBEDDED {
|
| + public:
|
| + ParserCheckpoint() : isolate_(NULL) {}
|
| +
|
| + template <typename Parser>
|
| + void Save(Parser* parser) {
|
| + DCHECK(!isolate_);
|
| + isolate_ = parser->zone()->isolate();
|
| + saved_ast_node_id_ = isolate_->ast_node_id();
|
| + }
|
| + void Restore() {
|
| + DCHECK(isolate_);
|
| + isolate_->set_ast_node_id(saved_ast_node_id_);
|
| + }
|
| +
|
| + private:
|
| + Isolate* isolate_;
|
| + int saved_ast_node_id_;
|
| +};
|
| +
|
| +
|
| class Parser;
|
| class SingletonLogger;
|
|
|
| @@ -354,6 +376,7 @@ class ParserTraits {
|
| typedef v8::internal::Scope* ScopePtr;
|
| typedef Variable GeneratorVariable;
|
| typedef v8::internal::Zone Zone;
|
| + typedef ParserCheckpoint Checkpoint;
|
|
|
| typedef v8::internal::AstProperties AstProperties;
|
| typedef Vector<VariableProxy*> ParameterIdentifierVector;
|
|
|