OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 // saving if we might skip building the AST for lazily compiled functions. | 475 // saving if we might skip building the AST for lazily compiled functions. |
476 // I.e., preparse data isn't relevant when the lazy flag is off, and | 476 // I.e., preparse data isn't relevant when the lazy flag is off, and |
477 // for small sources, odds are that there aren't many functions | 477 // for small sources, odds are that there aren't many functions |
478 // that would be compiled lazily anyway, so we skip the preparse step | 478 // that would be compiled lazily anyway, so we skip the preparse step |
479 // in that case too. | 479 // in that case too. |
480 ScriptDataImpl* pre_data = input_pre_data; | 480 ScriptDataImpl* pre_data = input_pre_data; |
481 int flags = kNoParsingFlags; | 481 int flags = kNoParsingFlags; |
482 if ((natives == NATIVES_CODE) || FLAG_allow_natives_syntax) { | 482 if ((natives == NATIVES_CODE) || FLAG_allow_natives_syntax) { |
483 flags |= kAllowNativesSyntax; | 483 flags |= kAllowNativesSyntax; |
484 } | 484 } |
485 if (natives != NATIVES_CODE && FLAG_harmony_scoping) { | |
486 flags |= kHarmonyScoping; | |
487 } | |
488 if (pre_data == NULL | 485 if (pre_data == NULL |
489 && source_length >= FLAG_min_preparse_length) { | 486 && source_length >= FLAG_min_preparse_length) { |
490 if (source->IsExternalTwoByteString()) { | 487 if (source->IsExternalTwoByteString()) { |
491 ExternalTwoByteStringUC16CharacterStream stream( | 488 ExternalTwoByteStringUC16CharacterStream stream( |
492 Handle<ExternalTwoByteString>::cast(source), 0, source->length()); | 489 Handle<ExternalTwoByteString>::cast(source), 0, source->length()); |
493 pre_data = ParserApi::PartialPreParse(&stream, extension, flags); | 490 pre_data = ParserApi::PartialPreParse(&stream, extension, flags); |
494 } else { | 491 } else { |
495 GenericStringUC16CharacterStream stream(source, 0, source->length()); | 492 GenericStringUC16CharacterStream stream(source, 0, source->length()); |
496 pre_data = ParserApi::PartialPreParse(&stream, extension, flags); | 493 pre_data = ParserApi::PartialPreParse(&stream, extension, flags); |
497 } | 494 } |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 } | 785 } |
789 } | 786 } |
790 | 787 |
791 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 788 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
792 Handle<Script>(info->script()), | 789 Handle<Script>(info->script()), |
793 Handle<Code>(info->code()), | 790 Handle<Code>(info->code()), |
794 info)); | 791 info)); |
795 } | 792 } |
796 | 793 |
797 } } // namespace v8::internal | 794 } } // namespace v8::internal |
OLD | NEW |