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

Side by Side Diff: src/compiler/ia32/code-generator-ia32.cc

Issue 2623633003: [Atomics] Make Atomics.exchange a builtin using TF (Closed)
Patch Set: remove headers Created 3 years, 9 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compilation-info.h" 7 #include "src/compilation-info.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 break; 1881 break;
1882 case kIA32Poke: { 1882 case kIA32Poke: {
1883 int const slot = MiscField::decode(instr->opcode()); 1883 int const slot = MiscField::decode(instr->opcode());
1884 if (HasImmediateInput(instr, 0)) { 1884 if (HasImmediateInput(instr, 0)) {
1885 __ mov(Operand(esp, slot * kPointerSize), i.InputImmediate(0)); 1885 __ mov(Operand(esp, slot * kPointerSize), i.InputImmediate(0));
1886 } else { 1886 } else {
1887 __ mov(Operand(esp, slot * kPointerSize), i.InputRegister(0)); 1887 __ mov(Operand(esp, slot * kPointerSize), i.InputRegister(0));
1888 } 1888 }
1889 break; 1889 break;
1890 } 1890 }
1891 case kIA32Xchgb: {
1892 size_t index = 0;
1893 Operand operand = i.MemoryOperand(&index);
1894 __ xchg_b(i.InputRegister(index), operand);
1895 break;
1896 }
1897 case kIA32Xchgw: {
1898 size_t index = 0;
1899 Operand operand = i.MemoryOperand(&index);
1900 __ xchg_w(i.InputRegister(index), operand);
1901 break;
1902 }
1903 case kIA32Xchgl: {
1904 size_t index = 0;
1905 Operand operand = i.MemoryOperand(&index);
1906 __ xchg(i.InputRegister(index), operand);
1907 break;
1908 }
1909 case kCheckedLoadInt8: 1891 case kCheckedLoadInt8:
1910 ASSEMBLE_CHECKED_LOAD_INTEGER(movsx_b); 1892 ASSEMBLE_CHECKED_LOAD_INTEGER(movsx_b);
1911 break; 1893 break;
1912 case kCheckedLoadUint8: 1894 case kCheckedLoadUint8:
1913 ASSEMBLE_CHECKED_LOAD_INTEGER(movzx_b); 1895 ASSEMBLE_CHECKED_LOAD_INTEGER(movzx_b);
1914 break; 1896 break;
1915 case kCheckedLoadInt16: 1897 case kCheckedLoadInt16:
1916 ASSEMBLE_CHECKED_LOAD_INTEGER(movsx_w); 1898 ASSEMBLE_CHECKED_LOAD_INTEGER(movsx_w);
1917 break; 1899 break;
1918 case kCheckedLoadUint16: 1900 case kCheckedLoadUint16:
(...skipping 26 matching lines...) Expand all
1945 case kIA32StackCheck: { 1927 case kIA32StackCheck: {
1946 ExternalReference const stack_limit = 1928 ExternalReference const stack_limit =
1947 ExternalReference::address_of_stack_limit(isolate()); 1929 ExternalReference::address_of_stack_limit(isolate());
1948 __ cmp(esp, Operand::StaticVariable(stack_limit)); 1930 __ cmp(esp, Operand::StaticVariable(stack_limit));
1949 break; 1931 break;
1950 } 1932 }
1951 case kCheckedLoadWord64: 1933 case kCheckedLoadWord64:
1952 case kCheckedStoreWord64: 1934 case kCheckedStoreWord64:
1953 UNREACHABLE(); // currently unsupported checked int64 load/store. 1935 UNREACHABLE(); // currently unsupported checked int64 load/store.
1954 break; 1936 break;
1937 case kAtomicExchangeInt8: {
1938 __ xchg_b(i.InputRegister(0), i.MemoryOperand(1));
1939 __ movsx_b(i.InputRegister(0), i.InputRegister(0));
1940 break;
1941 }
1942 case kAtomicExchangeUint8: {
1943 __ xchg_b(i.InputRegister(0), i.MemoryOperand(1));
1944 __ movzx_b(i.InputRegister(0), i.InputRegister(0));
1945 break;
1946 }
1947 case kAtomicExchangeInt16: {
1948 __ xchg_w(i.InputRegister(0), i.MemoryOperand(1));
1949 __ movsx_w(i.InputRegister(0), i.InputRegister(0));
1950 break;
1951 }
1952 case kAtomicExchangeUint16: {
1953 __ xchg_w(i.InputRegister(0), i.MemoryOperand(1));
1954 __ movzx_w(i.InputRegister(0), i.InputRegister(0));
1955 break;
1956 }
1957 case kAtomicExchangeWord32: {
1958 __ xchg(i.InputRegister(0), i.MemoryOperand(1));
1959 break;
1960 }
1955 case kAtomicLoadInt8: 1961 case kAtomicLoadInt8:
1956 case kAtomicLoadUint8: 1962 case kAtomicLoadUint8:
1957 case kAtomicLoadInt16: 1963 case kAtomicLoadInt16:
1958 case kAtomicLoadUint16: 1964 case kAtomicLoadUint16:
1959 case kAtomicLoadWord32: 1965 case kAtomicLoadWord32:
1960 case kAtomicStoreWord8: 1966 case kAtomicStoreWord8:
1961 case kAtomicStoreWord16: 1967 case kAtomicStoreWord16:
1962 case kAtomicStoreWord32: 1968 case kAtomicStoreWord32:
1963 UNREACHABLE(); // Won't be generated by instruction selector. 1969 UNREACHABLE(); // Won't be generated by instruction selector.
1964 break; 1970 break;
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
2666 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2672 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2667 __ Nop(padding_size); 2673 __ Nop(padding_size);
2668 } 2674 }
2669 } 2675 }
2670 2676
2671 #undef __ 2677 #undef __
2672 2678
2673 } // namespace compiler 2679 } // namespace compiler
2674 } // namespace internal 2680 } // namespace internal
2675 } // namespace v8 2681 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698