Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: src/parser.cc

Issue 633053002: Do not save/restore AST id generator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 #define CHECK_FAILED /**/); \ 336 #define CHECK_FAILED /**/); \
337 if (failed_) return NULL; \ 337 if (failed_) return NULL; \
338 ((void)0 338 ((void)0
339 #define DUMMY ) // to make indentation work 339 #define DUMMY ) // to make indentation work
340 #undef DUMMY 340 #undef DUMMY
341 341
342 // ---------------------------------------------------------------------------- 342 // ----------------------------------------------------------------------------
343 // Implementation of Parser 343 // Implementation of Parser
344 344
345 class ParserTraits::Checkpoint
346 : public ParserBase<ParserTraits>::CheckpointBase {
347 public:
348 explicit Checkpoint(ParserBase<ParserTraits>* parser)
349 : CheckpointBase(parser), parser_(parser) {
350 saved_ast_node_id_gen_ = *parser_->ast_node_id_gen_;
351 }
352
353 void Restore() {
354 CheckpointBase::Restore();
355 *parser_->ast_node_id_gen_ = saved_ast_node_id_gen_;
356 }
357
358 private:
359 ParserBase<ParserTraits>* parser_;
360 AstNode::IdGen saved_ast_node_id_gen_;
361 };
362
363
364 bool ParserTraits::IsEvalOrArguments(const AstRawString* identifier) const { 345 bool ParserTraits::IsEvalOrArguments(const AstRawString* identifier) const {
365 return identifier == parser_->ast_value_factory()->eval_string() || 346 return identifier == parser_->ast_value_factory()->eval_string() ||
366 identifier == parser_->ast_value_factory()->arguments_string(); 347 identifier == parser_->ast_value_factory()->arguments_string();
367 } 348 }
368 349
369 350
370 bool ParserTraits::IsPrototype(const AstRawString* identifier) const { 351 bool ParserTraits::IsPrototype(const AstRawString* identifier) const {
371 return identifier == parser_->ast_value_factory()->prototype_string(); 352 return identifier == parser_->ast_value_factory()->prototype_string();
372 } 353 }
373 354
(...skipping 4594 matching lines...) Expand 10 before | Expand all | Expand 10 after
4968 4949
4969 // We cannot internalize on a background thread; a foreground task will take 4950 // We cannot internalize on a background thread; a foreground task will take
4970 // care of calling Parser::Internalize just before compilation. 4951 // care of calling Parser::Internalize just before compilation.
4971 4952
4972 if (compile_options() == ScriptCompiler::kProduceParserCache) { 4953 if (compile_options() == ScriptCompiler::kProduceParserCache) {
4973 if (result != NULL) *info_->cached_data() = recorder.GetScriptData(); 4954 if (result != NULL) *info_->cached_data() = recorder.GetScriptData();
4974 log_ = NULL; 4955 log_ = NULL;
4975 } 4956 }
4976 } 4957 }
4977 } } // namespace v8::internal 4958 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698