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