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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } else if (i > 0 && argv[i][0] != '-') { | 206 } else if (i > 0 && argv[i][0] != '-') { |
207 fnames.push_back(std::string(argv[i])); | 207 fnames.push_back(std::string(argv[i])); |
208 } | 208 } |
209 } | 209 } |
210 v8::Isolate* isolate = v8::Isolate::New(); | 210 v8::Isolate* isolate = v8::Isolate::New(); |
211 { | 211 { |
212 v8::Isolate::Scope isolate_scope(isolate); | 212 v8::Isolate::Scope isolate_scope(isolate); |
213 v8::HandleScope handle_scope(isolate); | 213 v8::HandleScope handle_scope(isolate); |
214 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate); | 214 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate); |
215 v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global); | 215 v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global); |
216 ASSERT(!context.IsEmpty()); | 216 DCHECK(!context.IsEmpty()); |
217 { | 217 { |
218 v8::Context::Scope scope(context); | 218 v8::Context::Scope scope(context); |
219 double baseline_total = 0; | 219 double baseline_total = 0; |
220 for (size_t i = 0; i < fnames.size(); i++) { | 220 for (size_t i = 0; i < fnames.size(); i++) { |
221 v8::base::TimeDelta time; | 221 v8::base::TimeDelta time; |
222 time = ProcessFile(fnames[i].c_str(), encoding, | 222 time = ProcessFile(fnames[i].c_str(), encoding, |
223 reinterpret_cast<Isolate*>(isolate), print_tokens, | 223 reinterpret_cast<Isolate*>(isolate), print_tokens, |
224 repeat); | 224 repeat); |
225 baseline_total += time.InMillisecondsF(); | 225 baseline_total += time.InMillisecondsF(); |
226 } | 226 } |
227 if (benchmark.empty()) benchmark = "Baseline"; | 227 if (benchmark.empty()) benchmark = "Baseline"; |
228 printf("%s(RunTime): %.f ms\n", benchmark.c_str(), baseline_total); | 228 printf("%s(RunTime): %.f ms\n", benchmark.c_str(), baseline_total); |
229 } | 229 } |
230 } | 230 } |
231 v8::V8::Dispose(); | 231 v8::V8::Dispose(); |
232 v8::V8::ShutdownPlatform(); | 232 v8::V8::ShutdownPlatform(); |
233 delete platform; | 233 delete platform; |
234 return 0; | 234 return 0; |
235 } | 235 } |
OLD | NEW |