| Index: src/lithium.cc
|
| diff --git a/src/lithium.cc b/src/lithium.cc
|
| index c317cf4a932e0456567681be97a2cfe1a1dcebc9..459f43efe929dc0f13f6820def5ff90b89f7e4f6 100644
|
| --- a/src/lithium.cc
|
| +++ b/src/lithium.cc
|
| @@ -31,12 +31,16 @@
|
|
|
| #if V8_TARGET_ARCH_IA32
|
| #include "ia32/lithium-ia32.h"
|
| +#include "ia32/lithium-codegen-ia32.h"
|
| #elif V8_TARGET_ARCH_X64
|
| #include "x64/lithium-x64.h"
|
| +#include "x64/lithium-codegen-x64.h"
|
| #elif V8_TARGET_ARCH_ARM
|
| #include "arm/lithium-arm.h"
|
| +#include "arm/lithium-codegen-arm.h"
|
| #elif V8_TARGET_ARCH_MIPS
|
| #include "mips/lithium-mips.h"
|
| +#include "mips/lithium-codegen-mips.h"
|
| #else
|
| #error "Unknown architecture."
|
| #endif
|
| @@ -386,4 +390,51 @@ Representation LChunkBase::LookupLiteralRepresentation(
|
| }
|
|
|
|
|
| +LChunk* LChunkBase::NewChunk(HGraph* graph) {
|
| + int values = graph->GetMaximumValueID();
|
| + if (values > LUnallocated::kMaxVirtualRegisters) {
|
| + if (FLAG_trace_bailout) {
|
| + PrintF("Not enough virtual registers for (values).\n");
|
| + }
|
| + return NULL;
|
| + }
|
| + LAllocator allocator(values, graph);
|
| + LChunkBuilder builder(graph->info(), graph, &allocator);
|
| + LChunk* chunk = builder.Build();
|
| + if (chunk == NULL) return NULL;
|
| +
|
| + if (!allocator.Allocate(chunk)) {
|
| + if (FLAG_trace_bailout) {
|
| + PrintF("Not enough virtual registers (regalloc).\n");
|
| + }
|
| + return NULL;
|
| + }
|
| +
|
| + return chunk;
|
| +}
|
| +
|
| +
|
| +Handle<Code> LChunkBase::Codegen(LChunk* chunk) {
|
| + CompilationInfo* info = chunk->info();
|
| + MacroAssembler assembler(info->isolate(), NULL, 0);
|
| + LCodeGen generator(chunk, &assembler, info);
|
| +
|
| + chunk->MarkEmptyBlocks();
|
| +
|
| + if (generator.GenerateCode()) {
|
| + if (FLAG_trace_codegen) {
|
| + PrintF("Crankshaft Compiler - ");
|
| + }
|
| + CodeGenerator::MakeCodePrologue(info);
|
| + Code::Flags flags = Code::ComputeFlags(Code::OPTIMIZED_FUNCTION);
|
| + Handle<Code> code =
|
| + CodeGenerator::MakeCodeEpilogue(&assembler, flags, info);
|
| + generator.FinishCode(code);
|
| + CodeGenerator::PrintCode(code, info);
|
| + return code;
|
| + }
|
| + return Handle<Code>::null();
|
| +}
|
| +
|
| +
|
| } } // namespace v8::internal
|
|
|