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

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

Issue 10592023: - Fix the barrier code when low bits of Smi are zeroes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « runtime/vm/assembler_ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/os.h" 9 #include "vm/os.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 RawObject* value, 1855 RawObject* value,
1856 RawObject* growable_array); 1856 RawObject* growable_array);
1857 StoreData test_code = reinterpret_cast<StoreData>(entry); 1857 StoreData test_code = reinterpret_cast<StoreData>(entry);
1858 1858
1859 const Array& old_array = Array::Handle(Array::New(3, Heap::kOld)); 1859 const Array& old_array = Array::Handle(Array::New(3, Heap::kOld));
1860 const Array& new_array = Array::Handle(Array::New(3, Heap::kNew)); 1860 const Array& new_array = Array::Handle(Array::New(3, Heap::kNew));
1861 const GrowableObjectArray& grow_old_array = GrowableObjectArray::Handle( 1861 const GrowableObjectArray& grow_old_array = GrowableObjectArray::Handle(
1862 GrowableObjectArray::New(old_array, Heap::kOld)); 1862 GrowableObjectArray::New(old_array, Heap::kOld));
1863 const GrowableObjectArray& grow_new_array = GrowableObjectArray::Handle( 1863 const GrowableObjectArray& grow_new_array = GrowableObjectArray::Handle(
1864 GrowableObjectArray::New(old_array, Heap::kNew)); 1864 GrowableObjectArray::New(old_array, Heap::kNew));
1865 const Smi& smi = Smi::Handle(Smi::New(7)); 1865 Smi& smi = Smi::Handle();
1866 const Context& ctx = Context::Handle(Context::New(0)); 1866 const Context& ctx = Context::Handle(Context::New(0));
1867 1867
1868 EXPECT(old_array.raw() == grow_old_array.data()); 1868 EXPECT(old_array.raw() == grow_old_array.data());
1869 EXPECT(!Isolate::Current()->store_buffer()->Contains( 1869 EXPECT(!Isolate::Current()->store_buffer()->Contains(
1870 reinterpret_cast<uword>(grow_old_array.raw()) + 1870 reinterpret_cast<uword>(grow_old_array.raw()) +
1871 GrowableObjectArray::data_offset() - kHeapObjectTag)); 1871 GrowableObjectArray::data_offset() - kHeapObjectTag));
1872 EXPECT(old_array.raw() == grow_new_array.data()); 1872 EXPECT(old_array.raw() == grow_new_array.data());
1873 EXPECT(!Isolate::Current()->store_buffer()->Contains( 1873 EXPECT(!Isolate::Current()->store_buffer()->Contains(
1874 reinterpret_cast<uword>(grow_new_array.raw()) + 1874 reinterpret_cast<uword>(grow_new_array.raw()) +
1875 GrowableObjectArray::data_offset() - kHeapObjectTag)); 1875 GrowableObjectArray::data_offset() - kHeapObjectTag));
1876 1876
1877 // Store Smi into the old object. 1877 // Store Smis into the old object.
1878 test_code(ctx.raw(), smi.raw(), grow_old_array.raw()); 1878 for (int i = -32; i < 32; i++) {
cshapiro 2012/06/20 20:36:11 You probably want to check all of the values in th
1879 EXPECT(reinterpret_cast<RawArray*>(smi.raw()) == grow_old_array.data()); 1879 smi = Smi::New(i);
1880 EXPECT(!Isolate::Current()->store_buffer()->Contains( 1880 test_code(ctx.raw(), smi.raw(), grow_old_array.raw());
1881 reinterpret_cast<uword>(grow_old_array.raw()) + 1881 EXPECT(reinterpret_cast<RawArray*>(smi.raw()) == grow_old_array.data());
1882 GrowableObjectArray::data_offset() - kHeapObjectTag)); 1882 EXPECT(!Isolate::Current()->store_buffer()->Contains(
1883 reinterpret_cast<uword>(grow_old_array.raw()) +
1884 GrowableObjectArray::data_offset() - kHeapObjectTag));
1885 }
1883 1886
1884 // Store an old object into the old object. 1887 // Store an old object into the old object.
1885 test_code(ctx.raw(), old_array.raw(), grow_old_array.raw()); 1888 test_code(ctx.raw(), old_array.raw(), grow_old_array.raw());
1886 EXPECT(old_array.raw() == grow_old_array.data()); 1889 EXPECT(old_array.raw() == grow_old_array.data());
1887 EXPECT(!Isolate::Current()->store_buffer()->Contains( 1890 EXPECT(!Isolate::Current()->store_buffer()->Contains(
1888 reinterpret_cast<uword>(grow_old_array.raw()) + 1891 reinterpret_cast<uword>(grow_old_array.raw()) +
1889 GrowableObjectArray::data_offset() - kHeapObjectTag)); 1892 GrowableObjectArray::data_offset() - kHeapObjectTag));
1890 1893
1891 // Store a new object into the old object. 1894 // Store a new object into the old object.
1892 test_code(ctx.raw(), new_array.raw(), grow_old_array.raw()); 1895 test_code(ctx.raw(), new_array.raw(), grow_old_array.raw());
(...skipping 14 matching lines...) Expand all
1907 EXPECT(old_array.raw() == grow_new_array.data()); 1910 EXPECT(old_array.raw() == grow_new_array.data());
1908 EXPECT(!Isolate::Current()->store_buffer()->Contains( 1911 EXPECT(!Isolate::Current()->store_buffer()->Contains(
1909 reinterpret_cast<uword>(grow_new_array.raw()) + 1912 reinterpret_cast<uword>(grow_new_array.raw()) +
1910 GrowableObjectArray::data_offset() - kHeapObjectTag)); 1913 GrowableObjectArray::data_offset() - kHeapObjectTag));
1911 } 1914 }
1912 1915
1913 1916
1914 } // namespace dart 1917 } // namespace dart
1915 1918
1916 #endif // defined TARGET_ARCH_IA32 1919 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698