 Chromium Code Reviews
 Chromium Code Reviews Issue 10700115:
  Break Crankshaft into phases.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 10700115:
  Break Crankshaft into phases.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| Index: src/compiler.cc | 
| diff --git a/src/compiler.cc b/src/compiler.cc | 
| index 6340773eab6fe4cee7da8eed08de2d5d77a77d07..87a17602e26ab51227a8629e8d2c2903e2df3dca 100644 | 
| --- a/src/compiler.cc | 
| +++ b/src/compiler.cc | 
| @@ -47,6 +47,18 @@ | 
| #include "scopes.h" | 
| #include "vm-state-inl.h" | 
| +#if V8_TARGET_ARCH_IA32 | 
| +#include "ia32/lithium-ia32.h" | 
| 
danno
2012/07/12 11:14:54
Why do you need these? At this point, all of the c
 
sanjoy
2012/07/12 11:34:18
The register allocator needed an LChunk to operate
 | 
| +#elif V8_TARGET_ARCH_X64 | 
| +#include "x64/lithium-x64.h" | 
| +#elif V8_TARGET_ARCH_ARM | 
| +#include "arm/lithium-arm.h" | 
| +#elif V8_TARGET_ARCH_MIPS | 
| +#include "mips/lithium-mips.h" | 
| +#else | 
| +#error "Unknown architecture." | 
| +#endif | 
| + | 
| namespace v8 { | 
| namespace internal { | 
| @@ -308,11 +320,19 @@ static bool MakeCrankshaftCode(CompilationInfo* info) { | 
| } | 
| if (graph != NULL) { | 
| - Handle<Code> optimized_code = graph->Compile(); | 
| - if (!optimized_code.is_null()) { | 
| - info->SetCode(optimized_code); | 
| - FinishOptimization(info->closure(), start); | 
| - return true; | 
| + SmartArrayPointer<char> bailout_reason; | 
| + if (!graph->Optimize(&bailout_reason)) { | 
| + if (!bailout_reason.is_empty()) builder.Bailout(*bailout_reason); | 
| + } else { | 
| + LChunk* chunk = LChunkBase::NewChunk(graph); | 
| + if (chunk != NULL) { | 
| + Handle<Code> optimized_code = chunk->Codegen(); | 
| + if (!optimized_code.is_null()) { | 
| + info->SetCode(optimized_code); | 
| + FinishOptimization(info->closure(), start); | 
| + return true; | 
| + } | 
| + } | 
| } | 
| } |