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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 1365073002: Revert of Remove register index/code indirection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/ia32/deoptimizer-ia32.cc ('k') | src/ia32/lithium-gap-resolver-ia32.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_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 void LCodeGen::SaveCallerDoubles() { 95 void LCodeGen::SaveCallerDoubles() {
96 DCHECK(info()->saves_caller_doubles()); 96 DCHECK(info()->saves_caller_doubles());
97 DCHECK(NeedsEagerFrame()); 97 DCHECK(NeedsEagerFrame());
98 Comment(";;; Save clobbered callee double registers"); 98 Comment(";;; Save clobbered callee double registers");
99 int count = 0; 99 int count = 0;
100 BitVector* doubles = chunk()->allocated_double_registers(); 100 BitVector* doubles = chunk()->allocated_double_registers();
101 BitVector::Iterator save_iterator(doubles); 101 BitVector::Iterator save_iterator(doubles);
102 while (!save_iterator.Done()) { 102 while (!save_iterator.Done()) {
103 __ movsd(MemOperand(esp, count * kDoubleSize), 103 __ movsd(MemOperand(esp, count * kDoubleSize),
104 XMMRegister::from_code(save_iterator.Current())); 104 XMMRegister::FromAllocationIndex(save_iterator.Current()));
105 save_iterator.Advance(); 105 save_iterator.Advance();
106 count++; 106 count++;
107 } 107 }
108 } 108 }
109 109
110 110
111 void LCodeGen::RestoreCallerDoubles() { 111 void LCodeGen::RestoreCallerDoubles() {
112 DCHECK(info()->saves_caller_doubles()); 112 DCHECK(info()->saves_caller_doubles());
113 DCHECK(NeedsEagerFrame()); 113 DCHECK(NeedsEagerFrame());
114 Comment(";;; Restore clobbered callee double registers"); 114 Comment(";;; Restore clobbered callee double registers");
115 BitVector* doubles = chunk()->allocated_double_registers(); 115 BitVector* doubles = chunk()->allocated_double_registers();
116 BitVector::Iterator save_iterator(doubles); 116 BitVector::Iterator save_iterator(doubles);
117 int count = 0; 117 int count = 0;
118 while (!save_iterator.Done()) { 118 while (!save_iterator.Done()) {
119 __ movsd(XMMRegister::from_code(save_iterator.Current()), 119 __ movsd(XMMRegister::FromAllocationIndex(save_iterator.Current()),
120 MemOperand(esp, count * kDoubleSize)); 120 MemOperand(esp, count * kDoubleSize));
121 save_iterator.Advance(); 121 save_iterator.Advance();
122 count++; 122 count++;
123 } 123 }
124 } 124 }
125 125
126 126
127 bool LCodeGen::GeneratePrologue() { 127 bool LCodeGen::GeneratePrologue() {
128 DCHECK(is_generating()); 128 DCHECK(is_generating());
129 129
130 if (info()->IsOptimizing()) { 130 if (info()->IsOptimizing()) {
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 int target_offset = masm()->pc_offset() + Deoptimizer::patch_size(); 508 int target_offset = masm()->pc_offset() + Deoptimizer::patch_size();
509 while (masm()->pc_offset() < target_offset) { 509 while (masm()->pc_offset() < target_offset) {
510 masm()->nop(); 510 masm()->nop();
511 } 511 }
512 } 512 }
513 safepoints_.Emit(masm(), GetStackSlotCount()); 513 safepoints_.Emit(masm(), GetStackSlotCount());
514 return !is_aborted(); 514 return !is_aborted();
515 } 515 }
516 516
517 517
518 Register LCodeGen::ToRegister(int code) const { 518 Register LCodeGen::ToRegister(int index) const {
519 return Register::from_code(code); 519 return Register::FromAllocationIndex(index);
520 } 520 }
521 521
522 522
523 XMMRegister LCodeGen::ToDoubleRegister(int code) const { 523 XMMRegister LCodeGen::ToDoubleRegister(int index) const {
524 return XMMRegister::from_code(code); 524 return XMMRegister::FromAllocationIndex(index);
525 } 525 }
526 526
527 527
528 Register LCodeGen::ToRegister(LOperand* op) const { 528 Register LCodeGen::ToRegister(LOperand* op) const {
529 DCHECK(op->IsRegister()); 529 DCHECK(op->IsRegister());
530 return ToRegister(op->index()); 530 return ToRegister(op->index());
531 } 531 }
532 532
533 533
534 XMMRegister LCodeGen::ToDoubleRegister(LOperand* op) const { 534 XMMRegister LCodeGen::ToDoubleRegister(LOperand* op) const {
(...skipping 5188 matching lines...) Expand 10 before | Expand all | Expand 10 after
5723 RecordSafepoint(Safepoint::kNoLazyDeopt); 5723 RecordSafepoint(Safepoint::kNoLazyDeopt);
5724 } 5724 }
5725 5725
5726 5726
5727 #undef __ 5727 #undef __
5728 5728
5729 } // namespace internal 5729 } // namespace internal
5730 } // namespace v8 5730 } // namespace v8
5731 5731
5732 #endif // V8_TARGET_ARCH_IA32 5732 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/deoptimizer-ia32.cc ('k') | src/ia32/lithium-gap-resolver-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698