Index: src/mips/simulator-mips.cc |
diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc |
index aa4224a54c23fe7ab002d6f75a7faa7f72f5970d..c81dcd1d00ad32bcf7a34986b00b22c6b1fdf8cc 100644 |
--- a/src/mips/simulator-mips.cc |
+++ b/src/mips/simulator-mips.cc |
@@ -16,6 +16,7 @@ |
#include "src/mips/constants-mips.h" |
#include "src/mips/simulator-mips.h" |
#include "src/ostreams.h" |
+#include "src/runtime/runtime-utils.h" |
// Only build the simulator if not compiling for real MIPS hardware. |
@@ -1970,6 +1971,10 @@ typedef int64_t (*SimulatorRuntimeCall)(int32_t arg0, |
int32_t arg4, |
int32_t arg5); |
+typedef ObjectTriple (*SimulatorRuntimeTripleCall)(int32_t arg0, int32_t arg1, |
+ int32_t arg2, int32_t arg3, |
+ int32_t arg4); |
+ |
// These prototypes handle the four types of FP calls. |
typedef int64_t (*SimulatorRuntimeCompareCall)(double darg0, double darg1); |
typedef double (*SimulatorRuntimeFPFPCall)(double darg0, double darg1); |
@@ -2181,6 +2186,26 @@ void Simulator::SoftwareInterrupt(Instruction* instr) { |
SimulatorRuntimeProfilingGetterCall target = |
reinterpret_cast<SimulatorRuntimeProfilingGetterCall>(external); |
target(arg0, arg1, Redirection::ReverseRedirection(arg2)); |
+ } else if (redirection->type() == ExternalReference::BUILTIN_CALL_TRIPLE) { |
+ // builtin call returning ObjectTriple. |
+ SimulatorRuntimeTripleCall target = |
+ reinterpret_cast<SimulatorRuntimeTripleCall>(external); |
+ if (::v8::internal::FLAG_trace_sim) { |
+ PrintF( |
+ "Call to host triple returning runtime function %p " |
+ "args %08x, %08x, %08x, %08x, %08x\n", |
+ FUNCTION_ADDR(target), arg1, arg2, arg3, arg4, arg5); |
+ } |
+ // arg0 is a hidden argument pointing to the return location, so don't |
+ // pass it to the target function. |
+ ObjectTriple result = target(arg1, arg2, arg3, arg4, arg5); |
+ if (::v8::internal::FLAG_trace_sim) { |
+ PrintF("Returned { %p, %p, %p }\n", result.x, result.y, result.z); |
+ } |
+ // Return is passed back in address pointed to by hidden first argument. |
+ ObjectTriple* sim_result = reinterpret_cast<ObjectTriple*>(arg0); |
+ *sim_result = result; |
+ set_register(v0, arg0); |
} else { |
SimulatorRuntimeCall target = |
reinterpret_cast<SimulatorRuntimeCall>(external); |