| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 5907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5918 return NULL; | 5918 return NULL; |
| 5919 } | 5919 } |
| 5920 | 5920 |
| 5921 // Extract the accumulated data from the recorder as a single | 5921 // Extract the accumulated data from the recorder as a single |
| 5922 // contiguous vector that we are responsible for disposing. | 5922 // contiguous vector that we are responsible for disposing. |
| 5923 Vector<unsigned> store = recorder->ExtractData(); | 5923 Vector<unsigned> store = recorder->ExtractData(); |
| 5924 return new ScriptDataImpl(store); | 5924 return new ScriptDataImpl(store); |
| 5925 } | 5925 } |
| 5926 | 5926 |
| 5927 | 5927 |
| 5928 ScriptDataImpl* ParserApi::PreParse(Utf16CharacterStream* source, | 5928 ScriptDataImpl* ParserApi::PreParse(Utf16CharacterStream* source) { |
| 5929 v8::Extension* extension, | 5929 int flags = kNoParsingFlags; |
| 5930 int flags) { | 5930 if (FLAG_lazy) { |
| 5931 Handle<Script> no_script; | |
| 5932 if (FLAG_lazy && (extension == NULL)) { | |
| 5933 flags |= kAllowLazy; | 5931 flags |= kAllowLazy; |
| 5934 } | 5932 } |
| 5935 if (FLAG_harmony_generators) { | 5933 if (FLAG_harmony_generators) { |
| 5936 flags |= kAllowGenerators; | 5934 flags |= kAllowGenerators; |
| 5937 } | 5935 } |
| 5938 CompleteParserRecorder recorder; | 5936 CompleteParserRecorder recorder; |
| 5939 return DoPreParse(source, flags, &recorder); | 5937 return DoPreParse(source, flags, &recorder); |
| 5940 } | 5938 } |
| 5941 | 5939 |
| 5942 | 5940 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6002 ASSERT(info->isolate()->has_pending_exception()); | 6000 ASSERT(info->isolate()->has_pending_exception()); |
| 6003 } else { | 6001 } else { |
| 6004 result = parser.ParseProgram(); | 6002 result = parser.ParseProgram(); |
| 6005 } | 6003 } |
| 6006 } | 6004 } |
| 6007 info->SetFunction(result); | 6005 info->SetFunction(result); |
| 6008 return (result != NULL); | 6006 return (result != NULL); |
| 6009 } | 6007 } |
| 6010 | 6008 |
| 6011 } } // namespace v8::internal | 6009 } } // namespace v8::internal |
| OLD | NEW |