| OLD | NEW |
| 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" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
| (...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1883 // Mask out higher, uninteresting bits which were polluted by dest. | 1883 // Mask out higher, uninteresting bits which were polluted by dest. |
| 1884 andl(value, Immediate(kObjectAlignment - 1)); | 1884 andl(value, Immediate(kObjectAlignment - 1)); |
| 1885 // Compare with the expected bit pattern. | 1885 // Compare with the expected bit pattern. |
| 1886 cmpl(value, Immediate( | 1886 cmpl(value, Immediate( |
| 1887 (kNewObjectAlignmentOffset >> 1) + kHeapObjectTag + | 1887 (kNewObjectAlignmentOffset >> 1) + kHeapObjectTag + |
| 1888 kOldObjectAlignmentOffset + kHeapObjectTag)); | 1888 kOldObjectAlignmentOffset + kHeapObjectTag)); |
| 1889 j(NOT_ZERO, no_update, Assembler::kNearJump); | 1889 j(NOT_ZERO, no_update, Assembler::kNearJump); |
| 1890 } | 1890 } |
| 1891 | 1891 |
| 1892 | 1892 |
| 1893 // Destroys the value register. |
| 1893 void Assembler::StoreIntoObject(Register object, | 1894 void Assembler::StoreIntoObject(Register object, |
| 1894 const Address& dest, | 1895 const Address& dest, |
| 1895 Register value, | 1896 Register value, |
| 1896 bool can_value_be_smi) { | 1897 bool can_value_be_smi) { |
| 1897 ASSERT(object != value); | 1898 ASSERT(object != value); |
| 1898 TraceStoreIntoObject(object, dest, value); | 1899 TraceStoreIntoObject(object, dest, value); |
| 1899 movl(dest, value); | 1900 movl(dest, value); |
| 1900 Label done; | 1901 Label done; |
| 1901 if (can_value_be_smi) { | 1902 if (can_value_be_smi) { |
| 1902 StoreIntoObjectFilter(object, value, &done); | 1903 StoreIntoObjectFilter(object, value, &done); |
| 1903 } else { | 1904 } else { |
| 1904 StoreIntoObjectFilterNoSmi(object, value, &done); | 1905 StoreIntoObjectFilterNoSmi(object, value, &done); |
| 1905 } | 1906 } |
| 1906 // A store buffer update is required. | 1907 // A store buffer update is required. |
| 1907 if (value != EAX) pushl(EAX); // Preserve EAX. | 1908 if (value != EAX) pushl(EAX); // Preserve EAX. |
| 1908 leal(EAX, dest); | 1909 if (object != EAX) { |
| 1910 movl(EAX, object); |
| 1911 } |
| 1909 call(&StubCode::UpdateStoreBufferLabel()); | 1912 call(&StubCode::UpdateStoreBufferLabel()); |
| 1910 if (value != EAX) popl(EAX); // Restore EAX. | 1913 if (value != EAX) popl(EAX); // Restore EAX. |
| 1911 Bind(&done); | 1914 Bind(&done); |
| 1912 } | 1915 } |
| 1913 | 1916 |
| 1914 | 1917 |
| 1915 void Assembler::StoreIntoObjectNoBarrier(Register object, | 1918 void Assembler::StoreIntoObjectNoBarrier(Register object, |
| 1916 const Address& dest, | 1919 const Address& dest, |
| 1917 Register value) { | 1920 Register value) { |
| 1918 TraceStoreIntoObject(object, dest, value); | 1921 TraceStoreIntoObject(object, dest, value); |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2359 | 2362 |
| 2360 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 2363 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 2361 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 2364 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 2362 return xmm_reg_names[reg]; | 2365 return xmm_reg_names[reg]; |
| 2363 } | 2366 } |
| 2364 | 2367 |
| 2365 | 2368 |
| 2366 } // namespace dart | 2369 } // namespace dart |
| 2367 | 2370 |
| 2368 #endif // defined TARGET_ARCH_IA32 | 2371 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |