Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Unified Diff: src/lithium.cc

Issue 10700115: Break Crankshaft into phases. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix whitespace damage. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/lithium.h ('k') | src/lithium-allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium.cc
diff --git a/src/lithium.cc b/src/lithium.cc
index c317cf4a932e0456567681be97a2cfe1a1dcebc9..4e429d9e5043995077e4dcdcf52381f97af1e2a9 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,50 @@ Representation LChunkBase::LookupLiteralRepresentation(
}
+LChunkBase* 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);
+ LChunkBase* 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() {
+ MacroAssembler assembler(info()->isolate(), NULL, 0);
+ LCodeGen generator(this, &assembler, info());
+
+ 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
« no previous file with comments | « src/lithium.h ('k') | src/lithium-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698