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

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

Issue 1410393004: X87: Re-reland: Remove register index/code indirection. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | src/crankshaft/x87/lithium-gap-resolver-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 #if V8_TARGET_ARCH_X87 5 #if V8_TARGET_ARCH_X87
6 6
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" 7 #include "src/crankshaft/x87/lithium-codegen-x87.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 int target_offset = masm()->pc_offset() + Deoptimizer::patch_size(); 511 int target_offset = masm()->pc_offset() + Deoptimizer::patch_size();
512 while (masm()->pc_offset() < target_offset) { 512 while (masm()->pc_offset() < target_offset) {
513 masm()->nop(); 513 masm()->nop();
514 } 514 }
515 } 515 }
516 safepoints_.Emit(masm(), GetStackSlotCount()); 516 safepoints_.Emit(masm(), GetStackSlotCount());
517 return !is_aborted(); 517 return !is_aborted();
518 } 518 }
519 519
520 520
521 Register LCodeGen::ToRegister(int index) const { 521 Register LCodeGen::ToRegister(int code) const {
522 return Register::FromAllocationIndex(index); 522 return Register::from_code(code);
523 } 523 }
524 524
525 525
526 X87Register LCodeGen::ToX87Register(int index) const { 526 X87Register LCodeGen::ToX87Register(int code) const {
527 return X87Register::FromAllocationIndex(index); 527 return X87Register::from_code(code);
528 } 528 }
529 529
530 530
531 void LCodeGen::X87LoadForUsage(X87Register reg) { 531 void LCodeGen::X87LoadForUsage(X87Register reg) {
532 DCHECK(x87_stack_.Contains(reg)); 532 DCHECK(x87_stack_.Contains(reg));
533 x87_stack_.Fxch(reg); 533 x87_stack_.Fxch(reg);
534 x87_stack_.pop(); 534 x87_stack_.pop();
535 } 535 }
536 536
537 537
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 } 693 }
694 // Mark this register as the next register to write to 694 // Mark this register as the next register to write to
695 stack_[stack_depth_] = reg; 695 stack_[stack_depth_] = reg;
696 } 696 }
697 697
698 698
699 void LCodeGen::X87Stack::CommitWrite(X87Register reg) { 699 void LCodeGen::X87Stack::CommitWrite(X87Register reg) {
700 DCHECK(is_mutable_); 700 DCHECK(is_mutable_);
701 // Assert the reg is prepared to write, but not on the virtual stack yet 701 // Assert the reg is prepared to write, but not on the virtual stack yet
702 DCHECK(!Contains(reg) && stack_[stack_depth_].is(reg) && 702 DCHECK(!Contains(reg) && stack_[stack_depth_].is(reg) &&
703 stack_depth_ < X87Register::kMaxNumAllocatableRegisters); 703 stack_depth_ < X87Register::kMaxNumAllocatableRegisters);
704 stack_depth_++; 704 stack_depth_++;
705 } 705 }
706 706
707 707
708 void LCodeGen::X87PrepareBinaryOp( 708 void LCodeGen::X87PrepareBinaryOp(
709 X87Register left, X87Register right, X87Register result) { 709 X87Register left, X87Register right, X87Register result) {
710 // You need to use DefineSameAsFirst for x87 instructions 710 // You need to use DefineSameAsFirst for x87 instructions
711 DCHECK(result.is(left)); 711 DCHECK(result.is(left));
712 x87_stack_.Fxch(right, 1); 712 x87_stack_.Fxch(right, 1);
713 x87_stack_.Fxch(left); 713 x87_stack_.Fxch(left);
(...skipping 5574 matching lines...) Expand 10 before | Expand all | Expand 10 after
6288 RecordSafepoint(Safepoint::kNoLazyDeopt); 6288 RecordSafepoint(Safepoint::kNoLazyDeopt);
6289 } 6289 }
6290 6290
6291 6291
6292 #undef __ 6292 #undef __
6293 6293
6294 } // namespace internal 6294 } // namespace internal
6295 } // namespace v8 6295 } // namespace v8
6296 6296
6297 #endif // V8_TARGET_ARCH_X87 6297 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | src/crankshaft/x87/lithium-gap-resolver-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698