OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 } | 1538 } |
1539 } else if (redirection->type() == ExternalReference::DIRECT_API_CALL) { | 1539 } else if (redirection->type() == ExternalReference::DIRECT_API_CALL) { |
1540 // See DirectCEntryStub::GenerateCall for explanation of register usage. | 1540 // See DirectCEntryStub::GenerateCall for explanation of register usage. |
1541 SimulatorRuntimeDirectApiCall target = | 1541 SimulatorRuntimeDirectApiCall target = |
1542 reinterpret_cast<SimulatorRuntimeDirectApiCall>(external); | 1542 reinterpret_cast<SimulatorRuntimeDirectApiCall>(external); |
1543 if (::v8::internal::FLAG_trace_sim) { | 1543 if (::v8::internal::FLAG_trace_sim) { |
1544 PrintF("Call to host function at %p args %08x\n", | 1544 PrintF("Call to host function at %p args %08x\n", |
1545 FUNCTION_ADDR(target), arg1); | 1545 FUNCTION_ADDR(target), arg1); |
1546 } | 1546 } |
1547 v8::Handle<v8::Value> result = target(arg1); | 1547 v8::Handle<v8::Value> result = target(arg1); |
1548 *(reinterpret_cast<int*>(arg0)) = (int32_t) *result; | 1548 *(reinterpret_cast<int*>(arg0)) = reinterpret_cast<int32_t>(*result); |
1549 set_register(v0, arg0); | 1549 set_register(v0, arg0); |
1550 } else if (redirection->type() == ExternalReference::DIRECT_GETTER_CALL) { | 1550 } else if (redirection->type() == ExternalReference::DIRECT_GETTER_CALL) { |
1551 // See DirectCEntryStub::GenerateCall for explanation of register usage. | 1551 // See DirectCEntryStub::GenerateCall for explanation of register usage. |
1552 SimulatorRuntimeDirectGetterCall target = | 1552 SimulatorRuntimeDirectGetterCall target = |
1553 reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external); | 1553 reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external); |
1554 if (::v8::internal::FLAG_trace_sim) { | 1554 if (::v8::internal::FLAG_trace_sim) { |
1555 PrintF("Call to host function at %p args %08x %08x\n", | 1555 PrintF("Call to host function at %p args %08x %08x\n", |
1556 FUNCTION_ADDR(target), arg1, arg2); | 1556 FUNCTION_ADDR(target), arg1, arg2); |
1557 } | 1557 } |
1558 v8::Handle<v8::Value> result = target(arg1, arg2); | 1558 v8::Handle<v8::Value> result = target(arg1, arg2); |
1559 *(reinterpret_cast<int*>(arg0)) = (int32_t) *result; | 1559 *(reinterpret_cast<int*>(arg0)) = reinterpret_cast<int32_t>(*result); |
1560 set_register(v0, arg0); | 1560 set_register(v0, arg0); |
1561 } else { | 1561 } else { |
1562 SimulatorRuntimeCall target = | 1562 SimulatorRuntimeCall target = |
1563 reinterpret_cast<SimulatorRuntimeCall>(external); | 1563 reinterpret_cast<SimulatorRuntimeCall>(external); |
1564 if (::v8::internal::FLAG_trace_sim) { | 1564 if (::v8::internal::FLAG_trace_sim) { |
1565 PrintF( | 1565 PrintF( |
1566 "Call to host function at %p " | 1566 "Call to host function at %p " |
1567 "args %08x, %08x, %08x, %08x, %08x, %08x\n", | 1567 "args %08x, %08x, %08x, %08x, %08x, %08x\n", |
1568 FUNCTION_ADDR(target), | 1568 FUNCTION_ADDR(target), |
1569 arg0, | 1569 arg0, |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2186 break; | 2186 break; |
2187 default: | 2187 default: |
2188 UNREACHABLE(); | 2188 UNREACHABLE(); |
2189 }; | 2189 }; |
2190 break; | 2190 break; |
2191 case L: | 2191 case L: |
2192 switch (instr->FunctionFieldRaw()) { | 2192 switch (instr->FunctionFieldRaw()) { |
2193 case CVT_D_L: // Mips32r2 instruction. | 2193 case CVT_D_L: // Mips32r2 instruction. |
2194 // Watch the signs here, we want 2 32-bit vals | 2194 // Watch the signs here, we want 2 32-bit vals |
2195 // to make a sign-64. | 2195 // to make a sign-64. |
2196 i64 = (uint32_t) get_fpu_register(fs_reg); | 2196 i64 = static_cast<uint32_t>(get_fpu_register(fs_reg)); |
2197 i64 |= ((int64_t) get_fpu_register(fs_reg + 1) << 32); | 2197 i64 |= static_cast<int64_t>(get_fpu_register(fs_reg + 1)) << 32; |
2198 set_fpu_register_double(fd_reg, static_cast<double>(i64)); | 2198 set_fpu_register_double(fd_reg, static_cast<double>(i64)); |
2199 break; | 2199 break; |
2200 case CVT_S_L: | 2200 case CVT_S_L: |
2201 UNIMPLEMENTED_MIPS(); | 2201 UNIMPLEMENTED_MIPS(); |
2202 break; | 2202 break; |
2203 default: | 2203 default: |
2204 UNREACHABLE(); | 2204 UNREACHABLE(); |
2205 } | 2205 } |
2206 break; | 2206 break; |
2207 case PS: | 2207 case PS: |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2883 } | 2883 } |
2884 | 2884 |
2885 | 2885 |
2886 #undef UNSUPPORTED | 2886 #undef UNSUPPORTED |
2887 | 2887 |
2888 } } // namespace v8::internal | 2888 } } // namespace v8::internal |
2889 | 2889 |
2890 #endif // USE_SIMULATOR | 2890 #endif // USE_SIMULATOR |
2891 | 2891 |
2892 #endif // V8_TARGET_ARCH_MIPS | 2892 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |