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); | |
127 v8::V8::InitializeICU(); | 126 v8::V8::InitializeICU(); |
128 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 127 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
129 v8::V8::InitializePlatform(platform); | 128 v8::V8::InitializePlatform(platform); |
130 v8::V8::Initialize(); | 129 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); |
131 Encoding encoding = LATIN1; | 130 Encoding encoding = LATIN1; |
132 std::vector<std::string> fnames; | 131 std::vector<std::string> fnames; |
133 std::string benchmark; | 132 std::string benchmark; |
134 int repeat = 1; | 133 int repeat = 1; |
135 for (int i = 0; i < argc; ++i) { | 134 for (int i = 0; i < argc; ++i) { |
136 if (strcmp(argv[i], "--latin1") == 0) { | 135 if (strcmp(argv[i], "--latin1") == 0) { |
137 encoding = LATIN1; | 136 encoding = LATIN1; |
138 } else if (strcmp(argv[i], "--utf8") == 0) { | 137 } else if (strcmp(argv[i], "--utf8") == 0) { |
139 encoding = UTF8; | 138 encoding = UTF8; |
140 } else if (strcmp(argv[i], "--utf16") == 0) { | 139 } else if (strcmp(argv[i], "--utf16") == 0) { |
(...skipping 30 matching lines...) Expand all Loading... |
171 first_parse_total); | 170 first_parse_total); |
172 printf("%s(SecondParseRunTime): %.f ms\n", benchmark.c_str(), | 171 printf("%s(SecondParseRunTime): %.f ms\n", benchmark.c_str(), |
173 second_parse_total); | 172 second_parse_total); |
174 } | 173 } |
175 } | 174 } |
176 v8::V8::Dispose(); | 175 v8::V8::Dispose(); |
177 v8::V8::ShutdownPlatform(); | 176 v8::V8::ShutdownPlatform(); |
178 delete platform; | 177 delete platform; |
179 return 0; | 178 return 0; |
180 } | 179 } |
OLD | NEW |