| 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 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
| 10 #include "src/lithium-inl.h" | 10 #include "src/lithium-inl.h" |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 HBasicBlock* next = NULL; | 465 HBasicBlock* next = NULL; |
| 466 if (i < blocks->length() - 1) next = blocks->at(i + 1); | 466 if (i < blocks->length() - 1) next = blocks->at(i + 1); |
| 467 DoBasicBlock(blocks->at(i), next); | 467 DoBasicBlock(blocks->at(i), next); |
| 468 if (is_aborted()) return NULL; | 468 if (is_aborted()) return NULL; |
| 469 } | 469 } |
| 470 status_ = DONE; | 470 status_ = DONE; |
| 471 return chunk_; | 471 return chunk_; |
| 472 } | 472 } |
| 473 | 473 |
| 474 | 474 |
| 475 void LChunkBuilder::Abort(BailoutReason reason) { | |
| 476 info()->set_bailout_reason(reason); | |
| 477 status_ = ABORTED; | |
| 478 } | |
| 479 | |
| 480 | |
| 481 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) { | 475 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) { |
| 482 return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER, | 476 return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER, |
| 483 Register::ToAllocationIndex(reg)); | 477 Register::ToAllocationIndex(reg)); |
| 484 } | 478 } |
| 485 | 479 |
| 486 | 480 |
| 487 LUnallocated* LChunkBuilder::ToUnallocated(X87Register reg) { | 481 LUnallocated* LChunkBuilder::ToUnallocated(X87Register reg) { |
| 488 return new (zone()) LUnallocated(LUnallocated::FIXED_DOUBLE_REGISTER, | 482 return new (zone()) LUnallocated(LUnallocated::FIXED_DOUBLE_REGISTER, |
| 489 X87Register::ToAllocationIndex(reg)); | 483 X87Register::ToAllocationIndex(reg)); |
| 490 } | 484 } |
| (...skipping 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2527 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2521 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
| 2528 // Use an index that corresponds to the location in the unoptimized frame, | 2522 // Use an index that corresponds to the location in the unoptimized frame, |
| 2529 // which the optimized frame will subsume. | 2523 // which the optimized frame will subsume. |
| 2530 int env_index = instr->index(); | 2524 int env_index = instr->index(); |
| 2531 int spill_index = 0; | 2525 int spill_index = 0; |
| 2532 if (instr->environment()->is_parameter_index(env_index)) { | 2526 if (instr->environment()->is_parameter_index(env_index)) { |
| 2533 spill_index = chunk()->GetParameterStackSlot(env_index); | 2527 spill_index = chunk()->GetParameterStackSlot(env_index); |
| 2534 } else { | 2528 } else { |
| 2535 spill_index = env_index - instr->environment()->first_local_index(); | 2529 spill_index = env_index - instr->environment()->first_local_index(); |
| 2536 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { | 2530 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { |
| 2537 Abort(kNotEnoughSpillSlotsForOsr); | 2531 Retry(kNotEnoughSpillSlotsForOsr); |
| 2538 spill_index = 0; | 2532 spill_index = 0; |
| 2539 } | 2533 } |
| 2540 if (spill_index == 0) { | 2534 if (spill_index == 0) { |
| 2541 // The dynamic frame alignment state overwrites the first local. | 2535 // The dynamic frame alignment state overwrites the first local. |
| 2542 // The first local is saved at the end of the unoptimized frame. | 2536 // The first local is saved at the end of the unoptimized frame. |
| 2543 spill_index = graph()->osr()->UnoptimizedFrameSlots(); | 2537 spill_index = graph()->osr()->UnoptimizedFrameSlots(); |
| 2544 } | 2538 } |
| 2545 } | 2539 } |
| 2546 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); | 2540 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); |
| 2547 } | 2541 } |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2715 LOperand* function = UseRegisterAtStart(instr->function()); | 2709 LOperand* function = UseRegisterAtStart(instr->function()); |
| 2716 LAllocateBlockContext* result = | 2710 LAllocateBlockContext* result = |
| 2717 new(zone()) LAllocateBlockContext(context, function); | 2711 new(zone()) LAllocateBlockContext(context, function); |
| 2718 return MarkAsCall(DefineFixed(result, esi), instr); | 2712 return MarkAsCall(DefineFixed(result, esi), instr); |
| 2719 } | 2713 } |
| 2720 | 2714 |
| 2721 | 2715 |
| 2722 } } // namespace v8::internal | 2716 } } // namespace v8::internal |
| 2723 | 2717 |
| 2724 #endif // V8_TARGET_ARCH_X87 | 2718 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |