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

Side by Side Diff: src/compiler.cc

Issue 4244003: Remove old preparser option and behavior from the parser. (Closed)
Patch Set: Address review comment + cleanup. Created 10 years, 1 month 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 | « no previous file | src/parser.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 // No cache entry found. Do pre-parsing, if it makes sense, and compile 272 // No cache entry found. Do pre-parsing, if it makes sense, and compile
273 // the script. 273 // the script.
274 // Building preparse data that is only used immediately after is only a 274 // Building preparse data that is only used immediately after is only a
275 // saving if we might skip building the AST for lazily compiled functions. 275 // saving if we might skip building the AST for lazily compiled functions.
276 // I.e., preparse data isn't relevant when the lazy flag is off, and 276 // I.e., preparse data isn't relevant when the lazy flag is off, and
277 // for small sources, odds are that there aren't many functions 277 // for small sources, odds are that there aren't many functions
278 // that would be compiled lazily anyway, so we skip the preparse step 278 // that would be compiled lazily anyway, so we skip the preparse step
279 // in that case too. 279 // in that case too.
280 ScriptDataImpl* pre_data = input_pre_data; 280 ScriptDataImpl* pre_data = input_pre_data;
281 if (pre_data == NULL 281 if (pre_data == NULL
282 && FLAG_lazy
283 && source_length >= FLAG_min_preparse_length) { 282 && source_length >= FLAG_min_preparse_length) {
284 pre_data = ParserApi::PartialPreParse(source, NULL, extension); 283 pre_data = ParserApi::PartialPreParse(source, NULL, extension);
285 } 284 }
286 285
287 // Create a script object describing the script to be compiled. 286 // Create a script object describing the script to be compiled.
288 Handle<Script> script = Factory::NewScript(source); 287 Handle<Script> script = Factory::NewScript(source);
289 if (natives == NATIVES_CODE) { 288 if (natives == NATIVES_CODE) {
290 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); 289 script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
291 } 290 }
292 if (!script_name.is_null()) { 291 if (!script_name.is_null()) {
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 *code, 549 *code,
551 *name)); 550 *name));
552 OPROFILE(CreateNativeCodeRegion(*name, 551 OPROFILE(CreateNativeCodeRegion(*name,
553 code->instruction_start(), 552 code->instruction_start(),
554 code->instruction_size())); 553 code->instruction_size()));
555 } 554 }
556 } 555 }
557 } 556 }
558 557
559 } } // namespace v8::internal 558 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698