v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
constants-ppc.cc
Go to the documentation of this file.
1// Copyright 2014 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#if V8_TARGET_ARCH_PPC64
6
8
10
11namespace v8 {
12namespace internal {
13
15 WritableJitAllocation* jit_allocation) {
16 if (jit_allocation) {
17 jit_allocation->WriteUnalignedValue(reinterpret_cast<Address>(this), value);
18 } else {
19 *reinterpret_cast<Instr*>(this) = value;
20 }
21}
22
23// These register names are defined in a way to match the native disassembler
24// formatting. See for example the command "objdump -d <binary file>".
25const char* Registers::names_[kNumRegisters] = {
26 "r0", "sp", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",
27 "r11", "ip", "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", "r21",
28 "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", "r30", "fp"};
29
31 "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "d10",
32 "d11", "d12", "d13", "d14", "d15", "d16", "d17", "d18", "d19", "d20", "d21",
33 "d22", "d23", "d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31"};
34
35int DoubleRegisters::Number(const char* name) {
36 for (int i = 0; i < kNumDoubleRegisters; i++) {
37 if (strcmp(names_[i], name) == 0) {
38 return i;
39 }
40 }
41
42 // No register with the requested name found.
43 return kNoRegister;
44}
45
46int Registers::Number(const char* name) {
47 // Look through the canonical names.
48 for (int i = 0; i < kNumRegisters; i++) {
49 if (strcmp(names_[i], name) == 0) {
50 return i;
51 }
52 }
53
54 // No register with the requested name found.
55 return kNoRegister;
56}
57} // namespace internal
58} // namespace v8
59
60#endif // V8_TARGET_ARCH_PPC64
static const char * names_[kNumDoubleRegisters]
static int Number(const char *name)
V8_EXPORT_PRIVATE void SetInstructionBits(Instr value, WritableJitAllocation *jit_allocation=nullptr)
static const char * names_[kNumRegisters]
static int Number(const char *name)
const int kNumDoubleRegisters
constexpr int kNoRegister
constexpr int kNumRegisters