| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1859 int num_arguments) { | 1859 int num_arguments) { |
| 1860 mov(eax, Immediate(num_arguments)); | 1860 mov(eax, Immediate(num_arguments)); |
| 1861 mov(ebx, Immediate(ref)); | 1861 mov(ebx, Immediate(ref)); |
| 1862 | 1862 |
| 1863 CEntryStub stub(isolate(), 1); | 1863 CEntryStub stub(isolate(), 1); |
| 1864 CallStub(&stub); | 1864 CallStub(&stub); |
| 1865 } | 1865 } |
| 1866 | 1866 |
| 1867 | 1867 |
| 1868 void MacroAssembler::TailCallExternalReference(const ExternalReference& ext, | 1868 void MacroAssembler::TailCallExternalReference(const ExternalReference& ext, |
| 1869 int num_arguments, | 1869 int num_arguments) { |
| 1870 int result_size) { | |
| 1871 // TODO(1236192): Most runtime routines don't need the number of | 1870 // TODO(1236192): Most runtime routines don't need the number of |
| 1872 // arguments passed in because it is constant. At some point we | 1871 // arguments passed in because it is constant. At some point we |
| 1873 // should remove this need and make the runtime routine entry code | 1872 // should remove this need and make the runtime routine entry code |
| 1874 // smarter. | 1873 // smarter. |
| 1875 Move(eax, Immediate(num_arguments)); | 1874 Move(eax, Immediate(num_arguments)); |
| 1876 JumpToExternalReference(ext); | 1875 JumpToExternalReference(ext); |
| 1877 } | 1876 } |
| 1878 | 1877 |
| 1879 | 1878 |
| 1880 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid, | 1879 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid, |
| 1881 int num_arguments, | 1880 int num_arguments) { |
| 1882 int result_size) { | 1881 TailCallExternalReference(ExternalReference(fid, isolate()), num_arguments); |
| 1883 TailCallExternalReference(ExternalReference(fid, isolate()), | |
| 1884 num_arguments, | |
| 1885 result_size); | |
| 1886 } | 1882 } |
| 1887 | 1883 |
| 1888 | 1884 |
| 1889 void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) { | 1885 void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) { |
| 1890 // Set the entry point and jump to the C entry runtime stub. | 1886 // Set the entry point and jump to the C entry runtime stub. |
| 1891 mov(ebx, Immediate(ext)); | 1887 mov(ebx, Immediate(ext)); |
| 1892 CEntryStub ces(isolate(), 1); | 1888 CEntryStub ces(isolate(), 1); |
| 1893 jmp(ces.GetCode(), RelocInfo::CODE_TARGET); | 1889 jmp(ces.GetCode(), RelocInfo::CODE_TARGET); |
| 1894 } | 1890 } |
| 1895 | 1891 |
| (...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2965 mov(eax, dividend); | 2961 mov(eax, dividend); |
| 2966 shr(eax, 31); | 2962 shr(eax, 31); |
| 2967 add(edx, eax); | 2963 add(edx, eax); |
| 2968 } | 2964 } |
| 2969 | 2965 |
| 2970 | 2966 |
| 2971 } // namespace internal | 2967 } // namespace internal |
| 2972 } // namespace v8 | 2968 } // namespace v8 |
| 2973 | 2969 |
| 2974 #endif // V8_TARGET_ARCH_X87 | 2970 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |