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 5293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5304 *source = data; | 5304 *source = data; |
5305 return result; | 5305 return result; |
5306 } | 5306 } |
5307 | 5307 |
5308 | 5308 |
5309 // Create a Scanner for the preparser to use as input, and preparse the source. | 5309 // Create a Scanner for the preparser to use as input, and preparse the source. |
5310 static ScriptDataImpl* DoPreParse(UC16CharacterStream* source, | 5310 static ScriptDataImpl* DoPreParse(UC16CharacterStream* source, |
5311 int flags, | 5311 int flags, |
5312 ParserRecorder* recorder) { | 5312 ParserRecorder* recorder) { |
5313 Isolate* isolate = Isolate::Current(); | 5313 Isolate* isolate = Isolate::Current(); |
5314 JavaScriptScanner scanner(isolate->unicode_cache()); | 5314 Scanner scanner(isolate->unicode_cache()); |
5315 scanner.SetHarmonyScoping((flags & kHarmonyScoping) != 0); | 5315 scanner.SetHarmonyScoping((flags & kHarmonyScoping) != 0); |
5316 scanner.Initialize(source); | 5316 scanner.Initialize(source); |
5317 intptr_t stack_limit = isolate->stack_guard()->real_climit(); | 5317 intptr_t stack_limit = isolate->stack_guard()->real_climit(); |
5318 if (!preparser::PreParser::PreParseProgram(&scanner, | 5318 if (!preparser::PreParser::PreParseProgram(&scanner, |
5319 recorder, | 5319 recorder, |
5320 flags, | 5320 flags, |
5321 stack_limit)) { | 5321 stack_limit)) { |
5322 isolate->StackOverflow(); | 5322 isolate->StackOverflow(); |
5323 return NULL; | 5323 return NULL; |
5324 } | 5324 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5419 result = parser.ParseProgram(source, | 5419 result = parser.ParseProgram(source, |
5420 info->is_global(), | 5420 info->is_global(), |
5421 info->strict_mode_flag()); | 5421 info->strict_mode_flag()); |
5422 } | 5422 } |
5423 } | 5423 } |
5424 info->SetFunction(result); | 5424 info->SetFunction(result); |
5425 return (result != NULL); | 5425 return (result != NULL); |
5426 } | 5426 } |
5427 | 5427 |
5428 } } // namespace v8::internal | 5428 } } // namespace v8::internal |
OLD | NEW |