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

Unified Diff: src/parser.h

Issue 913183005: Inline the ParseInfo structure as parameters to the Parser constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/background-parsing-task.cc ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index a91f62ad50f2bfc43b1260b89e3f6218a25ecf24..c1b0361980d23bdc4c3de4bf2134210e4940abcf 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -635,16 +635,8 @@ class ParserTraits {
class Parser : public ParserBase<ParserTraits> {
public:
- // Note that the hash seed in ParseInfo must be the hash seed from the
- // Isolate's heap, otherwise the heap will be in an inconsistent state once
- // the strings created by the Parser are internalized.
- struct ParseInfo {
- uintptr_t stack_limit;
- uint32_t hash_seed;
- UnicodeCache* unicode_cache;
- };
-
- Parser(CompilationInfo* info, ParseInfo* parse_info);
+ Parser(CompilationInfo* info, uintptr_t stack_limit, uint32_t hash_seed,
+ UnicodeCache* unicode_cache);
~Parser() {
delete reusable_preparser_;
reusable_preparser_ = NULL;
@@ -655,19 +647,7 @@ class Parser : public ParserBase<ParserTraits> {
// Parses the source code represented by the compilation info and sets its
// function literal. Returns false (and deallocates any allocated AST
// nodes) if parsing failed.
- static bool Parse(CompilationInfo* info,
- bool allow_lazy = false) {
- ParseInfo parse_info = {info->isolate()->stack_guard()->real_climit(),
- info->isolate()->heap()->HashSeed(),
- info->isolate()->unicode_cache()};
- Parser parser(info, &parse_info);
- parser.set_allow_lazy(allow_lazy);
- if (parser.Parse()) {
- info->SetLanguageMode(info->function()->language_mode());
- return true;
- }
- return false;
- }
+ static bool Parse(CompilationInfo* info, bool allow_lazy = false);
bool Parse();
void ParseOnBackground();
« no previous file with comments | « src/background-parsing-task.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698