OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |