| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 if (!success) { | 116 if (!success) { |
| 117 fprintf(stderr, "Parsing failed\n"); | 117 fprintf(stderr, "Parsing failed\n"); |
| 118 return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta()); | 118 return std::make_pair(v8::base::TimeDelta(), v8::base::TimeDelta()); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 return std::make_pair(parse_time1, parse_time2); | 121 return std::make_pair(parse_time1, parse_time2); |
| 122 } | 122 } |
| 123 | 123 |
| 124 | 124 |
| 125 int main(int argc, char* argv[]) { | 125 int main(int argc, char* argv[]) { |
| 126 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); |
| 126 v8::V8::InitializeICU(); | 127 v8::V8::InitializeICU(); |
| 127 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 128 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
| 128 v8::V8::InitializePlatform(platform); | 129 v8::V8::InitializePlatform(platform); |
| 129 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); | 130 v8::V8::Initialize(); |
| 130 Encoding encoding = LATIN1; | 131 Encoding encoding = LATIN1; |
| 131 std::vector<std::string> fnames; | 132 std::vector<std::string> fnames; |
| 132 std::string benchmark; | 133 std::string benchmark; |
| 133 int repeat = 1; | 134 int repeat = 1; |
| 134 for (int i = 0; i < argc; ++i) { | 135 for (int i = 0; i < argc; ++i) { |
| 135 if (strcmp(argv[i], "--latin1") == 0) { | 136 if (strcmp(argv[i], "--latin1") == 0) { |
| 136 encoding = LATIN1; | 137 encoding = LATIN1; |
| 137 } else if (strcmp(argv[i], "--utf8") == 0) { | 138 } else if (strcmp(argv[i], "--utf8") == 0) { |
| 138 encoding = UTF8; | 139 encoding = UTF8; |
| 139 } else if (strcmp(argv[i], "--utf16") == 0) { | 140 } else if (strcmp(argv[i], "--utf16") == 0) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 170 first_parse_total); | 171 first_parse_total); |
| 171 printf("%s(SecondParseRunTime): %.f ms\n", benchmark.c_str(), | 172 printf("%s(SecondParseRunTime): %.f ms\n", benchmark.c_str(), |
| 172 second_parse_total); | 173 second_parse_total); |
| 173 } | 174 } |
| 174 } | 175 } |
| 175 v8::V8::Dispose(); | 176 v8::V8::Dispose(); |
| 176 v8::V8::ShutdownPlatform(); | 177 v8::V8::ShutdownPlatform(); |
| 177 delete platform; | 178 delete platform; |
| 178 return 0; | 179 return 0; |
| 179 } | 180 } |
| OLD | NEW |