OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_ARM64) |
| 7 |
| 8 #include "vm/assembler.h" |
| 9 #include "vm/cpu.h" |
| 10 #include "vm/longjump.h" |
| 11 #include "vm/runtime_entry.h" |
| 12 #include "vm/simulator.h" |
| 13 #include "vm/stack_frame.h" |
| 14 #include "vm/stub_code.h" |
| 15 |
| 16 // An extra check since we are assuming the existence of /proc/cpuinfo below. |
| 17 #if !defined(USING_SIMULATOR) && !defined(__linux__) && !defined(ANDROID) |
| 18 #error ARM64 cross-compile only supported on Linux |
| 19 #endif |
| 20 |
| 21 namespace dart { |
| 22 |
| 23 DEFINE_FLAG(bool, print_stop_message, true, "Print stop message."); |
| 24 DECLARE_FLAG(bool, inline_alloc); |
| 25 |
| 26 |
| 27 void Assembler::InitializeMemoryWithBreakpoints(uword data, intptr_t length) { |
| 28 ASSERT(Utils::IsAligned(data, 4)); |
| 29 ASSERT(Utils::IsAligned(length, 4)); |
| 30 const uword end = data + length; |
| 31 while (data < end) { |
| 32 *reinterpret_cast<int32_t*>(data) = Instr::kBreakPointInstruction; |
| 33 data += 4; |
| 34 } |
| 35 } |
| 36 |
| 37 |
| 38 void Assembler::Stop(const char* message) { |
| 39 UNIMPLEMENTED(); |
| 40 } |
| 41 |
| 42 |
| 43 void Assembler::Emit(int32_t value) { |
| 44 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 45 buffer_.Emit<int32_t>(value); |
| 46 } |
| 47 |
| 48 |
| 49 static const char* cpu_reg_names[kNumberOfCpuRegisters] = { |
| 50 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", |
| 51 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", |
| 52 "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", |
| 53 "r24", "ip0", "ip1", "pp", "ctx", "fp", "lr", "r31", |
| 54 }; |
| 55 |
| 56 |
| 57 const char* Assembler::RegisterName(Register reg) { |
| 58 ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters)); |
| 59 return cpu_reg_names[reg]; |
| 60 } |
| 61 |
| 62 |
| 63 static const char* fpu_reg_names[kNumberOfFpuRegisters] = { |
| 64 "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", |
| 65 "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15", |
| 66 "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", |
| 67 "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", |
| 68 }; |
| 69 |
| 70 |
| 71 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 72 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); |
| 73 return fpu_reg_names[reg]; |
| 74 } |
| 75 |
| 76 } // namespace dart |
| 77 |
| 78 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |