| 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/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
| 8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
| 9 #include "src/lithium-inl.h" | 9 #include "src/lithium-inl.h" |
| 10 | 10 |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 HBasicBlock* next = NULL; | 416 HBasicBlock* next = NULL; |
| 417 if (i < blocks->length() - 1) next = blocks->at(i + 1); | 417 if (i < blocks->length() - 1) next = blocks->at(i + 1); |
| 418 DoBasicBlock(blocks->at(i), next); | 418 DoBasicBlock(blocks->at(i), next); |
| 419 if (is_aborted()) return NULL; | 419 if (is_aborted()) return NULL; |
| 420 } | 420 } |
| 421 status_ = DONE; | 421 status_ = DONE; |
| 422 return chunk_; | 422 return chunk_; |
| 423 } | 423 } |
| 424 | 424 |
| 425 | 425 |
| 426 void LChunkBuilder::Abort(BailoutReason reason) { | |
| 427 info()->set_bailout_reason(reason); | |
| 428 status_ = ABORTED; | |
| 429 } | |
| 430 | |
| 431 | |
| 432 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) { | 426 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) { |
| 433 return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER, | 427 return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER, |
| 434 Register::ToAllocationIndex(reg)); | 428 Register::ToAllocationIndex(reg)); |
| 435 } | 429 } |
| 436 | 430 |
| 437 | 431 |
| 438 LUnallocated* LChunkBuilder::ToUnallocated(DoubleRegister reg) { | 432 LUnallocated* LChunkBuilder::ToUnallocated(DoubleRegister reg) { |
| 439 return new(zone()) LUnallocated(LUnallocated::FIXED_DOUBLE_REGISTER, | 433 return new(zone()) LUnallocated(LUnallocated::FIXED_DOUBLE_REGISTER, |
| 440 DoubleRegister::ToAllocationIndex(reg)); | 434 DoubleRegister::ToAllocationIndex(reg)); |
| 441 } | 435 } |
| (...skipping 2027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2469 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2463 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
| 2470 // Use an index that corresponds to the location in the unoptimized frame, | 2464 // Use an index that corresponds to the location in the unoptimized frame, |
| 2471 // which the optimized frame will subsume. | 2465 // which the optimized frame will subsume. |
| 2472 int env_index = instr->index(); | 2466 int env_index = instr->index(); |
| 2473 int spill_index = 0; | 2467 int spill_index = 0; |
| 2474 if (instr->environment()->is_parameter_index(env_index)) { | 2468 if (instr->environment()->is_parameter_index(env_index)) { |
| 2475 spill_index = chunk()->GetParameterStackSlot(env_index); | 2469 spill_index = chunk()->GetParameterStackSlot(env_index); |
| 2476 } else { | 2470 } else { |
| 2477 spill_index = env_index - instr->environment()->first_local_index(); | 2471 spill_index = env_index - instr->environment()->first_local_index(); |
| 2478 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { | 2472 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { |
| 2479 Abort(kTooManySpillSlotsNeededForOSR); | 2473 Retry(kTooManySpillSlotsNeededForOSR); |
| 2480 spill_index = 0; | 2474 spill_index = 0; |
| 2481 } | 2475 } |
| 2482 } | 2476 } |
| 2483 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); | 2477 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); |
| 2484 } | 2478 } |
| 2485 | 2479 |
| 2486 | 2480 |
| 2487 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { | 2481 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { |
| 2488 LOperand* context = UseFixed(instr->context(), cp); | 2482 LOperand* context = UseFixed(instr->context(), cp); |
| 2489 return MarkAsCall(DefineFixed(new(zone()) LCallStub(context), r0), instr); | 2483 return MarkAsCall(DefineFixed(new(zone()) LCallStub(context), r0), instr); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2639 LInstruction* LChunkBuilder::DoAllocateBlockContext( | 2633 LInstruction* LChunkBuilder::DoAllocateBlockContext( |
| 2640 HAllocateBlockContext* instr) { | 2634 HAllocateBlockContext* instr) { |
| 2641 LOperand* context = UseFixed(instr->context(), cp); | 2635 LOperand* context = UseFixed(instr->context(), cp); |
| 2642 LOperand* function = UseRegisterAtStart(instr->function()); | 2636 LOperand* function = UseRegisterAtStart(instr->function()); |
| 2643 LAllocateBlockContext* result = | 2637 LAllocateBlockContext* result = |
| 2644 new(zone()) LAllocateBlockContext(context, function); | 2638 new(zone()) LAllocateBlockContext(context, function); |
| 2645 return MarkAsCall(DefineFixed(result, cp), instr); | 2639 return MarkAsCall(DefineFixed(result, cp), instr); |
| 2646 } | 2640 } |
| 2647 | 2641 |
| 2648 } } // namespace v8::internal | 2642 } } // namespace v8::internal |
| OLD | NEW |