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

Side by Side Diff: tools/parser-shell.cc

Issue 2645613008: Revert of [Parse] ParseInfo owns the parsing Zone. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « test/fuzzer/parser.cc ('k') | 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 break; 87 break;
88 } 88 }
89 } 89 }
90 v8::base::TimeDelta parse_time1, parse_time2; 90 v8::base::TimeDelta parse_time1, parse_time2;
91 Handle<Script> script = 91 Handle<Script> script =
92 reinterpret_cast<i::Isolate*>(isolate)->factory()->NewScript( 92 reinterpret_cast<i::Isolate*>(isolate)->factory()->NewScript(
93 v8::Utils::OpenHandle(*source_handle)); 93 v8::Utils::OpenHandle(*source_handle));
94 i::ScriptData* cached_data_impl = NULL; 94 i::ScriptData* cached_data_impl = NULL;
95 // First round of parsing (produce data to cache). 95 // First round of parsing (produce data to cache).
96 { 96 {
97 ParseInfo info(script); 97 Zone zone(reinterpret_cast<i::Isolate*>(isolate)->allocator(), ZONE_NAME);
98 ParseInfo info(&zone, script);
98 info.set_cached_data(&cached_data_impl); 99 info.set_cached_data(&cached_data_impl);
99 info.set_compile_options(v8::ScriptCompiler::kProduceParserCache); 100 info.set_compile_options(v8::ScriptCompiler::kProduceParserCache);
100 v8::base::ElapsedTimer timer; 101 v8::base::ElapsedTimer timer;
101 timer.Start(); 102 timer.Start();
102 bool success = parsing::ParseProgram(&info); 103 bool success = parsing::ParseProgram(&info);
103 parse_time1 = timer.Elapsed(); 104 parse_time1 = timer.Elapsed();
104 if (!success) { 105 if (!success) {
105 fprintf(stderr, "Parsing failed\n"); 106 fprintf(stderr, "Parsing failed\n");
106 return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta()); 107 return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta());
107 } 108 }
108 } 109 }
109 // Second round of parsing (consume cached data). 110 // Second round of parsing (consume cached data).
110 { 111 {
111 ParseInfo info(script); 112 Zone zone(reinterpret_cast<i::Isolate*>(isolate)->allocator(), ZONE_NAME);
113 ParseInfo info(&zone, script);
112 info.set_cached_data(&cached_data_impl); 114 info.set_cached_data(&cached_data_impl);
113 info.set_compile_options(v8::ScriptCompiler::kConsumeParserCache); 115 info.set_compile_options(v8::ScriptCompiler::kConsumeParserCache);
114 v8::base::ElapsedTimer timer; 116 v8::base::ElapsedTimer timer;
115 timer.Start(); 117 timer.Start();
116 bool success = parsing::ParseProgram(&info); 118 bool success = parsing::ParseProgram(&info);
117 parse_time2 = timer.Elapsed(); 119 parse_time2 = timer.Elapsed();
118 if (!success) { 120 if (!success) {
119 fprintf(stderr, "Parsing failed\n"); 121 fprintf(stderr, "Parsing failed\n");
120 return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta()); 122 return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta());
121 } 123 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 printf("%s(SecondParseRunTime): %.f ms\n", benchmark.c_str(), 181 printf("%s(SecondParseRunTime): %.f ms\n", benchmark.c_str(),
180 second_parse_total); 182 second_parse_total);
181 } 183 }
182 } 184 }
183 v8::V8::Dispose(); 185 v8::V8::Dispose();
184 v8::V8::ShutdownPlatform(); 186 v8::V8::ShutdownPlatform();
185 delete platform; 187 delete platform;
186 delete create_params.array_buffer_allocator; 188 delete create_params.array_buffer_allocator;
187 return 0; 189 return 0;
188 } 190 }
OLDNEW
« no previous file with comments | « test/fuzzer/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698