| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 fprintf(stderr, "Parsing failed\n"); | 100 fprintf(stderr, "Parsing failed\n"); |
| 101 return std::make_pair(TimeDelta(), TimeDelta()); | 101 return std::make_pair(TimeDelta(), TimeDelta()); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 return std::make_pair(parse_time1, parse_time2); | 104 return std::make_pair(parse_time1, parse_time2); |
| 105 } | 105 } |
| 106 | 106 |
| 107 | 107 |
| 108 int main(int argc, char* argv[]) { | 108 int main(int argc, char* argv[]) { |
| 109 v8::V8::InitializeICU(); | 109 v8::V8::InitializeICU(); |
| 110 v8::V8::Initialize(); |
| 110 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); | 111 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); |
| 111 Encoding encoding = LATIN1; | 112 Encoding encoding = LATIN1; |
| 112 std::vector<std::string> fnames; | 113 std::vector<std::string> fnames; |
| 113 std::string benchmark; | 114 std::string benchmark; |
| 114 int repeat = 1; | 115 int repeat = 1; |
| 115 for (int i = 0; i < argc; ++i) { | 116 for (int i = 0; i < argc; ++i) { |
| 116 if (strcmp(argv[i], "--latin1") == 0) { | 117 if (strcmp(argv[i], "--latin1") == 0) { |
| 117 encoding = LATIN1; | 118 encoding = LATIN1; |
| 118 } else if (strcmp(argv[i], "--utf8") == 0) { | 119 } else if (strcmp(argv[i], "--utf8") == 0) { |
| 119 encoding = UTF8; | 120 encoding = UTF8; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 147 if (benchmark.empty()) benchmark = "Baseline"; | 148 if (benchmark.empty()) benchmark = "Baseline"; |
| 148 printf("%s(FirstParseRunTime): %.f ms\n", benchmark.c_str(), | 149 printf("%s(FirstParseRunTime): %.f ms\n", benchmark.c_str(), |
| 149 first_parse_total); | 150 first_parse_total); |
| 150 printf("%s(SecondParseRunTime): %.f ms\n", benchmark.c_str(), | 151 printf("%s(SecondParseRunTime): %.f ms\n", benchmark.c_str(), |
| 151 second_parse_total); | 152 second_parse_total); |
| 152 } | 153 } |
| 153 } | 154 } |
| 154 v8::V8::Dispose(); | 155 v8::V8::Dispose(); |
| 155 return 0; | 156 return 0; |
| 156 } | 157 } |
| OLD | NEW |