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

Side by Side Diff: src/arm64/macro-assembler-arm64.cc

Issue 209933003: ARM64: push/pop registers in stubs for safepoints (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review fix Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/arm64/macro-assembler-arm64.h ('k') | src/code-stubs.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4143 matching lines...) Expand 10 before | Expand all | Expand 10 after
4154 void MacroAssembler::PushSafepointRegisters() { 4154 void MacroAssembler::PushSafepointRegisters() {
4155 // Safepoints expect a block of kNumSafepointRegisters values on the stack, so 4155 // Safepoints expect a block of kNumSafepointRegisters values on the stack, so
4156 // adjust the stack for unsaved registers. 4156 // adjust the stack for unsaved registers.
4157 const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters; 4157 const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters;
4158 ASSERT(num_unsaved >= 0); 4158 ASSERT(num_unsaved >= 0);
4159 Claim(num_unsaved); 4159 Claim(num_unsaved);
4160 PushXRegList(kSafepointSavedRegisters); 4160 PushXRegList(kSafepointSavedRegisters);
4161 } 4161 }
4162 4162
4163 4163
4164 void MacroAssembler::PushSafepointFPRegisters() { 4164 void MacroAssembler::PushSafepointRegistersAndDoubles() {
4165 PushSafepointRegisters();
4165 PushCPURegList(CPURegList(CPURegister::kFPRegister, kDRegSizeInBits, 4166 PushCPURegList(CPURegList(CPURegister::kFPRegister, kDRegSizeInBits,
4166 FPRegister::kAllocatableFPRegisters)); 4167 FPRegister::kAllocatableFPRegisters));
4167 } 4168 }
4168 4169
4169 4170
4170 void MacroAssembler::PopSafepointFPRegisters() { 4171 void MacroAssembler::PopSafepointRegistersAndDoubles() {
4171 PopCPURegList(CPURegList(CPURegister::kFPRegister, kDRegSizeInBits, 4172 PopCPURegList(CPURegList(CPURegister::kFPRegister, kDRegSizeInBits,
4172 FPRegister::kAllocatableFPRegisters)); 4173 FPRegister::kAllocatableFPRegisters));
4174 PopSafepointRegisters();
4173 } 4175 }
4174 4176
4175 4177
4176 int MacroAssembler::SafepointRegisterStackIndex(int reg_code) { 4178 int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
4177 // Make sure the safepoint registers list is what we expect. 4179 // Make sure the safepoint registers list is what we expect.
4178 ASSERT(CPURegList::GetSafepointSavedRegisters().list() == 0x6ffcffff); 4180 ASSERT(CPURegList::GetSafepointSavedRegisters().list() == 0x6ffcffff);
4179 4181
4180 // Safepoint registers are stored contiguously on the stack, but not all the 4182 // Safepoint registers are stored contiguously on the stack, but not all the
4181 // registers are saved. The following registers are excluded: 4183 // registers are saved. The following registers are excluded:
4182 // - x16 and x17 (ip0 and ip1) because they shouldn't be preserved outside of 4184 // - x16 and x17 (ip0 and ip1) because they shouldn't be preserved outside of
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
5111 5113
5112 CPURegister UseScratchRegisterScope::AcquireNextAvailable( 5114 CPURegister UseScratchRegisterScope::AcquireNextAvailable(
5113 CPURegList* available) { 5115 CPURegList* available) {
5114 CHECK(!available->IsEmpty()); 5116 CHECK(!available->IsEmpty());
5115 CPURegister result = available->PopLowestIndex(); 5117 CPURegister result = available->PopLowestIndex();
5116 ASSERT(!AreAliased(result, xzr, csp)); 5118 ASSERT(!AreAliased(result, xzr, csp));
5117 return result; 5119 return result;
5118 } 5120 }
5119 5121
5120 5122
5123 CPURegister UseScratchRegisterScope::UnsafeAcquire(CPURegList* available,
5124 const CPURegister& reg) {
5125 ASSERT(available->IncludesAliasOf(reg));
5126 available->Remove(reg);
5127 return reg;
5128 }
5129
5130
5121 #define __ masm-> 5131 #define __ masm->
5122 5132
5123 5133
5124 void InlineSmiCheckInfo::Emit(MacroAssembler* masm, const Register& reg, 5134 void InlineSmiCheckInfo::Emit(MacroAssembler* masm, const Register& reg,
5125 const Label* smi_check) { 5135 const Label* smi_check) {
5126 Assembler::BlockPoolsScope scope(masm); 5136 Assembler::BlockPoolsScope scope(masm);
5127 if (reg.IsValid()) { 5137 if (reg.IsValid()) {
5128 ASSERT(smi_check->is_bound()); 5138 ASSERT(smi_check->is_bound());
5129 ASSERT(reg.Is64Bits()); 5139 ASSERT(reg.Is64Bits());
5130 5140
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
5162 } 5172 }
5163 } 5173 }
5164 5174
5165 5175
5166 #undef __ 5176 #undef __
5167 5177
5168 5178
5169 } } // namespace v8::internal 5179 } } // namespace v8::internal
5170 5180
5171 #endif // V8_TARGET_ARCH_ARM64 5181 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/macro-assembler-arm64.h ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698