| 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 #include <stdarg.h> | 5 #include <stdarg.h> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_ARM | 9 #if V8_TARGET_ARCH_ARM |
| 10 | 10 |
| (...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1801 int64_t iresult = 0; // integer return value | 1801 int64_t iresult = 0; // integer return value |
| 1802 double dresult = 0; // double return value | 1802 double dresult = 0; // double return value |
| 1803 GetFpArgs(&dval0, &dval1, &ival); | 1803 GetFpArgs(&dval0, &dval1, &ival); |
| 1804 if (::v8::internal::FLAG_trace_sim || !stack_aligned) { | 1804 if (::v8::internal::FLAG_trace_sim || !stack_aligned) { |
| 1805 SimulatorRuntimeCall generic_target = | 1805 SimulatorRuntimeCall generic_target = |
| 1806 reinterpret_cast<SimulatorRuntimeCall>(external); | 1806 reinterpret_cast<SimulatorRuntimeCall>(external); |
| 1807 switch (redirection->type()) { | 1807 switch (redirection->type()) { |
| 1808 case ExternalReference::BUILTIN_FP_FP_CALL: | 1808 case ExternalReference::BUILTIN_FP_FP_CALL: |
| 1809 case ExternalReference::BUILTIN_COMPARE_CALL: | 1809 case ExternalReference::BUILTIN_COMPARE_CALL: |
| 1810 PrintF("Call to host function at %p with args %f, %f", | 1810 PrintF("Call to host function at %p with args %f, %f", |
| 1811 FUNCTION_ADDR(generic_target), dval0, dval1); | 1811 static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0, |
| 1812 dval1); |
| 1812 break; | 1813 break; |
| 1813 case ExternalReference::BUILTIN_FP_CALL: | 1814 case ExternalReference::BUILTIN_FP_CALL: |
| 1814 PrintF("Call to host function at %p with arg %f", | 1815 PrintF("Call to host function at %p with arg %f", |
| 1815 FUNCTION_ADDR(generic_target), dval0); | 1816 static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0); |
| 1816 break; | 1817 break; |
| 1817 case ExternalReference::BUILTIN_FP_INT_CALL: | 1818 case ExternalReference::BUILTIN_FP_INT_CALL: |
| 1818 PrintF("Call to host function at %p with args %f, %d", | 1819 PrintF("Call to host function at %p with args %f, %d", |
| 1819 FUNCTION_ADDR(generic_target), dval0, ival); | 1820 static_cast<void*>(FUNCTION_ADDR(generic_target)), dval0, |
| 1821 ival); |
| 1820 break; | 1822 break; |
| 1821 default: | 1823 default: |
| 1822 UNREACHABLE(); | 1824 UNREACHABLE(); |
| 1823 break; | 1825 break; |
| 1824 } | 1826 } |
| 1825 if (!stack_aligned) { | 1827 if (!stack_aligned) { |
| 1826 PrintF(" with unaligned stack %08x\n", get_register(sp)); | 1828 PrintF(" with unaligned stack %08x\n", get_register(sp)); |
| 1827 } | 1829 } |
| 1828 PrintF("\n"); | 1830 PrintF("\n"); |
| 1829 } | 1831 } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1935 target(arg0, arg1, Redirection::ReverseRedirection(arg2)); | 1937 target(arg0, arg1, Redirection::ReverseRedirection(arg2)); |
| 1936 } else if (redirection->type() == | 1938 } else if (redirection->type() == |
| 1937 ExternalReference::BUILTIN_CALL_TRIPLE) { | 1939 ExternalReference::BUILTIN_CALL_TRIPLE) { |
| 1938 // builtin call returning ObjectTriple. | 1940 // builtin call returning ObjectTriple. |
| 1939 SimulatorRuntimeTripleCall target = | 1941 SimulatorRuntimeTripleCall target = |
| 1940 reinterpret_cast<SimulatorRuntimeTripleCall>(external); | 1942 reinterpret_cast<SimulatorRuntimeTripleCall>(external); |
| 1941 if (::v8::internal::FLAG_trace_sim || !stack_aligned) { | 1943 if (::v8::internal::FLAG_trace_sim || !stack_aligned) { |
| 1942 PrintF( | 1944 PrintF( |
| 1943 "Call to host triple returning runtime function %p " | 1945 "Call to host triple returning runtime function %p " |
| 1944 "args %08x, %08x, %08x, %08x, %08x", | 1946 "args %08x, %08x, %08x, %08x, %08x", |
| 1945 FUNCTION_ADDR(target), arg1, arg2, arg3, arg4, arg5); | 1947 static_cast<void*>(FUNCTION_ADDR(target)), arg1, arg2, arg3, arg4, |
| 1948 arg5); |
| 1946 if (!stack_aligned) { | 1949 if (!stack_aligned) { |
| 1947 PrintF(" with unaligned stack %08x\n", get_register(sp)); | 1950 PrintF(" with unaligned stack %08x\n", get_register(sp)); |
| 1948 } | 1951 } |
| 1949 PrintF("\n"); | 1952 PrintF("\n"); |
| 1950 } | 1953 } |
| 1951 CHECK(stack_aligned); | 1954 CHECK(stack_aligned); |
| 1952 // arg0 is a hidden argument pointing to the return location, so don't | 1955 // arg0 is a hidden argument pointing to the return location, so don't |
| 1953 // pass it to the target function. | 1956 // pass it to the target function. |
| 1954 ObjectTriple result = target(arg1, arg2, arg3, arg4, arg5); | 1957 ObjectTriple result = target(arg1, arg2, arg3, arg4, arg5); |
| 1955 if (::v8::internal::FLAG_trace_sim) { | 1958 if (::v8::internal::FLAG_trace_sim) { |
| 1956 PrintF("Returned { %p, %p, %p }\n", result.x, result.y, result.z); | 1959 PrintF("Returned { %p, %p, %p }\n", static_cast<void*>(result.x), |
| 1960 static_cast<void*>(result.y), static_cast<void*>(result.z)); |
| 1957 } | 1961 } |
| 1958 // Return is passed back in address pointed to by hidden first argument. | 1962 // Return is passed back in address pointed to by hidden first argument. |
| 1959 ObjectTriple* sim_result = reinterpret_cast<ObjectTriple*>(arg0); | 1963 ObjectTriple* sim_result = reinterpret_cast<ObjectTriple*>(arg0); |
| 1960 *sim_result = result; | 1964 *sim_result = result; |
| 1961 set_register(r0, arg0); | 1965 set_register(r0, arg0); |
| 1962 } else { | 1966 } else { |
| 1963 // builtin call. | 1967 // builtin call. |
| 1964 DCHECK(redirection->type() == ExternalReference::BUILTIN_CALL || | 1968 DCHECK(redirection->type() == ExternalReference::BUILTIN_CALL || |
| 1965 redirection->type() == ExternalReference::BUILTIN_CALL_PAIR); | 1969 redirection->type() == ExternalReference::BUILTIN_CALL_PAIR); |
| 1966 SimulatorRuntimeCall target = | 1970 SimulatorRuntimeCall target = |
| 1967 reinterpret_cast<SimulatorRuntimeCall>(external); | 1971 reinterpret_cast<SimulatorRuntimeCall>(external); |
| 1968 if (::v8::internal::FLAG_trace_sim || !stack_aligned) { | 1972 if (::v8::internal::FLAG_trace_sim || !stack_aligned) { |
| 1969 PrintF( | 1973 PrintF( |
| 1970 "Call to host function at %p " | 1974 "Call to host function at %p " |
| 1971 "args %08x, %08x, %08x, %08x, %08x, %08x", | 1975 "args %08x, %08x, %08x, %08x, %08x, %08x", |
| 1972 FUNCTION_ADDR(target), | 1976 static_cast<void*>(FUNCTION_ADDR(target)), arg0, arg1, arg2, arg3, |
| 1973 arg0, | 1977 arg4, arg5); |
| 1974 arg1, | |
| 1975 arg2, | |
| 1976 arg3, | |
| 1977 arg4, | |
| 1978 arg5); | |
| 1979 if (!stack_aligned) { | 1978 if (!stack_aligned) { |
| 1980 PrintF(" with unaligned stack %08x\n", get_register(sp)); | 1979 PrintF(" with unaligned stack %08x\n", get_register(sp)); |
| 1981 } | 1980 } |
| 1982 PrintF("\n"); | 1981 PrintF("\n"); |
| 1983 } | 1982 } |
| 1984 CHECK(stack_aligned); | 1983 CHECK(stack_aligned); |
| 1985 int64_t result = target(arg0, arg1, arg2, arg3, arg4, arg5); | 1984 int64_t result = target(arg0, arg1, arg2, arg3, arg4, arg5); |
| 1986 int32_t lo_res = static_cast<int32_t>(result); | 1985 int32_t lo_res = static_cast<int32_t>(result); |
| 1987 int32_t hi_res = static_cast<int32_t>(result >> 32); | 1986 int32_t hi_res = static_cast<int32_t>(result >> 32); |
| 1988 if (::v8::internal::FLAG_trace_sim) { | 1987 if (::v8::internal::FLAG_trace_sim) { |
| (...skipping 2326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4315 set_register(sp, current_sp + sizeof(uintptr_t)); | 4314 set_register(sp, current_sp + sizeof(uintptr_t)); |
| 4316 return address; | 4315 return address; |
| 4317 } | 4316 } |
| 4318 | 4317 |
| 4319 } // namespace internal | 4318 } // namespace internal |
| 4320 } // namespace v8 | 4319 } // namespace v8 |
| 4321 | 4320 |
| 4322 #endif // USE_SIMULATOR | 4321 #endif // USE_SIMULATOR |
| 4323 | 4322 |
| 4324 #endif // V8_TARGET_ARCH_ARM | 4323 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |