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

Side by Side Diff: src/parser.h

Issue 383713002: Fix memory leak in Parser after r22314. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | 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 #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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 Parser* parser_; 554 Parser* parser_;
555 }; 555 };
556 556
557 557
558 class Parser : public ParserBase<ParserTraits> { 558 class Parser : public ParserBase<ParserTraits> {
559 public: 559 public:
560 explicit Parser(CompilationInfo* info); 560 explicit Parser(CompilationInfo* info);
561 ~Parser() { 561 ~Parser() {
562 delete reusable_preparser_; 562 delete reusable_preparser_;
563 reusable_preparser_ = NULL; 563 reusable_preparser_ = NULL;
564 delete cached_parse_data_;
565 cached_parse_data_ = NULL;
564 } 566 }
565 567
566 // Parses the source code represented by the compilation info and sets its 568 // Parses the source code represented by the compilation info and sets its
567 // function literal. Returns false (and deallocates any allocated AST 569 // function literal. Returns false (and deallocates any allocated AST
568 // nodes) if parsing failed. 570 // nodes) if parsing failed.
569 static bool Parse(CompilationInfo* info, 571 static bool Parse(CompilationInfo* info,
570 bool allow_lazy = false) { 572 bool allow_lazy = false) {
571 Parser parser(info); 573 Parser parser(info);
572 parser.set_allow_lazy(allow_lazy); 574 parser.set_allow_lazy(allow_lazy);
573 return parser.Parse(); 575 return parser.Parse();
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 private: 806 private:
805 static const int kLiteralTypeSlot = 0; 807 static const int kLiteralTypeSlot = 0;
806 static const int kElementsSlot = 1; 808 static const int kElementsSlot = 1;
807 809
808 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); 810 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue);
809 }; 811 };
810 812
811 } } // namespace v8::internal 813 } } // namespace v8::internal
812 814
813 #endif // V8_PARSER_H_ 815 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698