| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
| 8 | 8 |
| 9 #include "src/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 } | 407 } |
| 408 | 408 |
| 409 DCHECK(info()->shared_info()->has_deoptimization_support()); | 409 DCHECK(info()->shared_info()->has_deoptimization_support()); |
| 410 | 410 |
| 411 // Check the whitelist for TurboFan. | 411 // Check the whitelist for TurboFan. |
| 412 if ((FLAG_turbo_asm && info()->shared_info()->asm_function()) || | 412 if ((FLAG_turbo_asm && info()->shared_info()->asm_function()) || |
| 413 info()->closure()->PassesFilter(FLAG_turbo_filter)) { | 413 info()->closure()->PassesFilter(FLAG_turbo_filter)) { |
| 414 compiler::Pipeline pipeline(info()); | 414 compiler::Pipeline pipeline(info()); |
| 415 pipeline.GenerateCode(); | 415 pipeline.GenerateCode(); |
| 416 if (!info()->code().is_null()) { | 416 if (!info()->code().is_null()) { |
| 417 if (FLAG_turbo_deoptimization) { | |
| 418 info()->context()->native_context()->AddOptimizedCode(*info()->code()); | |
| 419 } | |
| 420 return SetLastStatus(SUCCEEDED); | 417 return SetLastStatus(SUCCEEDED); |
| 421 } | 418 } |
| 422 } | 419 } |
| 423 | 420 |
| 424 if (FLAG_trace_hydrogen) { | 421 if (FLAG_trace_hydrogen) { |
| 425 Handle<String> name = info()->function()->debug_name(); | 422 Handle<String> name = info()->function()->debug_name(); |
| 426 PrintF("-----------------------------------------------------------\n"); | 423 PrintF("-----------------------------------------------------------\n"); |
| 427 PrintF("Compiling method %s using hydrogen\n", name->ToCString().get()); | 424 PrintF("Compiling method %s using hydrogen\n", name->ToCString().get()); |
| 428 isolate()->GetHTracer()->TraceCompilation(info()); | 425 isolate()->GetHTracer()->TraceCompilation(info()); |
| 429 } | 426 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 } | 475 } |
| 479 | 476 |
| 480 return SetLastStatus(BAILED_OUT); | 477 return SetLastStatus(BAILED_OUT); |
| 481 } | 478 } |
| 482 | 479 |
| 483 | 480 |
| 484 OptimizedCompileJob::Status OptimizedCompileJob::GenerateCode() { | 481 OptimizedCompileJob::Status OptimizedCompileJob::GenerateCode() { |
| 485 DCHECK(last_status() == SUCCEEDED); | 482 DCHECK(last_status() == SUCCEEDED); |
| 486 // TODO(turbofan): Currently everything is done in the first phase. | 483 // TODO(turbofan): Currently everything is done in the first phase. |
| 487 if (!info()->code().is_null()) { | 484 if (!info()->code().is_null()) { |
| 485 if (FLAG_turbo_deoptimization) { |
| 486 info()->context()->native_context()->AddOptimizedCode(*info()->code()); |
| 487 } |
| 488 RecordOptimizationStats(); | 488 RecordOptimizationStats(); |
| 489 return last_status(); | 489 return last_status(); |
| 490 } | 490 } |
| 491 | 491 |
| 492 DCHECK(!info()->HasAbortedDueToDependencyChange()); | 492 DCHECK(!info()->HasAbortedDueToDependencyChange()); |
| 493 DisallowCodeDependencyChange no_dependency_change; | 493 DisallowCodeDependencyChange no_dependency_change; |
| 494 DisallowJavascriptExecution no_js(isolate()); | 494 DisallowJavascriptExecution no_js(isolate()); |
| 495 { // Scope for timer. | 495 { // Scope for timer. |
| 496 Timer timer(this, &time_taken_to_codegen_); | 496 Timer timer(this, &time_taken_to_codegen_); |
| 497 DCHECK(chunk_ != NULL); | 497 DCHECK(chunk_ != NULL); |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1457 AllowHandleDereference allow_deref; | 1457 AllowHandleDereference allow_deref; |
| 1458 bool tracing_on = info()->IsStub() | 1458 bool tracing_on = info()->IsStub() |
| 1459 ? FLAG_trace_hydrogen_stubs | 1459 ? FLAG_trace_hydrogen_stubs |
| 1460 : (FLAG_trace_hydrogen && | 1460 : (FLAG_trace_hydrogen && |
| 1461 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1461 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
| 1462 return (tracing_on && | 1462 return (tracing_on && |
| 1463 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1463 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
| 1464 } | 1464 } |
| 1465 | 1465 |
| 1466 } } // namespace v8::internal | 1466 } } // namespace v8::internal |
| OLD | NEW |