| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 202 |
| 203 static SourceGroup* isolate_sources = NULL; | 203 static SourceGroup* isolate_sources = NULL; |
| 204 | 204 |
| 205 | 205 |
| 206 int RunMain(int argc, char* argv[]) { | 206 int RunMain(int argc, char* argv[]) { |
| 207 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); | 207 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); |
| 208 v8::HandleScope handle_scope; | 208 v8::HandleScope handle_scope; |
| 209 v8::Persistent<v8::Context> context = CreateShellContext(); | 209 v8::Persistent<v8::Context> context = CreateShellContext(); |
| 210 // Enter the newly created execution environment. | 210 // Enter the newly created execution environment. |
| 211 context->Enter(); | 211 context->Enter(); |
| 212 if (context.IsEmpty()) { |
| 213 printf("Error creating context\n"); |
| 214 return 1; |
| 215 } |
| 216 |
| 212 bool run_shell = (argc == 1); | 217 bool run_shell = (argc == 1); |
| 213 int num_isolates = 1; | 218 int num_isolates = 1; |
| 214 for (int i = 1; i < argc; i++) { | 219 for (int i = 1; i < argc; i++) { |
| 215 if (strcmp(argv[i], "--isolate") == 0) ++num_isolates; | 220 if (strcmp(argv[i], "--isolate") == 0) ++num_isolates; |
| 216 } | 221 } |
| 217 if (isolate_sources == NULL) { | 222 if (isolate_sources == NULL) { |
| 218 isolate_sources = new SourceGroup[num_isolates]; | 223 isolate_sources = new SourceGroup[num_isolates]; |
| 219 SourceGroup* current = isolate_sources; | 224 SourceGroup* current = isolate_sources; |
| 220 current->Begin(argv, 1); | 225 current->Begin(argv, 1); |
| 221 for (int i = 1; i < argc; i++) { | 226 for (int i = 1; i < argc; i++) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 ? v8::Testing::kStressTypeOpt | 287 ? v8::Testing::kStressTypeOpt |
| 283 : v8::Testing::kStressTypeDeopt); | 288 : v8::Testing::kStressTypeDeopt); |
| 284 int stress_runs = v8::Testing::GetStressRuns(); | 289 int stress_runs = v8::Testing::GetStressRuns(); |
| 285 for (int i = 0; i < stress_runs && result == 0; i++) { | 290 for (int i = 0; i < stress_runs && result == 0; i++) { |
| 286 printf("============ Stress %d/%d ============\n", | 291 printf("============ Stress %d/%d ============\n", |
| 287 i + 1, stress_runs); | 292 i + 1, stress_runs); |
| 288 v8::Testing::PrepareStressRun(i); | 293 v8::Testing::PrepareStressRun(i); |
| 289 last_run = (i == stress_runs - 1); | 294 last_run = (i == stress_runs - 1); |
| 290 result = RunMain(argc, argv); | 295 result = RunMain(argc, argv); |
| 291 } | 296 } |
| 297 printf("======== Full Deoptimization =======\n"); |
| 298 v8::Testing::DeoptimizeAll(); |
| 292 } else { | 299 } else { |
| 293 result = RunMain(argc, argv); | 300 result = RunMain(argc, argv); |
| 294 } | 301 } |
| 295 v8::V8::Dispose(); | 302 v8::V8::Dispose(); |
| 296 return result; | 303 return result; |
| 297 } | 304 } |
| 298 | 305 |
| 299 | 306 |
| 300 // Extracts a C string from a V8 Utf8Value. | 307 // Extracts a C string from a V8 Utf8Value. |
| 301 const char* ToCString(const v8::String::Utf8Value& value) { | 308 const char* ToCString(const v8::String::Utf8Value& value) { |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 printf("^"); | 516 printf("^"); |
| 510 } | 517 } |
| 511 printf("\n"); | 518 printf("\n"); |
| 512 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); | 519 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); |
| 513 if (stack_trace.length() > 0) { | 520 if (stack_trace.length() > 0) { |
| 514 const char* stack_trace_string = ToCString(stack_trace); | 521 const char* stack_trace_string = ToCString(stack_trace); |
| 515 printf("%s\n", stack_trace_string); | 522 printf("%s\n", stack_trace_string); |
| 516 } | 523 } |
| 517 } | 524 } |
| 518 } | 525 } |
| OLD | NEW |