| 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_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 HBasicBlock* next = NULL; | 442 HBasicBlock* next = NULL; |
| 443 if (i < blocks->length() - 1) next = blocks->at(i + 1); | 443 if (i < blocks->length() - 1) next = blocks->at(i + 1); |
| 444 DoBasicBlock(blocks->at(i), next); | 444 DoBasicBlock(blocks->at(i), next); |
| 445 if (is_aborted()) return NULL; | 445 if (is_aborted()) return NULL; |
| 446 } | 446 } |
| 447 status_ = DONE; | 447 status_ = DONE; |
| 448 return chunk_; | 448 return chunk_; |
| 449 } | 449 } |
| 450 | 450 |
| 451 | 451 |
| 452 void LChunkBuilder::Abort(BailoutReason reason) { | |
| 453 info()->set_bailout_reason(reason); | |
| 454 status_ = ABORTED; | |
| 455 } | |
| 456 | |
| 457 | |
| 458 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) { | 452 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) { |
| 459 return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER, | 453 return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER, |
| 460 Register::ToAllocationIndex(reg)); | 454 Register::ToAllocationIndex(reg)); |
| 461 } | 455 } |
| 462 | 456 |
| 463 | 457 |
| 464 LUnallocated* LChunkBuilder::ToUnallocated(XMMRegister reg) { | 458 LUnallocated* LChunkBuilder::ToUnallocated(XMMRegister reg) { |
| 465 return new(zone()) LUnallocated(LUnallocated::FIXED_DOUBLE_REGISTER, | 459 return new(zone()) LUnallocated(LUnallocated::FIXED_DOUBLE_REGISTER, |
| 466 XMMRegister::ToAllocationIndex(reg)); | 460 XMMRegister::ToAllocationIndex(reg)); |
| 467 } | 461 } |
| (...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2506 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2500 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
| 2507 // Use an index that corresponds to the location in the unoptimized frame, | 2501 // Use an index that corresponds to the location in the unoptimized frame, |
| 2508 // which the optimized frame will subsume. | 2502 // which the optimized frame will subsume. |
| 2509 int env_index = instr->index(); | 2503 int env_index = instr->index(); |
| 2510 int spill_index = 0; | 2504 int spill_index = 0; |
| 2511 if (instr->environment()->is_parameter_index(env_index)) { | 2505 if (instr->environment()->is_parameter_index(env_index)) { |
| 2512 spill_index = chunk()->GetParameterStackSlot(env_index); | 2506 spill_index = chunk()->GetParameterStackSlot(env_index); |
| 2513 } else { | 2507 } else { |
| 2514 spill_index = env_index - instr->environment()->first_local_index(); | 2508 spill_index = env_index - instr->environment()->first_local_index(); |
| 2515 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { | 2509 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { |
| 2516 Abort(kTooManySpillSlotsNeededForOSR); | 2510 Retry(kTooManySpillSlotsNeededForOSR); |
| 2517 spill_index = 0; | 2511 spill_index = 0; |
| 2518 } | 2512 } |
| 2519 } | 2513 } |
| 2520 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); | 2514 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); |
| 2521 } | 2515 } |
| 2522 | 2516 |
| 2523 | 2517 |
| 2524 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { | 2518 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { |
| 2525 LOperand* context = UseFixed(instr->context(), rsi); | 2519 LOperand* context = UseFixed(instr->context(), rsi); |
| 2526 LCallStub* result = new(zone()) LCallStub(context); | 2520 LCallStub* result = new(zone()) LCallStub(context); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2690 LOperand* function = UseRegisterAtStart(instr->function()); | 2684 LOperand* function = UseRegisterAtStart(instr->function()); |
| 2691 LAllocateBlockContext* result = | 2685 LAllocateBlockContext* result = |
| 2692 new(zone()) LAllocateBlockContext(context, function); | 2686 new(zone()) LAllocateBlockContext(context, function); |
| 2693 return MarkAsCall(DefineFixed(result, rsi), instr); | 2687 return MarkAsCall(DefineFixed(result, rsi), instr); |
| 2694 } | 2688 } |
| 2695 | 2689 |
| 2696 | 2690 |
| 2697 } } // namespace v8::internal | 2691 } } // namespace v8::internal |
| 2698 | 2692 |
| 2699 #endif // V8_TARGET_ARCH_X64 | 2693 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |