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

Side by Side Diff: src/parser.cc

Issue 8692001: Add histogram timer scope for preparsing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5335 matching lines...) Expand 10 before | Expand all | Expand 10 after
5346 *source = data; 5346 *source = data;
5347 return result; 5347 return result;
5348 } 5348 }
5349 5349
5350 5350
5351 // Create a Scanner for the preparser to use as input, and preparse the source. 5351 // Create a Scanner for the preparser to use as input, and preparse the source.
5352 static ScriptDataImpl* DoPreParse(UC16CharacterStream* source, 5352 static ScriptDataImpl* DoPreParse(UC16CharacterStream* source,
5353 int flags, 5353 int flags,
5354 ParserRecorder* recorder) { 5354 ParserRecorder* recorder) {
5355 Isolate* isolate = Isolate::Current(); 5355 Isolate* isolate = Isolate::Current();
5356 HistogramTimerScope timer(isolate->counters()->pre_parse());
5356 Scanner scanner(isolate->unicode_cache()); 5357 Scanner scanner(isolate->unicode_cache());
5357 scanner.SetHarmonyScoping((flags & kHarmonyScoping) != 0); 5358 scanner.SetHarmonyScoping((flags & kHarmonyScoping) != 0);
5358 scanner.Initialize(source); 5359 scanner.Initialize(source);
5359 intptr_t stack_limit = isolate->stack_guard()->real_climit(); 5360 intptr_t stack_limit = isolate->stack_guard()->real_climit();
5360 if (!preparser::PreParser::PreParseProgram(&scanner, 5361 if (!preparser::PreParser::PreParseProgram(&scanner,
5361 recorder, 5362 recorder,
5362 flags, 5363 flags,
5363 stack_limit)) { 5364 stack_limit)) {
5364 isolate->StackOverflow(); 5365 isolate->StackOverflow();
5365 return NULL; 5366 return NULL;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
5459 ASSERT(info->isolate()->has_pending_exception()); 5460 ASSERT(info->isolate()->has_pending_exception());
5460 } else { 5461 } else {
5461 result = parser.ParseProgram(info); 5462 result = parser.ParseProgram(info);
5462 } 5463 }
5463 } 5464 }
5464 info->SetFunction(result); 5465 info->SetFunction(result);
5465 return (result != NULL); 5466 return (result != NULL);
5466 } 5467 }
5467 5468
5468 } } // namespace v8::internal 5469 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698