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

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

Issue 1380863004: Revert of 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 | « src/arm64/lithium-arm64.cc ('k') | src/arm64/macro-assembler-arm64.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/arm64/frames-arm64.h" 5 #include "src/arm64/frames-arm64.h"
6 #include "src/arm64/lithium-codegen-arm64.h" 6 #include "src/arm64/lithium-codegen-arm64.h"
7 #include "src/arm64/lithium-gap-resolver-arm64.h" 7 #include "src/arm64/lithium-gap-resolver-arm64.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 void LCodeGen::SaveCallerDoubles() { 586 void LCodeGen::SaveCallerDoubles() {
587 DCHECK(info()->saves_caller_doubles()); 587 DCHECK(info()->saves_caller_doubles());
588 DCHECK(NeedsEagerFrame()); 588 DCHECK(NeedsEagerFrame());
589 Comment(";;; Save clobbered callee double registers"); 589 Comment(";;; Save clobbered callee double registers");
590 BitVector* doubles = chunk()->allocated_double_registers(); 590 BitVector* doubles = chunk()->allocated_double_registers();
591 BitVector::Iterator iterator(doubles); 591 BitVector::Iterator iterator(doubles);
592 int count = 0; 592 int count = 0;
593 while (!iterator.Done()) { 593 while (!iterator.Done()) {
594 // TODO(all): Is this supposed to save just the callee-saved doubles? It 594 // TODO(all): Is this supposed to save just the callee-saved doubles? It
595 // looks like it's saving all of them. 595 // looks like it's saving all of them.
596 FPRegister value = FPRegister::from_code(iterator.Current()); 596 FPRegister value = FPRegister::FromAllocationIndex(iterator.Current());
597 __ Poke(value, count * kDoubleSize); 597 __ Poke(value, count * kDoubleSize);
598 iterator.Advance(); 598 iterator.Advance();
599 count++; 599 count++;
600 } 600 }
601 } 601 }
602 602
603 603
604 void LCodeGen::RestoreCallerDoubles() { 604 void LCodeGen::RestoreCallerDoubles() {
605 DCHECK(info()->saves_caller_doubles()); 605 DCHECK(info()->saves_caller_doubles());
606 DCHECK(NeedsEagerFrame()); 606 DCHECK(NeedsEagerFrame());
607 Comment(";;; Restore clobbered callee double registers"); 607 Comment(";;; Restore clobbered callee double registers");
608 BitVector* doubles = chunk()->allocated_double_registers(); 608 BitVector* doubles = chunk()->allocated_double_registers();
609 BitVector::Iterator iterator(doubles); 609 BitVector::Iterator iterator(doubles);
610 int count = 0; 610 int count = 0;
611 while (!iterator.Done()) { 611 while (!iterator.Done()) {
612 // TODO(all): Is this supposed to restore just the callee-saved doubles? It 612 // TODO(all): Is this supposed to restore just the callee-saved doubles? It
613 // looks like it's restoring all of them. 613 // looks like it's restoring all of them.
614 FPRegister value = FPRegister::from_code(iterator.Current()); 614 FPRegister value = FPRegister::FromAllocationIndex(iterator.Current());
615 __ Peek(value, count * kDoubleSize); 615 __ Peek(value, count * kDoubleSize);
616 iterator.Advance(); 616 iterator.Advance();
617 count++; 617 count++;
618 } 618 }
619 } 619 }
620 620
621 621
622 bool LCodeGen::GeneratePrologue() { 622 bool LCodeGen::GeneratePrologue() {
623 DCHECK(is_generating()); 623 DCHECK(is_generating());
624 624
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 } 1150 }
1151 } 1151 }
1152 } 1152 }
1153 last_lazy_deopt_pc_ = masm()->pc_offset(); 1153 last_lazy_deopt_pc_ = masm()->pc_offset();
1154 } 1154 }
1155 1155
1156 1156
1157 Register LCodeGen::ToRegister(LOperand* op) const { 1157 Register LCodeGen::ToRegister(LOperand* op) const {
1158 // TODO(all): support zero register results, as ToRegister32. 1158 // TODO(all): support zero register results, as ToRegister32.
1159 DCHECK((op != NULL) && op->IsRegister()); 1159 DCHECK((op != NULL) && op->IsRegister());
1160 return Register::from_code(op->index()); 1160 return Register::FromAllocationIndex(op->index());
1161 } 1161 }
1162 1162
1163 1163
1164 Register LCodeGen::ToRegister32(LOperand* op) const { 1164 Register LCodeGen::ToRegister32(LOperand* op) const {
1165 DCHECK(op != NULL); 1165 DCHECK(op != NULL);
1166 if (op->IsConstantOperand()) { 1166 if (op->IsConstantOperand()) {
1167 // If this is a constant operand, the result must be the zero register. 1167 // If this is a constant operand, the result must be the zero register.
1168 DCHECK(ToInteger32(LConstantOperand::cast(op)) == 0); 1168 DCHECK(ToInteger32(LConstantOperand::cast(op)) == 0);
1169 return wzr; 1169 return wzr;
1170 } else { 1170 } else {
1171 return ToRegister(op).W(); 1171 return ToRegister(op).W();
1172 } 1172 }
1173 } 1173 }
1174 1174
1175 1175
1176 Smi* LCodeGen::ToSmi(LConstantOperand* op) const { 1176 Smi* LCodeGen::ToSmi(LConstantOperand* op) const {
1177 HConstant* constant = chunk_->LookupConstant(op); 1177 HConstant* constant = chunk_->LookupConstant(op);
1178 return Smi::FromInt(constant->Integer32Value()); 1178 return Smi::FromInt(constant->Integer32Value());
1179 } 1179 }
1180 1180
1181 1181
1182 DoubleRegister LCodeGen::ToDoubleRegister(LOperand* op) const { 1182 DoubleRegister LCodeGen::ToDoubleRegister(LOperand* op) const {
1183 DCHECK((op != NULL) && op->IsDoubleRegister()); 1183 DCHECK((op != NULL) && op->IsDoubleRegister());
1184 return DoubleRegister::from_code(op->index()); 1184 return DoubleRegister::FromAllocationIndex(op->index());
1185 } 1185 }
1186 1186
1187 1187
1188 Operand LCodeGen::ToOperand(LOperand* op) { 1188 Operand LCodeGen::ToOperand(LOperand* op) {
1189 DCHECK(op != NULL); 1189 DCHECK(op != NULL);
1190 if (op->IsConstantOperand()) { 1190 if (op->IsConstantOperand()) {
1191 LConstantOperand* const_op = LConstantOperand::cast(op); 1191 LConstantOperand* const_op = LConstantOperand::cast(op);
1192 HConstant* constant = chunk()->LookupConstant(const_op); 1192 HConstant* constant = chunk()->LookupConstant(const_op);
1193 Representation r = chunk_->LookupLiteralRepresentation(const_op); 1193 Representation r = chunk_->LookupLiteralRepresentation(const_op);
1194 if (r.IsSmi()) { 1194 if (r.IsSmi()) {
(...skipping 4810 matching lines...) Expand 10 before | Expand all | Expand 10 after
6005 Handle<ScopeInfo> scope_info = instr->scope_info(); 6005 Handle<ScopeInfo> scope_info = instr->scope_info();
6006 __ Push(scope_info); 6006 __ Push(scope_info);
6007 __ Push(ToRegister(instr->function())); 6007 __ Push(ToRegister(instr->function()));
6008 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6008 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6009 RecordSafepoint(Safepoint::kNoLazyDeopt); 6009 RecordSafepoint(Safepoint::kNoLazyDeopt);
6010 } 6010 }
6011 6011
6012 6012
6013 } // namespace internal 6013 } // namespace internal
6014 } // namespace v8 6014 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm64/lithium-arm64.cc ('k') | src/arm64/macro-assembler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698