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