v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
frames-arm64.h
Go to the documentation of this file.
1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #include "arm64/constants-arm64.h"
29 #include "arm64/assembler-arm64.h"
30 
31 #ifndef V8_ARM64_FRAMES_ARM64_H_
32 #define V8_ARM64_FRAMES_ARM64_H_
33 
34 namespace v8 {
35 namespace internal {
36 
37 const int kNumRegs = kNumberOfRegisters;
38 // Registers x0-x17 are caller-saved.
39 const int kNumJSCallerSaved = 18;
40 const RegList kJSCallerSaved = 0x3ffff;
42 
43 // Number of registers for which space is reserved in safepoints. Must be a
44 // multiple of eight.
45 // TODO(all): Refine this number.
46 const int kNumSafepointRegisters = 32;
47 
48 // Define the list of registers actually saved at safepoints.
49 // Note that the number of saved registers may be smaller than the reserved
50 // space, i.e. kNumSafepointSavedRegisters <= kNumSafepointRegisters.
51 #define kSafepointSavedRegisters CPURegList::GetSafepointSavedRegisters().list()
52 #define kNumSafepointSavedRegisters \
53  CPURegList::GetSafepointSavedRegisters().Count();
54 
55 class EntryFrameConstants : public AllStatic {
56  public:
57  static const int kCallerFPOffset =
59 };
60 
61 
62 class ExitFrameConstants : public AllStatic {
63  public:
64  static const int kFrameSize = 2 * kPointerSize;
65 
66  static const int kCallerSPDisplacement = 2 * kPointerSize;
67  static const int kCallerPCOffset = 1 * kPointerSize;
68  static const int kCallerFPOffset = 0 * kPointerSize; // <- fp
69  static const int kSPOffset = -1 * kPointerSize;
70  static const int kCodeOffset = -2 * kPointerSize;
71  static const int kLastExitFrameField = kCodeOffset;
72 
73  static const int kConstantPoolOffset = 0; // Not used
74 };
75 
76 
77 class JavaScriptFrameConstants : public AllStatic {
78  public:
79  // FP-relative.
81 
82  // There are two words on the stack (saved fp and saved lr) between fp and
83  // the arguments.
84  static const int kLastParameterOffset = 2 * kPointerSize;
85 
87 };
88 
89 
90 class ArgumentsAdaptorFrameConstants : public AllStatic {
91  public:
92  // FP-relative.
94 
95  static const int kFrameSize =
97 };
98 
99 
100 class ConstructFrameConstants : public AllStatic {
101  public:
102  // FP-relative.
104  static const int kLengthOffset = -4 * kPointerSize;
105  static const int kConstructorOffset = -5 * kPointerSize;
106  static const int kImplicitReceiverOffset = -6 * kPointerSize;
107 
108  static const int kFrameSize =
110 };
111 
112 
113 class InternalFrameConstants : public AllStatic {
114  public:
115  // FP-relative.
117 };
118 
119 
120 inline Object* JavaScriptFrame::function_slot_object() const {
122  return Memory::Object_at(fp() + offset);
123 }
124 
125 
126 inline void StackHandler::SetFp(Address slot, Address fp) {
127  Memory::Address_at(slot) = fp;
128 }
129 
130 
131 } } // namespace v8::internal
132 
133 #endif // V8_ARM64_FRAMES_ARM64_H_
byte * Address
Definition: globals.h:186
static const int kImplicitReceiverOffset
Definition: frames-arm.h:157
static Object *& Object_at(Address addr)
Definition: v8memory.h:83
static const int kFixedFrameSize
Definition: frames.h:181
kSerializedDataOffset Object
Definition: objects-inl.h:5016
uint32_t RegList
Definition: frames.h:41
const RegList kJSCallerSaved
Definition: frames-arm.h:47
static const int kCallerPCOffset
Definition: frames-arm.h:123
static const int kCallerFPOffset
Definition: frames-arm.h:121
const int kPointerSize
Definition: globals.h:268
static Address & Address_at(Address addr)
Definition: v8memory.h:79
const int kNumJSCallerSaved
Definition: frames-arm.h:53
static const int kMarkerOffset
Definition: frames.h:184
static const int kExpressionsOffset
Definition: frames.h:183
static const int kCallerSPDisplacement
Definition: frames-arm.h:127
const unsigned kNumberOfRegisters
static const int kFixedFrameSizeFromFp
Definition: frames.h:180
static const int kCallerFPOffset
Definition: frames-arm.h:105
const int kNumSafepointRegisters
Definition: frames-arm.h:92
static const int kLastExitFrameField
Definition: frames-arm64.h:71
Object * JSCallerSavedBuffer[kNumJSCallerSaved]
Definition: frames-arm.h:55
const Register fp
const int kNumRegs
Definition: frames-arm.h:43
static const int kConstantPoolOffset
Definition: frames-arm.h:115