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

Side by Side Diff: src/hydrogen.cc

Issue 9325019: Allow bailing out of the register allocator when running out of virtual registers. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/flag-definitions.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 start_environment_ = 618 start_environment_ =
619 new(zone()) HEnvironment(NULL, info->scope(), info->closure()); 619 new(zone()) HEnvironment(NULL, info->scope(), info->closure());
620 start_environment_->set_ast_id(AstNode::kFunctionEntryId); 620 start_environment_->set_ast_id(AstNode::kFunctionEntryId);
621 entry_block_ = CreateBasicBlock(); 621 entry_block_ = CreateBasicBlock();
622 entry_block_->SetInitialEnvironment(start_environment_); 622 entry_block_->SetInitialEnvironment(start_environment_);
623 } 623 }
624 624
625 625
626 Handle<Code> HGraph::Compile(CompilationInfo* info) { 626 Handle<Code> HGraph::Compile(CompilationInfo* info) {
627 int values = GetMaximumValueID(); 627 int values = GetMaximumValueID();
628 if (values > LAllocator::max_initial_value_ids()) { 628 if (values > LUnallocated::kMaxVirtualRegisters) {
629 if (FLAG_trace_bailout) { 629 if (FLAG_trace_bailout) {
630 SmartArrayPointer<char> name( 630 PrintF("Not enough virtual registers for (values).\n");
631 info->shared_info()->DebugName()->ToCString());
632 PrintF("Function @\"%s\" is too big.\n", *name);
633 } 631 }
634 return Handle<Code>::null(); 632 return Handle<Code>::null();
635 } 633 }
636
637 LAllocator allocator(values, this); 634 LAllocator allocator(values, this);
638 LChunkBuilder builder(info, this, &allocator); 635 LChunkBuilder builder(info, this, &allocator);
639 LChunk* chunk = builder.Build(); 636 LChunk* chunk = builder.Build();
640 if (chunk == NULL) return Handle<Code>::null(); 637 if (chunk == NULL) return Handle<Code>::null();
641 638
642 if (!FLAG_alloc_lithium) return Handle<Code>::null(); 639 if (!allocator.Allocate(chunk)) {
643 640 if (FLAG_trace_bailout) {
644 allocator.Allocate(chunk); 641 PrintF("Not enough virtual registers (regalloc).\n");
645 642 }
646 if (!FLAG_use_lithium) return Handle<Code>::null(); 643 return Handle<Code>::null();
644 }
647 645
648 MacroAssembler assembler(info->isolate(), NULL, 0); 646 MacroAssembler assembler(info->isolate(), NULL, 0);
649 LCodeGen generator(chunk, &assembler, info); 647 LCodeGen generator(chunk, &assembler, info);
650 648
651 if (FLAG_eliminate_empty_blocks) { 649 if (FLAG_eliminate_empty_blocks) {
652 chunk->MarkEmptyBlocks(); 650 chunk->MarkEmptyBlocks();
653 } 651 }
654 652
655 if (generator.GenerateCode()) { 653 if (generator.GenerateCode()) {
656 if (FLAG_trace_codegen) { 654 if (FLAG_trace_codegen) {
(...skipping 6798 matching lines...) Expand 10 before | Expand all | Expand 10 after
7455 } 7453 }
7456 } 7454 }
7457 7455
7458 #ifdef DEBUG 7456 #ifdef DEBUG
7459 if (graph_ != NULL) graph_->Verify(false); // No full verify. 7457 if (graph_ != NULL) graph_->Verify(false); // No full verify.
7460 if (allocator_ != NULL) allocator_->Verify(); 7458 if (allocator_ != NULL) allocator_->Verify();
7461 #endif 7459 #endif
7462 } 7460 }
7463 7461
7464 } } // namespace v8::internal 7462 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698