| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 260 |
| 261 template<typename Char> | 261 template<typename Char> |
| 262 TimeDelta RunExperimentalScanner(Handle<String> source, | 262 TimeDelta RunExperimentalScanner(Handle<String> source, |
| 263 Isolate* isolate, | 263 Isolate* isolate, |
| 264 Encoding encoding, | 264 Encoding encoding, |
| 265 bool dump_tokens, | 265 bool dump_tokens, |
| 266 std::vector<TokenWithLocation>* tokens, | 266 std::vector<TokenWithLocation>* tokens, |
| 267 int repeat, | 267 int repeat, |
| 268 HarmonySettings harmony_settings) { | 268 HarmonySettings harmony_settings) { |
| 269 ElapsedTimer timer; | 269 ElapsedTimer timer; |
| 270 timer.Start(); | |
| 271 ExperimentalScanner<Char> scanner(source, isolate); | 270 ExperimentalScanner<Char> scanner(source, isolate); |
| 272 scanner.SetHarmonyNumericLiterals(harmony_settings.numeric_literals); | 271 scanner.SetHarmonyNumericLiterals(harmony_settings.numeric_literals); |
| 273 scanner.SetHarmonyModules(harmony_settings.modules); | 272 scanner.SetHarmonyModules(harmony_settings.modules); |
| 274 scanner.SetHarmonyScoping(harmony_settings.scoping); | 273 scanner.SetHarmonyScoping(harmony_settings.scoping); |
| 275 | 274 |
| 275 timer.Start(); |
| 276 scanner.Init(); |
| 276 Token::Value token; | 277 Token::Value token; |
| 277 do { | 278 do { |
| 278 token = scanner.Next(); | 279 token = scanner.Next(); |
| 279 if (dump_tokens) { | 280 if (dump_tokens) { |
| 280 tokens->push_back(GetTokenWithLocation(&scanner, token)); | 281 tokens->push_back(GetTokenWithLocation(&scanner, token)); |
| 281 } | 282 } |
| 282 } while (token != Token::EOS); | 283 } while (token != Token::EOS); |
| 283 return timer.Elapsed(); | 284 return timer.Elapsed(); |
| 284 } | 285 } |
| 285 | 286 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 if (run_experimental) { | 476 if (run_experimental) { |
| 476 if (benchmark.empty()) benchmark = "Experimental"; | 477 if (benchmark.empty()) benchmark = "Experimental"; |
| 477 printf("%s(RunTime): %.f ms\n", benchmark.c_str(), | 478 printf("%s(RunTime): %.f ms\n", benchmark.c_str(), |
| 478 experimental_total); | 479 experimental_total); |
| 479 } | 480 } |
| 480 } | 481 } |
| 481 } | 482 } |
| 482 v8::V8::Dispose(); | 483 v8::V8::Dispose(); |
| 483 return 0; | 484 return 0; |
| 484 } | 485 } |
| OLD | NEW |