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

Side by Side Diff: src/compiler/pipeline.cc

Issue 596783002: Refactor bailout reasons and disable optimization in more cases. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: remove bogus assertion Created 6 years, 3 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/compiler.cc ('k') | src/hydrogen.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/pipeline.h" 5 #include "src/compiler/pipeline.h"
6 6
7 #include "src/base/platform/elapsed-timer.h" 7 #include "src/base/platform/elapsed-timer.h"
8 #include "src/compiler/ast-graph-builder.h" 8 #include "src/compiler/ast-graph-builder.h"
9 #include "src/compiler/change-lowering.h" 9 #include "src/compiler/change-lowering.h"
10 #include "src/compiler/code-generator.h" 10 #include "src/compiler/code-generator.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 if (FLAG_trace_turbo) { 379 if (FLAG_trace_turbo) {
380 OFStream os(stdout); 380 OFStream os(stdout);
381 os << "----- Instruction sequence before register allocation -----\n" 381 os << "----- Instruction sequence before register allocation -----\n"
382 << sequence; 382 << sequence;
383 } 383 }
384 384
385 // Allocate registers. 385 // Allocate registers.
386 { 386 {
387 int node_count = graph->NodeCount(); 387 int node_count = graph->NodeCount();
388 if (node_count > UnallocatedOperand::kMaxVirtualRegisters) { 388 if (node_count > UnallocatedOperand::kMaxVirtualRegisters) {
389 linkage->info()->set_bailout_reason(kNotEnoughVirtualRegistersForValues); 389 linkage->info()->AbortOptimization(kNotEnoughVirtualRegistersForValues);
390 return Handle<Code>::null(); 390 return Handle<Code>::null();
391 } 391 }
392 RegisterAllocator allocator(&sequence); 392 RegisterAllocator allocator(&sequence);
393 if (!allocator.Allocate()) { 393 if (!allocator.Allocate()) {
394 linkage->info()->set_bailout_reason(kNotEnoughVirtualRegistersRegalloc); 394 linkage->info()->AbortOptimization(kNotEnoughVirtualRegistersRegalloc);
395 return Handle<Code>::null(); 395 return Handle<Code>::null();
396 } 396 }
397 } 397 }
398 398
399 if (FLAG_trace_turbo) { 399 if (FLAG_trace_turbo) {
400 OFStream os(stdout); 400 OFStream os(stdout);
401 os << "----- Instruction sequence after register allocation -----\n" 401 os << "----- Instruction sequence after register allocation -----\n"
402 << sequence; 402 << sequence;
403 } 403 }
404 404
405 // Generate native sequence. 405 // Generate native sequence.
406 CodeGenerator generator(&sequence); 406 CodeGenerator generator(&sequence);
407 return generator.GenerateCode(); 407 return generator.GenerateCode();
408 } 408 }
409 409
410 410
411 void Pipeline::SetUp() { 411 void Pipeline::SetUp() {
412 InstructionOperand::SetUpCaches(); 412 InstructionOperand::SetUpCaches();
413 } 413 }
414 414
415 415
416 void Pipeline::TearDown() { 416 void Pipeline::TearDown() {
417 InstructionOperand::TearDownCaches(); 417 InstructionOperand::TearDownCaches();
418 } 418 }
419 419
420 } // namespace compiler 420 } // namespace compiler
421 } // namespace internal 421 } // namespace internal
422 } // namespace v8 422 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698