OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/bailout-reason.h" | |
Jakob Kummerow
2014/09/23 16:21:00
This shouldn't be necessary as lithium.h includes
Sven Panne
2014/09/24 06:00:19
IWYU...
| |
7 #include "src/lithium.h" | 8 #include "src/lithium.h" |
8 #include "src/scopes.h" | 9 #include "src/scopes.h" |
9 #include "src/serialize.h" | 10 #include "src/serialize.h" |
10 | 11 |
11 #if V8_TARGET_ARCH_IA32 | 12 #if V8_TARGET_ARCH_IA32 |
12 #include "src/ia32/lithium-ia32.h" // NOLINT | 13 #include "src/ia32/lithium-ia32.h" // NOLINT |
13 #include "src/ia32/lithium-codegen-ia32.h" // NOLINT | 14 #include "src/ia32/lithium-codegen-ia32.h" // NOLINT |
14 #elif V8_TARGET_ARCH_X64 | 15 #elif V8_TARGET_ARCH_X64 |
15 #include "src/x64/lithium-x64.h" // NOLINT | 16 #include "src/x64/lithium-x64.h" // NOLINT |
16 #include "src/x64/lithium-codegen-x64.h" // NOLINT | 17 #include "src/x64/lithium-codegen-x64.h" // NOLINT |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
430 } | 431 } |
431 | 432 |
432 | 433 |
433 LChunk* LChunk::NewChunk(HGraph* graph) { | 434 LChunk* LChunk::NewChunk(HGraph* graph) { |
434 DisallowHandleAllocation no_handles; | 435 DisallowHandleAllocation no_handles; |
435 DisallowHeapAllocation no_gc; | 436 DisallowHeapAllocation no_gc; |
436 graph->DisallowAddingNewValues(); | 437 graph->DisallowAddingNewValues(); |
437 int values = graph->GetMaximumValueID(); | 438 int values = graph->GetMaximumValueID(); |
438 CompilationInfo* info = graph->info(); | 439 CompilationInfo* info = graph->info(); |
439 if (values > LUnallocated::kMaxVirtualRegisters) { | 440 if (values > LUnallocated::kMaxVirtualRegisters) { |
440 info->set_bailout_reason(kNotEnoughVirtualRegistersForValues); | 441 info->AbortOptimization(kNotEnoughVirtualRegistersForValues); |
441 return NULL; | 442 return NULL; |
442 } | 443 } |
443 LAllocator allocator(values, graph); | 444 LAllocator allocator(values, graph); |
444 LChunkBuilder builder(info, graph, &allocator); | 445 LChunkBuilder builder(info, graph, &allocator); |
445 LChunk* chunk = builder.Build(); | 446 LChunk* chunk = builder.Build(); |
446 if (chunk == NULL) return NULL; | 447 if (chunk == NULL) return NULL; |
447 | 448 |
448 if (!allocator.Allocate(chunk)) { | 449 if (!allocator.Allocate(chunk)) { |
449 info->set_bailout_reason(kNotEnoughVirtualRegistersRegalloc); | 450 info->AbortOptimization(kNotEnoughVirtualRegistersRegalloc); |
450 return NULL; | 451 return NULL; |
451 } | 452 } |
452 | 453 |
453 chunk->set_allocated_double_registers( | 454 chunk->set_allocated_double_registers( |
454 allocator.assigned_double_registers()); | 455 allocator.assigned_double_registers()); |
455 | 456 |
456 return chunk; | 457 return chunk; |
457 } | 458 } |
458 | 459 |
459 | 460 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
503 spill_slot_count_ += 2; | 504 spill_slot_count_ += 2; |
504 } else { | 505 } else { |
505 spill_slot_count_++; | 506 spill_slot_count_++; |
506 } | 507 } |
507 } | 508 } |
508 iterator.Advance(); | 509 iterator.Advance(); |
509 } | 510 } |
510 } | 511 } |
511 | 512 |
512 | 513 |
514 void LChunkBuilderBase::Abort(BailoutReason reason) { | |
515 info()->AbortOptimization(reason); | |
516 status_ = ABORTED; | |
517 } | |
518 | |
519 | |
520 void LChunkBuilderBase::Retry(BailoutReason reason) { | |
521 info()->RetryOptimization(reason); | |
522 status_ = ABORTED; | |
523 } | |
524 | |
525 | |
513 LEnvironment* LChunkBuilderBase::CreateEnvironment( | 526 LEnvironment* LChunkBuilderBase::CreateEnvironment( |
514 HEnvironment* hydrogen_env, int* argument_index_accumulator, | 527 HEnvironment* hydrogen_env, int* argument_index_accumulator, |
515 ZoneList<HValue*>* objects_to_materialize) { | 528 ZoneList<HValue*>* objects_to_materialize) { |
516 if (hydrogen_env == NULL) return NULL; | 529 if (hydrogen_env == NULL) return NULL; |
517 | 530 |
518 LEnvironment* outer = | 531 LEnvironment* outer = |
519 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator, | 532 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator, |
520 objects_to_materialize); | 533 objects_to_materialize); |
521 BailoutId ast_id = hydrogen_env->ast_id(); | 534 BailoutId ast_id = hydrogen_env->ast_id(); |
522 DCHECK(!ast_id.IsNone() || | 535 DCHECK(!ast_id.IsNone() || |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
649 | 662 |
650 | 663 |
651 LPhase::~LPhase() { | 664 LPhase::~LPhase() { |
652 if (ShouldProduceTraceOutput()) { | 665 if (ShouldProduceTraceOutput()) { |
653 isolate()->GetHTracer()->TraceLithium(name(), chunk_); | 666 isolate()->GetHTracer()->TraceLithium(name(), chunk_); |
654 } | 667 } |
655 } | 668 } |
656 | 669 |
657 | 670 |
658 } } // namespace v8::internal | 671 } } // namespace v8::internal |
OLD | NEW |