| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 | 680 |
| 681 void PrintMap(map<string, string>* m) { | 681 void PrintMap(map<string, string>* m) { |
| 682 for (map<string, string>::iterator i = m->begin(); i != m->end(); i++) { | 682 for (map<string, string>::iterator i = m->begin(); i != m->end(); i++) { |
| 683 pair<string, string> entry = *i; | 683 pair<string, string> entry = *i; |
| 684 printf("%s: %s\n", entry.first.c_str(), entry.second.c_str()); | 684 printf("%s: %s\n", entry.first.c_str(), entry.second.c_str()); |
| 685 } | 685 } |
| 686 } | 686 } |
| 687 | 687 |
| 688 | 688 |
| 689 int main(int argc, char* argv[]) { | 689 int main(int argc, char* argv[]) { |
| 690 v8::V8::InitializeICU(); | 690 v8::V8::InitializeICUDefaultLocation(argv[0]); |
| 691 v8::V8::InitializeExternalStartupData(argv[0]); | 691 v8::V8::InitializeExternalStartupData(argv[0]); |
| 692 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 692 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
| 693 v8::V8::InitializePlatform(platform); | 693 v8::V8::InitializePlatform(platform); |
| 694 v8::V8::Initialize(); | 694 v8::V8::Initialize(); |
| 695 map<string, string> options; | 695 map<string, string> options; |
| 696 string file; | 696 string file; |
| 697 ParseOptions(argc, argv, &options, &file); | 697 ParseOptions(argc, argv, &options, &file); |
| 698 if (file.empty()) { | 698 if (file.empty()) { |
| 699 fprintf(stderr, "No script was specified.\n"); | 699 fprintf(stderr, "No script was specified.\n"); |
| 700 return 1; | 700 return 1; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 713 JsHttpRequestProcessor processor(isolate, source); | 713 JsHttpRequestProcessor processor(isolate, source); |
| 714 map<string, string> output; | 714 map<string, string> output; |
| 715 if (!processor.Initialize(&options, &output)) { | 715 if (!processor.Initialize(&options, &output)) { |
| 716 fprintf(stderr, "Error initializing processor.\n"); | 716 fprintf(stderr, "Error initializing processor.\n"); |
| 717 return 1; | 717 return 1; |
| 718 } | 718 } |
| 719 if (!ProcessEntries(platform, &processor, kSampleSize, kSampleRequests)) | 719 if (!ProcessEntries(platform, &processor, kSampleSize, kSampleRequests)) |
| 720 return 1; | 720 return 1; |
| 721 PrintMap(&output); | 721 PrintMap(&output); |
| 722 } | 722 } |
| OLD | NEW |