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 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 #ifdef V8_SHARED | 1433 #ifdef V8_SHARED |
1434 printf("D8 with shared library does not support constant dumping\n"); | 1434 printf("D8 with shared library does not support constant dumping\n"); |
1435 return false; | 1435 return false; |
1436 #else | 1436 #else |
1437 options.dump_heap_constants = true; | 1437 options.dump_heap_constants = true; |
1438 argv[i] = NULL; | 1438 argv[i] = NULL; |
1439 #endif | 1439 #endif |
1440 } else if (strcmp(argv[i], "--throws") == 0) { | 1440 } else if (strcmp(argv[i], "--throws") == 0) { |
1441 options.expected_to_throw = true; | 1441 options.expected_to_throw = true; |
1442 argv[i] = NULL; | 1442 argv[i] = NULL; |
| 1443 } else if (strncmp(argv[i], "--icu-data-file=", 16) == 0) { |
| 1444 options.icu_data_file = argv[i] + 16; |
| 1445 argv[i] = NULL; |
1443 } | 1446 } |
1444 #ifdef V8_SHARED | 1447 #ifdef V8_SHARED |
1445 else if (strcmp(argv[i], "--dump-counters") == 0) { | 1448 else if (strcmp(argv[i], "--dump-counters") == 0) { |
1446 printf("D8 with shared library does not include counters\n"); | 1449 printf("D8 with shared library does not include counters\n"); |
1447 return false; | 1450 return false; |
1448 } else if (strcmp(argv[i], "--debugger") == 0) { | 1451 } else if (strcmp(argv[i], "--debugger") == 0) { |
1449 printf("Javascript debugger not included\n"); | 1452 printf("Javascript debugger not included\n"); |
1450 return false; | 1453 return false; |
1451 } | 1454 } |
1452 #endif // V8_SHARED | 1455 #endif // V8_SHARED |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1667 virtual void* AllocateUninitialized(size_t length) V8_OVERRIDE { | 1670 virtual void* AllocateUninitialized(size_t length) V8_OVERRIDE { |
1668 return malloc(0); | 1671 return malloc(0); |
1669 } | 1672 } |
1670 virtual void Free(void*, size_t) V8_OVERRIDE { | 1673 virtual void Free(void*, size_t) V8_OVERRIDE { |
1671 } | 1674 } |
1672 }; | 1675 }; |
1673 | 1676 |
1674 | 1677 |
1675 int Shell::Main(int argc, char* argv[]) { | 1678 int Shell::Main(int argc, char* argv[]) { |
1676 if (!SetOptions(argc, argv)) return 1; | 1679 if (!SetOptions(argc, argv)) return 1; |
1677 v8::V8::InitializeICU(); | 1680 v8::V8::InitializeICU(options.icu_data_file); |
1678 #ifndef V8_SHARED | 1681 #ifndef V8_SHARED |
1679 i::FLAG_trace_hydrogen_file = "hydrogen.cfg"; | 1682 i::FLAG_trace_hydrogen_file = "hydrogen.cfg"; |
1680 i::FLAG_redirect_code_traces_to = "code.asm"; | 1683 i::FLAG_redirect_code_traces_to = "code.asm"; |
1681 #else | 1684 #else |
1682 SetStandaloneFlagsViaCommandLine(); | 1685 SetStandaloneFlagsViaCommandLine(); |
1683 #endif | 1686 #endif |
1684 ShellArrayBufferAllocator array_buffer_allocator; | 1687 ShellArrayBufferAllocator array_buffer_allocator; |
1685 MockArrayBufferAllocator mock_arraybuffer_allocator; | 1688 MockArrayBufferAllocator mock_arraybuffer_allocator; |
1686 if (options.mock_arraybuffer_allocator) { | 1689 if (options.mock_arraybuffer_allocator) { |
1687 v8::V8::SetArrayBufferAllocator(&mock_arraybuffer_allocator); | 1690 v8::V8::SetArrayBufferAllocator(&mock_arraybuffer_allocator); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1769 } | 1772 } |
1770 | 1773 |
1771 } // namespace v8 | 1774 } // namespace v8 |
1772 | 1775 |
1773 | 1776 |
1774 #ifndef GOOGLE3 | 1777 #ifndef GOOGLE3 |
1775 int main(int argc, char* argv[]) { | 1778 int main(int argc, char* argv[]) { |
1776 return v8::Shell::Main(argc, argv); | 1779 return v8::Shell::Main(argc, argv); |
1777 } | 1780 } |
1778 #endif | 1781 #endif |
OLD | NEW |