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

Side by Side Diff: src/ia32/code-stubs-ia32.h

Issue 284503002: Simplify DoubleRegister for the ia32 port. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comment Created 6 years, 7 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/ia32/assembler-ia32.cc ('k') | src/ia32/code-stubs-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 #ifndef V8_IA32_CODE_STUBS_IA32_H_ 5 #ifndef V8_IA32_CODE_STUBS_IA32_H_
6 #define V8_IA32_CODE_STUBS_IA32_H_ 6 #define V8_IA32_CODE_STUBS_IA32_H_
7 7
8 #include "macro-assembler.h" 8 #include "macro-assembler.h"
9 #include "ic-inl.h" 9 #include "ic-inl.h"
10 10
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 // If we have to call into C then we need to save and restore all caller- 330 // If we have to call into C then we need to save and restore all caller-
331 // saved registers that were not already preserved. The caller saved 331 // saved registers that were not already preserved. The caller saved
332 // registers are eax, ecx and edx. The three scratch registers (incl. ecx) 332 // registers are eax, ecx and edx. The three scratch registers (incl. ecx)
333 // will be restored by other means so we don't bother pushing them here. 333 // will be restored by other means so we don't bother pushing them here.
334 void SaveCallerSaveRegisters(MacroAssembler* masm, SaveFPRegsMode mode) { 334 void SaveCallerSaveRegisters(MacroAssembler* masm, SaveFPRegsMode mode) {
335 if (!scratch0_.is(eax) && !scratch1_.is(eax)) masm->push(eax); 335 if (!scratch0_.is(eax) && !scratch1_.is(eax)) masm->push(eax);
336 if (!scratch0_.is(edx) && !scratch1_.is(edx)) masm->push(edx); 336 if (!scratch0_.is(edx) && !scratch1_.is(edx)) masm->push(edx);
337 if (mode == kSaveFPRegs) { 337 if (mode == kSaveFPRegs) {
338 masm->sub(esp, 338 masm->sub(esp,
339 Immediate(kDoubleSize * (XMMRegister::kNumRegisters - 1))); 339 Immediate(kDoubleSize * (XMMRegister::kMaxNumRegisters - 1)));
340 // Save all XMM registers except XMM0. 340 // Save all XMM registers except XMM0.
341 for (int i = XMMRegister::kNumRegisters - 1; i > 0; i--) { 341 for (int i = XMMRegister::kMaxNumRegisters - 1; i > 0; i--) {
342 XMMRegister reg = XMMRegister::from_code(i); 342 XMMRegister reg = XMMRegister::from_code(i);
343 masm->movsd(Operand(esp, (i - 1) * kDoubleSize), reg); 343 masm->movsd(Operand(esp, (i - 1) * kDoubleSize), reg);
344 } 344 }
345 } 345 }
346 } 346 }
347 347
348 inline void RestoreCallerSaveRegisters(MacroAssembler*masm, 348 inline void RestoreCallerSaveRegisters(MacroAssembler*masm,
349 SaveFPRegsMode mode) { 349 SaveFPRegsMode mode) {
350 if (mode == kSaveFPRegs) { 350 if (mode == kSaveFPRegs) {
351 // Restore all XMM registers except XMM0. 351 // Restore all XMM registers except XMM0.
352 for (int i = XMMRegister::kNumRegisters - 1; i > 0; i--) { 352 for (int i = XMMRegister::kMaxNumRegisters - 1; i > 0; i--) {
353 XMMRegister reg = XMMRegister::from_code(i); 353 XMMRegister reg = XMMRegister::from_code(i);
354 masm->movsd(reg, Operand(esp, (i - 1) * kDoubleSize)); 354 masm->movsd(reg, Operand(esp, (i - 1) * kDoubleSize));
355 } 355 }
356 masm->add(esp, 356 masm->add(esp,
357 Immediate(kDoubleSize * (XMMRegister::kNumRegisters - 1))); 357 Immediate(kDoubleSize * (XMMRegister::kMaxNumRegisters - 1)));
358 } 358 }
359 if (!scratch0_.is(edx) && !scratch1_.is(edx)) masm->pop(edx); 359 if (!scratch0_.is(edx) && !scratch1_.is(edx)) masm->pop(edx);
360 if (!scratch0_.is(eax) && !scratch1_.is(eax)) masm->pop(eax); 360 if (!scratch0_.is(eax) && !scratch1_.is(eax)) masm->pop(eax);
361 } 361 }
362 362
363 inline Register object() { return object_; } 363 inline Register object() { return object_; }
364 inline Register address() { return address_; } 364 inline Register address() { return address_; }
365 inline Register scratch0() { return scratch0_; } 365 inline Register scratch0() { return scratch0_; }
366 inline Register scratch1() { return scratch1_; } 366 inline Register scratch1() { return scratch1_; }
367 367
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 Register address_; 430 Register address_;
431 RememberedSetAction remembered_set_action_; 431 RememberedSetAction remembered_set_action_;
432 SaveFPRegsMode save_fp_regs_mode_; 432 SaveFPRegsMode save_fp_regs_mode_;
433 RegisterAllocation regs_; 433 RegisterAllocation regs_;
434 }; 434 };
435 435
436 436
437 } } // namespace v8::internal 437 } } // namespace v8::internal
438 438
439 #endif // V8_IA32_CODE_STUBS_IA32_H_ 439 #endif // V8_IA32_CODE_STUBS_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698