| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 &baseline_tokens, repeat); | 177 &baseline_tokens, repeat); |
| 178 if (print_tokens) { | 178 if (print_tokens) { |
| 179 PrintTokens("Baseline", baseline_tokens); | 179 PrintTokens("Baseline", baseline_tokens); |
| 180 } | 180 } |
| 181 return baseline_time; | 181 return baseline_time; |
| 182 } | 182 } |
| 183 | 183 |
| 184 | 184 |
| 185 int main(int argc, char* argv[]) { | 185 int main(int argc, char* argv[]) { |
| 186 v8::V8::InitializeICU(); | 186 v8::V8::InitializeICU(); |
| 187 v8::V8::Initialize(); |
| 187 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); | 188 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); |
| 188 Encoding encoding = LATIN1; | 189 Encoding encoding = LATIN1; |
| 189 bool print_tokens = false; | 190 bool print_tokens = false; |
| 190 std::vector<std::string> fnames; | 191 std::vector<std::string> fnames; |
| 191 std::string benchmark; | 192 std::string benchmark; |
| 192 int repeat = 1; | 193 int repeat = 1; |
| 193 for (int i = 0; i < argc; ++i) { | 194 for (int i = 0; i < argc; ++i) { |
| 194 if (strcmp(argv[i], "--latin1") == 0) { | 195 if (strcmp(argv[i], "--latin1") == 0) { |
| 195 encoding = LATIN1; | 196 encoding = LATIN1; |
| 196 } else if (strcmp(argv[i], "--utf8") == 0) { | 197 } else if (strcmp(argv[i], "--utf8") == 0) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 224 repeat); | 225 repeat); |
| 225 baseline_total += time.InMillisecondsF(); | 226 baseline_total += time.InMillisecondsF(); |
| 226 } | 227 } |
| 227 if (benchmark.empty()) benchmark = "Baseline"; | 228 if (benchmark.empty()) benchmark = "Baseline"; |
| 228 printf("%s(RunTime): %.f ms\n", benchmark.c_str(), baseline_total); | 229 printf("%s(RunTime): %.f ms\n", benchmark.c_str(), baseline_total); |
| 229 } | 230 } |
| 230 } | 231 } |
| 231 v8::V8::Dispose(); | 232 v8::V8::Dispose(); |
| 232 return 0; | 233 return 0; |
| 233 } | 234 } |
| OLD | NEW |