Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: src/x87/lithium-x87.cc

Issue 597913002: X87: Refactor bailout reasons and disable optimization in more cases. (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/x87/lithium-x87.h ('k') | src/x87/macro-assembler-x87.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « src/x87/lithium-x87.h ('k') | src/x87/macro-assembler-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698