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 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 Shell::counter_map_ = new CounterMap(); | 1262 Shell::counter_map_ = new CounterMap(); |
1263 // Set up counters | 1263 // Set up counters |
1264 if (i::StrLength(i::FLAG_map_counters) != 0) | 1264 if (i::StrLength(i::FLAG_map_counters) != 0) |
1265 MapCounters(i::FLAG_map_counters); | 1265 MapCounters(i::FLAG_map_counters); |
1266 if (i::FLAG_dump_counters || i::FLAG_track_gc_object_stats) { | 1266 if (i::FLAG_dump_counters || i::FLAG_track_gc_object_stats) { |
1267 V8::SetCounterFunction(LookupCounter); | 1267 V8::SetCounterFunction(LookupCounter); |
1268 V8::SetCreateHistogramFunction(CreateHistogram); | 1268 V8::SetCreateHistogramFunction(CreateHistogram); |
1269 V8::SetAddHistogramSampleFunction(AddHistogramSample); | 1269 V8::SetAddHistogramSampleFunction(AddHistogramSample); |
1270 } | 1270 } |
1271 #endif // V8_SHARED | 1271 #endif // V8_SHARED |
| 1272 } |
| 1273 |
| 1274 |
| 1275 void Shell::InitializeDebugger(Isolate* isolate) { |
1272 if (options.test_shell) return; | 1276 if (options.test_shell) return; |
1273 | |
1274 #ifndef V8_SHARED | 1277 #ifndef V8_SHARED |
1275 Locker lock; | 1278 Locker lock; |
1276 HandleScope scope; | 1279 HandleScope scope; |
1277 Handle<ObjectTemplate> global_template = CreateGlobalTemplate(isolate); | 1280 Handle<ObjectTemplate> global_template = CreateGlobalTemplate(isolate); |
1278 utility_context_ = Context::New(NULL, global_template); | 1281 utility_context_ = Context::New(NULL, global_template); |
1279 | 1282 |
1280 #ifdef ENABLE_DEBUGGER_SUPPORT | 1283 #ifdef ENABLE_DEBUGGER_SUPPORT |
1281 // Start the debugger agent if requested. | 1284 // Start the debugger agent if requested. |
1282 if (i::FLAG_debugger_agent) { | 1285 if (i::FLAG_debugger_agent) { |
1283 v8::Debug::EnableAgent("d8 shell", i::FLAG_debugger_port, true); | 1286 v8::Debug::EnableAgent("d8 shell", i::FLAG_debugger_port, true); |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 #endif // V8_SHARED | 1893 #endif // V8_SHARED |
1891 return 0; | 1894 return 0; |
1892 } | 1895 } |
1893 | 1896 |
1894 | 1897 |
1895 int Shell::Main(int argc, char* argv[]) { | 1898 int Shell::Main(int argc, char* argv[]) { |
1896 if (!SetOptions(argc, argv)) return 1; | 1899 if (!SetOptions(argc, argv)) return 1; |
1897 int result = 0; | 1900 int result = 0; |
1898 Isolate* isolate = Isolate::GetCurrent(); | 1901 Isolate* isolate = Isolate::GetCurrent(); |
1899 { | 1902 { |
| 1903 Initialize(isolate); |
1900 Symbols symbols(isolate); | 1904 Symbols symbols(isolate); |
1901 Initialize(isolate); | 1905 InitializeDebugger(isolate); |
1902 | 1906 |
1903 if (options.stress_opt || options.stress_deopt) { | 1907 if (options.stress_opt || options.stress_deopt) { |
1904 Testing::SetStressRunType(options.stress_opt | 1908 Testing::SetStressRunType(options.stress_opt |
1905 ? Testing::kStressTypeOpt | 1909 ? Testing::kStressTypeOpt |
1906 : Testing::kStressTypeDeopt); | 1910 : Testing::kStressTypeDeopt); |
1907 int stress_runs = Testing::GetStressRuns(); | 1911 int stress_runs = Testing::GetStressRuns(); |
1908 for (int i = 0; i < stress_runs && result == 0; i++) { | 1912 for (int i = 0; i < stress_runs && result == 0; i++) { |
1909 printf("============ Stress %d/%d ============\n", i + 1, stress_runs); | 1913 printf("============ Stress %d/%d ============\n", i + 1, stress_runs); |
1910 Testing::PrepareStressRun(i); | 1914 Testing::PrepareStressRun(i); |
1911 options.last_run = (i == stress_runs - 1); | 1915 options.last_run = (i == stress_runs - 1); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1959 } | 1963 } |
1960 | 1964 |
1961 } // namespace v8 | 1965 } // namespace v8 |
1962 | 1966 |
1963 | 1967 |
1964 #ifndef GOOGLE3 | 1968 #ifndef GOOGLE3 |
1965 int main(int argc, char* argv[]) { | 1969 int main(int argc, char* argv[]) { |
1966 return v8::Shell::Main(argc, argv); | 1970 return v8::Shell::Main(argc, argv); |
1967 } | 1971 } |
1968 #endif | 1972 #endif |
OLD | NEW |