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

Side by Side Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 48743002: Do not directly load smi constants larger than a 16 bit payload on ia32. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 __ movups(XMM0, source.ToStackSlotAddress()); 1763 __ movups(XMM0, source.ToStackSlotAddress());
1764 __ movups(destination.ToStackSlotAddress(), XMM0); 1764 __ movups(destination.ToStackSlotAddress(), XMM0);
1765 } 1765 }
1766 } else { 1766 } else {
1767 ASSERT(source.IsConstant()); 1767 ASSERT(source.IsConstant());
1768 if (destination.IsRegister()) { 1768 if (destination.IsRegister()) {
1769 const Object& constant = source.constant(); 1769 const Object& constant = source.constant();
1770 if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) { 1770 if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) {
1771 __ xorl(destination.reg(), destination.reg()); 1771 __ xorl(destination.reg(), destination.reg());
1772 } else { 1772 } else {
1773 __ LoadObject(destination.reg(), constant); 1773 __ LoadObjectSafely(destination.reg(), constant);
1774 } 1774 }
1775 } else { 1775 } else {
1776 ASSERT(destination.IsStackSlot()); 1776 ASSERT(destination.IsStackSlot());
1777 StoreObject(destination.ToStackSlotAddress(), source.constant()); 1777 StoreObject(destination.ToStackSlotAddress(), source.constant());
1778 } 1778 }
1779 } 1779 }
1780 1780
1781 move->Eliminate(); 1781 move->Eliminate();
1782 } 1782 }
1783 1783
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 1862
1863 void ParallelMoveResolver::MoveMemoryToMemory(const Address& dst, 1863 void ParallelMoveResolver::MoveMemoryToMemory(const Address& dst,
1864 const Address& src) { 1864 const Address& src) {
1865 ScratchRegisterScope ensure_scratch(this, kNoRegister); 1865 ScratchRegisterScope ensure_scratch(this, kNoRegister);
1866 __ movl(ensure_scratch.reg(), src); 1866 __ movl(ensure_scratch.reg(), src);
1867 __ movl(dst, ensure_scratch.reg()); 1867 __ movl(dst, ensure_scratch.reg());
1868 } 1868 }
1869 1869
1870 1870
1871 void ParallelMoveResolver::StoreObject(const Address& dst, const Object& obj) { 1871 void ParallelMoveResolver::StoreObject(const Address& dst, const Object& obj) {
1872 if (obj.IsSmi() || obj.IsNull()) { 1872 if (Assembler::IsSafeSmi(obj) || obj.IsNull()) {
1873 __ movl(dst, Immediate(reinterpret_cast<int32_t>(obj.raw()))); 1873 __ movl(dst, Immediate(reinterpret_cast<int32_t>(obj.raw())));
1874 } else { 1874 } else {
1875 ScratchRegisterScope ensure_scratch(this, kNoRegister); 1875 ScratchRegisterScope ensure_scratch(this, kNoRegister);
1876 __ LoadObject(ensure_scratch.reg(), obj); 1876 __ LoadObjectSafely(ensure_scratch.reg(), obj);
1877 __ movl(dst, ensure_scratch.reg()); 1877 __ movl(dst, ensure_scratch.reg());
1878 } 1878 }
1879 } 1879 }
1880 1880
1881 1881
1882 void ParallelMoveResolver::Exchange(Register reg, const Address& mem) { 1882 void ParallelMoveResolver::Exchange(Register reg, const Address& mem) {
1883 ScratchRegisterScope ensure_scratch(this, reg); 1883 ScratchRegisterScope ensure_scratch(this, reg);
1884 __ movl(ensure_scratch.reg(), mem); 1884 __ movl(ensure_scratch.reg(), mem);
1885 __ movl(mem, reg); 1885 __ movl(mem, reg);
1886 __ movl(reg, ensure_scratch.reg()); 1886 __ movl(reg, ensure_scratch.reg());
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1928 __ movups(reg, Address(ESP, 0)); 1928 __ movups(reg, Address(ESP, 0));
1929 __ addl(ESP, Immediate(kFpuRegisterSize)); 1929 __ addl(ESP, Immediate(kFpuRegisterSize));
1930 } 1930 }
1931 1931
1932 1932
1933 #undef __ 1933 #undef __
1934 1934
1935 } // namespace dart 1935 } // namespace dart
1936 1936
1937 #endif // defined TARGET_ARCH_IA32 1937 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698