OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include <setjmp.h> // NOLINT | 5 #include <setjmp.h> // NOLINT |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
9 #if defined(TARGET_ARCH_ARM64) | 9 #if defined(TARGET_ARCH_ARM64) |
10 | 10 |
(...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1596 typedef void (*SimulatorNativeCall)(NativeArguments* arguments, uword target); | 1596 typedef void (*SimulatorNativeCall)(NativeArguments* arguments, uword target); |
1597 | 1597 |
1598 | 1598 |
1599 void Simulator::DoRedirectedCall(Instr* instr) { | 1599 void Simulator::DoRedirectedCall(Instr* instr) { |
1600 SimulatorSetjmpBuffer buffer(this); | 1600 SimulatorSetjmpBuffer buffer(this); |
1601 if (!setjmp(buffer.buffer_)) { | 1601 if (!setjmp(buffer.buffer_)) { |
1602 int64_t saved_lr = get_register(LR); | 1602 int64_t saved_lr = get_register(LR); |
1603 Redirection* redirection = Redirection::FromHltInstruction(instr); | 1603 Redirection* redirection = Redirection::FromHltInstruction(instr); |
1604 uword external = redirection->external_function(); | 1604 uword external = redirection->external_function(); |
1605 if (IsTracingExecution()) { | 1605 if (IsTracingExecution()) { |
1606 OS::Print("Call to host function at 0x%" Pd "\n", external); | 1606 THR_Print("Call to host function at 0x%" Pd "\n", external); |
1607 } | 1607 } |
1608 | 1608 |
1609 if ((redirection->call_kind() == kRuntimeCall) || | 1609 if ((redirection->call_kind() == kRuntimeCall) || |
1610 (redirection->call_kind() == kBootstrapNativeCall) || | 1610 (redirection->call_kind() == kBootstrapNativeCall) || |
1611 (redirection->call_kind() == kNativeCall)) { | 1611 (redirection->call_kind() == kNativeCall)) { |
1612 // Set the top_exit_frame_info of this simulator to the native stack. | 1612 // Set the top_exit_frame_info of this simulator to the native stack. |
1613 set_top_exit_frame_info(Thread::GetCurrentStackPointer()); | 1613 set_top_exit_frame_info(Thread::GetCurrentStackPointer()); |
1614 } | 1614 } |
1615 if (redirection->call_kind() == kRuntimeCall) { | 1615 if (redirection->call_kind() == kRuntimeCall) { |
1616 NativeArguments* arguments = | 1616 NativeArguments* arguments = |
(...skipping 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3399 } else { | 3399 } else { |
3400 UnimplementedInstruction(instr); | 3400 UnimplementedInstruction(instr); |
3401 } | 3401 } |
3402 } | 3402 } |
3403 | 3403 |
3404 | 3404 |
3405 // Executes the current instruction. | 3405 // Executes the current instruction. |
3406 void Simulator::InstructionDecode(Instr* instr) { | 3406 void Simulator::InstructionDecode(Instr* instr) { |
3407 pc_modified_ = false; | 3407 pc_modified_ = false; |
3408 if (IsTracingExecution()) { | 3408 if (IsTracingExecution()) { |
3409 OS::Print("%" Pu64 " ", icount_); | 3409 THR_Print("%" Pu64 " ", icount_); |
3410 const uword start = reinterpret_cast<uword>(instr); | 3410 const uword start = reinterpret_cast<uword>(instr); |
3411 const uword end = start + Instr::kInstrSize; | 3411 const uword end = start + Instr::kInstrSize; |
3412 if (FLAG_support_disassembler) { | 3412 if (FLAG_support_disassembler) { |
3413 Disassembler::Disassemble(start, end); | 3413 Disassembler::Disassemble(start, end); |
3414 } else { | 3414 } else { |
3415 OS::Print("Disassembler not supported in this mode.\n"); | 3415 THR_Print("Disassembler not supported in this mode.\n"); |
3416 } | 3416 } |
3417 } | 3417 } |
3418 | 3418 |
3419 if (instr->IsDPImmediateOp()) { | 3419 if (instr->IsDPImmediateOp()) { |
3420 DecodeDPImmediate(instr); | 3420 DecodeDPImmediate(instr); |
3421 } else if (instr->IsCompareBranchOp()) { | 3421 } else if (instr->IsCompareBranchOp()) { |
3422 DecodeCompareBranch(instr); | 3422 DecodeCompareBranch(instr); |
3423 } else if (instr->IsLoadStoreOp()) { | 3423 } else if (instr->IsLoadStoreOp()) { |
3424 DecodeLoadStore(instr); | 3424 DecodeLoadStore(instr); |
3425 } else if (instr->IsDPRegisterOp()) { | 3425 } else if (instr->IsDPRegisterOp()) { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3605 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); | 3605 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); |
3606 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); | 3606 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); |
3607 buf->Longjmp(); | 3607 buf->Longjmp(); |
3608 } | 3608 } |
3609 | 3609 |
3610 } // namespace dart | 3610 } // namespace dart |
3611 | 3611 |
3612 #endif // !defined(USING_SIMULATOR) | 3612 #endif // !defined(USING_SIMULATOR) |
3613 | 3613 |
3614 #endif // defined TARGET_ARCH_ARM64 | 3614 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |