OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1769 if (!stack_aligned) { | 1769 if (!stack_aligned) { |
1770 PrintF(" with unaligned stack %08x\n", get_register(sp)); | 1770 PrintF(" with unaligned stack %08x\n", get_register(sp)); |
1771 } | 1771 } |
1772 PrintF("\n"); | 1772 PrintF("\n"); |
1773 } | 1773 } |
1774 CHECK(stack_aligned); | 1774 CHECK(stack_aligned); |
1775 v8::Handle<v8::Value> result = target(arg0); | 1775 v8::Handle<v8::Value> result = target(arg0); |
1776 if (::v8::internal::FLAG_trace_sim) { | 1776 if (::v8::internal::FLAG_trace_sim) { |
1777 PrintF("Returned %p\n", reinterpret_cast<void *>(*result)); | 1777 PrintF("Returned %p\n", reinterpret_cast<void *>(*result)); |
1778 } | 1778 } |
1779 set_register(r0, (int32_t) *result); | 1779 set_register(r0, reinterpret_cast<int32_t>(*result)); |
1780 } else if (redirection->type() == ExternalReference::DIRECT_GETTER_CALL) { | 1780 } else if (redirection->type() == ExternalReference::DIRECT_GETTER_CALL) { |
1781 SimulatorRuntimeDirectGetterCall target = | 1781 SimulatorRuntimeDirectGetterCall target = |
1782 reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external); | 1782 reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external); |
1783 if (::v8::internal::FLAG_trace_sim || !stack_aligned) { | 1783 if (::v8::internal::FLAG_trace_sim || !stack_aligned) { |
1784 PrintF("Call to host function at %p args %08x %08x", | 1784 PrintF("Call to host function at %p args %08x %08x", |
1785 FUNCTION_ADDR(target), arg0, arg1); | 1785 FUNCTION_ADDR(target), arg0, arg1); |
1786 if (!stack_aligned) { | 1786 if (!stack_aligned) { |
1787 PrintF(" with unaligned stack %08x\n", get_register(sp)); | 1787 PrintF(" with unaligned stack %08x\n", get_register(sp)); |
1788 } | 1788 } |
1789 PrintF("\n"); | 1789 PrintF("\n"); |
1790 } | 1790 } |
1791 CHECK(stack_aligned); | 1791 CHECK(stack_aligned); |
1792 v8::Handle<v8::Value> result = target(arg0, arg1); | 1792 v8::Handle<v8::Value> result = target(arg0, arg1); |
1793 if (::v8::internal::FLAG_trace_sim) { | 1793 if (::v8::internal::FLAG_trace_sim) { |
1794 PrintF("Returned %p\n", reinterpret_cast<void *>(*result)); | 1794 PrintF("Returned %p\n", reinterpret_cast<void *>(*result)); |
1795 } | 1795 } |
1796 set_register(r0, (int32_t) *result); | 1796 set_register(r0, reinterpret_cast<int32_t>(*result)); |
1797 } else { | 1797 } else { |
1798 // builtin call. | 1798 // builtin call. |
1799 ASSERT(redirection->type() == ExternalReference::BUILTIN_CALL); | 1799 ASSERT(redirection->type() == ExternalReference::BUILTIN_CALL); |
1800 SimulatorRuntimeCall target = | 1800 SimulatorRuntimeCall target = |
1801 reinterpret_cast<SimulatorRuntimeCall>(external); | 1801 reinterpret_cast<SimulatorRuntimeCall>(external); |
1802 if (::v8::internal::FLAG_trace_sim || !stack_aligned) { | 1802 if (::v8::internal::FLAG_trace_sim || !stack_aligned) { |
1803 PrintF( | 1803 PrintF( |
1804 "Call to host function at %p" | 1804 "Call to host function at %p" |
1805 "args %08x, %08x, %08x, %08x, %08x, %08x", | 1805 "args %08x, %08x, %08x, %08x, %08x, %08x", |
1806 FUNCTION_ADDR(target), | 1806 FUNCTION_ADDR(target), |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3076 } else { | 3076 } else { |
3077 bool unsigned_integer = (instr->Bit(7) == 0); | 3077 bool unsigned_integer = (instr->Bit(7) == 0); |
3078 | 3078 |
3079 int dst = instr->VFPDRegValue(src_precision); | 3079 int dst = instr->VFPDRegValue(src_precision); |
3080 int src = instr->VFPMRegValue(kSinglePrecision); | 3080 int src = instr->VFPMRegValue(kSinglePrecision); |
3081 | 3081 |
3082 int val = get_sinteger_from_s_register(src); | 3082 int val = get_sinteger_from_s_register(src); |
3083 | 3083 |
3084 if (src_precision == kDoublePrecision) { | 3084 if (src_precision == kDoublePrecision) { |
3085 if (unsigned_integer) { | 3085 if (unsigned_integer) { |
3086 set_d_register_from_double(dst, | 3086 set_d_register_from_double( |
3087 static_cast<double>((uint32_t)val)); | 3087 dst, static_cast<double>(reinterpret_cast<uint32_t>(val))); |
Michael Starzinger
2013/01/07 14:36:31
Shouldn't this be a static_cast?
| |
3088 } else { | 3088 } else { |
3089 set_d_register_from_double(dst, static_cast<double>(val)); | 3089 set_d_register_from_double(dst, static_cast<double>(val)); |
3090 } | 3090 } |
3091 } else { | 3091 } else { |
3092 if (unsigned_integer) { | 3092 if (unsigned_integer) { |
3093 set_s_register_from_float(dst, | 3093 set_s_register_from_float( |
3094 static_cast<float>((uint32_t)val)); | 3094 dst, static_cast<float>(reinterpret_cast<uint32_t>(val))); |
Michael Starzinger
2013/01/07 14:36:31
Likewise.
| |
3095 } else { | 3095 } else { |
3096 set_s_register_from_float(dst, static_cast<float>(val)); | 3096 set_s_register_from_float(dst, static_cast<float>(val)); |
3097 } | 3097 } |
3098 } | 3098 } |
3099 } | 3099 } |
3100 } | 3100 } |
3101 | 3101 |
3102 | 3102 |
3103 // void Simulator::DecodeType6CoprocessorIns(Instruction* instr) | 3103 // void Simulator::DecodeType6CoprocessorIns(Instruction* instr) |
3104 // Decode Type 6 coprocessor instructions. | 3104 // Decode Type 6 coprocessor instructions. |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3432 uintptr_t address = *stack_slot; | 3432 uintptr_t address = *stack_slot; |
3433 set_register(sp, current_sp + sizeof(uintptr_t)); | 3433 set_register(sp, current_sp + sizeof(uintptr_t)); |
3434 return address; | 3434 return address; |
3435 } | 3435 } |
3436 | 3436 |
3437 } } // namespace v8::internal | 3437 } } // namespace v8::internal |
3438 | 3438 |
3439 #endif // USE_SIMULATOR | 3439 #endif // USE_SIMULATOR |
3440 | 3440 |
3441 #endif // V8_TARGET_ARCH_ARM | 3441 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |