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/macro-assembler-ia32.cc

Issue 6541051: Unifying the handling of storing and loading from safepoint stack (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 10 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/macro-assembler-ia32.h ('k') | src/x64/assembler-x64.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 Label ok, fail; 1647 Label ok, fail;
1648 CheckMap(map, Factory::meta_map(), &fail, false); 1648 CheckMap(map, Factory::meta_map(), &fail, false);
1649 jmp(&ok); 1649 jmp(&ok);
1650 bind(&fail); 1650 bind(&fail);
1651 Abort("Global functions must have initial map"); 1651 Abort("Global functions must have initial map");
1652 bind(&ok); 1652 bind(&ok);
1653 } 1653 }
1654 } 1654 }
1655 1655
1656 1656
1657 // Store the value in register src in the safepoint register stack
1658 // slot for register dst.
1659 void MacroAssembler::StoreToSafepointRegisterSlot(Register dst, Register src) {
1660 mov(SafepointRegisterSlot(dst), src);
1661 }
1662
1663
1664 void MacroAssembler::StoreToSafepointRegisterSlot(Register dst, Immediate src) {
1665 mov(SafepointRegisterSlot(dst), src);
1666 }
1667
1668
1669 void MacroAssembler::LoadFromSafepointRegisterSlot(Register dst, Register src) {
1670 mov(dst, SafepointRegisterSlot(src));
1671 }
1672
1673
1674 Operand MacroAssembler::SafepointRegisterSlot(Register reg) {
1675 return Operand(esp, SafepointRegisterStackIndex(reg.code()) * kPointerSize);
1676 }
1677
1678
1657 int MacroAssembler::SafepointRegisterStackIndex(int reg_code) { 1679 int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
1658 // The registers are pushed starting with the lowest encoding, 1680 // The registers are pushed starting with the lowest encoding,
1659 // which means that lowest encodings are furthest away from 1681 // which means that lowest encodings are furthest away from
1660 // the stack pointer. 1682 // the stack pointer.
1661 ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters); 1683 ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters);
1662 return kNumSafepointRegisters - reg_code - 1; 1684 return kNumSafepointRegisters - reg_code - 1;
1663 } 1685 }
1664 1686
1665 1687
1666 void MacroAssembler::Ret() { 1688 void MacroAssembler::Ret() {
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
2000 2022
2001 // Check that the code was patched as expected. 2023 // Check that the code was patched as expected.
2002 ASSERT(masm_.pc_ == address_ + size_); 2024 ASSERT(masm_.pc_ == address_ + size_);
2003 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 2025 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2004 } 2026 }
2005 2027
2006 2028
2007 } } // namespace v8::internal 2029 } } // namespace v8::internal
2008 2030
2009 #endif // V8_TARGET_ARCH_IA32 2031 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698