| OLD | NEW | 
|     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  Loading... | 
|   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::FromAllocationIndex(iterator.Current()); |   596     FPRegister value = FPRegister::from_code(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::FromAllocationIndex(iterator.Current()); |   614     FPRegister value = FPRegister::from_code(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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1151       } |  1151       } | 
|  1152     } |  1152     } | 
|  1153   } |  1153   } | 
|  1154   last_lazy_deopt_pc_ = masm()->pc_offset(); |  1154   last_lazy_deopt_pc_ = masm()->pc_offset(); | 
|  1155 } |  1155 } | 
|  1156  |  1156  | 
|  1157  |  1157  | 
|  1158 Register LCodeGen::ToRegister(LOperand* op) const { |  1158 Register LCodeGen::ToRegister(LOperand* op) const { | 
|  1159   // TODO(all): support zero register results, as ToRegister32. |  1159   // TODO(all): support zero register results, as ToRegister32. | 
|  1160   DCHECK((op != NULL) && op->IsRegister()); |  1160   DCHECK((op != NULL) && op->IsRegister()); | 
|  1161   return Register::FromAllocationIndex(op->index()); |  1161   return Register::from_code(op->index()); | 
|  1162 } |  1162 } | 
|  1163  |  1163  | 
|  1164  |  1164  | 
|  1165 Register LCodeGen::ToRegister32(LOperand* op) const { |  1165 Register LCodeGen::ToRegister32(LOperand* op) const { | 
|  1166   DCHECK(op != NULL); |  1166   DCHECK(op != NULL); | 
|  1167   if (op->IsConstantOperand()) { |  1167   if (op->IsConstantOperand()) { | 
|  1168     // If this is a constant operand, the result must be the zero register. |  1168     // If this is a constant operand, the result must be the zero register. | 
|  1169     DCHECK(ToInteger32(LConstantOperand::cast(op)) == 0); |  1169     DCHECK(ToInteger32(LConstantOperand::cast(op)) == 0); | 
|  1170     return wzr; |  1170     return wzr; | 
|  1171   } else { |  1171   } else { | 
|  1172     return ToRegister(op).W(); |  1172     return ToRegister(op).W(); | 
|  1173   } |  1173   } | 
|  1174 } |  1174 } | 
|  1175  |  1175  | 
|  1176  |  1176  | 
|  1177 Smi* LCodeGen::ToSmi(LConstantOperand* op) const { |  1177 Smi* LCodeGen::ToSmi(LConstantOperand* op) const { | 
|  1178   HConstant* constant = chunk_->LookupConstant(op); |  1178   HConstant* constant = chunk_->LookupConstant(op); | 
|  1179   return Smi::FromInt(constant->Integer32Value()); |  1179   return Smi::FromInt(constant->Integer32Value()); | 
|  1180 } |  1180 } | 
|  1181  |  1181  | 
|  1182  |  1182  | 
|  1183 DoubleRegister LCodeGen::ToDoubleRegister(LOperand* op) const { |  1183 DoubleRegister LCodeGen::ToDoubleRegister(LOperand* op) const { | 
|  1184   DCHECK((op != NULL) && op->IsDoubleRegister()); |  1184   DCHECK((op != NULL) && op->IsDoubleRegister()); | 
|  1185   return DoubleRegister::FromAllocationIndex(op->index()); |  1185   return DoubleRegister::from_code(op->index()); | 
|  1186 } |  1186 } | 
|  1187  |  1187  | 
|  1188  |  1188  | 
|  1189 Operand LCodeGen::ToOperand(LOperand* op) { |  1189 Operand LCodeGen::ToOperand(LOperand* op) { | 
|  1190   DCHECK(op != NULL); |  1190   DCHECK(op != NULL); | 
|  1191   if (op->IsConstantOperand()) { |  1191   if (op->IsConstantOperand()) { | 
|  1192     LConstantOperand* const_op = LConstantOperand::cast(op); |  1192     LConstantOperand* const_op = LConstantOperand::cast(op); | 
|  1193     HConstant* constant = chunk()->LookupConstant(const_op); |  1193     HConstant* constant = chunk()->LookupConstant(const_op); | 
|  1194     Representation r = chunk_->LookupLiteralRepresentation(const_op); |  1194     Representation r = chunk_->LookupLiteralRepresentation(const_op); | 
|  1195     if (r.IsSmi()) { |  1195     if (r.IsSmi()) { | 
| (...skipping 4824 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  6020   Handle<ScopeInfo> scope_info = instr->scope_info(); |  6020   Handle<ScopeInfo> scope_info = instr->scope_info(); | 
|  6021   __ Push(scope_info); |  6021   __ Push(scope_info); | 
|  6022   __ Push(ToRegister(instr->function())); |  6022   __ Push(ToRegister(instr->function())); | 
|  6023   CallRuntime(Runtime::kPushBlockContext, 2, instr); |  6023   CallRuntime(Runtime::kPushBlockContext, 2, instr); | 
|  6024   RecordSafepoint(Safepoint::kNoLazyDeopt); |  6024   RecordSafepoint(Safepoint::kNoLazyDeopt); | 
|  6025 } |  6025 } | 
|  6026  |  6026  | 
|  6027  |  6027  | 
|  6028 }  // namespace internal |  6028 }  // namespace internal | 
|  6029 }  // namespace v8 |  6029 }  // namespace v8 | 
| OLD | NEW |