9dcd0857d6
Before this CL, various code stubs used different techniques for marking their frames to enable stack-crawling and other access to data in the frame. All of them were based on a abuse of the "standard" frame representation, e.g. storing the a context pointer immediately below the frame's fp, and a function pointer after that. Although functional, this approach tends to make stubs and builtins do an awkward, unnecessary dance to appear like standard frames, even if they have nothing to do with JavaScript execution. This CL attempts to improve this by: * Ensuring that there are only two fundamentally different types of frames, a "standard" frame and a "typed" frame. Standard frames, as before, contain both a context and function pointer. Typed frames contain only a minimum of a smi marker in the position immediately below the fp where the context is in standard frames. * Only interpreted, full codegen, and optimized Crankshaft and TurboFan JavaScript frames use the "standard" format. All other frames use the type frame format with an explicit marker. * Typed frames can contain one or more values below the type marker. There is new magic macro machinery in frames.h that simplifies defining the offsets of these fields in typed frames. * A new flag in the CallDescriptor enables specifying whether a frame is a standard frame or a typed frame. Secondary register location spilling is now only enabled for standard frames. * A zillion places in the code have been updated to deal with the fact that most code stubs and internal frames use the typed frame format. This includes changes in the deoptimizer, debugger, and liveedit. * StandardFrameConstants::kMarkerOffset is deprecated, (CommonFrameConstants::kContextOrFrameTypeOffset and StandardFrameConstants::kFrameOffset are now used in its stead). LOG=N Review URL: https://codereview.chromium.org/1696043002 Cr-Commit-Position: refs/heads/master@{#34571}
65 lines
2.0 KiB
C++
65 lines
2.0 KiB
C++
// Copyright 2013 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "src/arm64/assembler-arm64.h"
|
|
#include "src/arm64/constants-arm64.h"
|
|
|
|
#ifndef V8_ARM64_FRAMES_ARM64_H_
|
|
#define V8_ARM64_FRAMES_ARM64_H_
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
|
|
const int kNumRegs = kNumberOfRegisters;
|
|
// Registers x0-x17 are caller-saved.
|
|
const int kNumJSCallerSaved = 18;
|
|
const RegList kJSCallerSaved = 0x3ffff;
|
|
|
|
// Number of registers for which space is reserved in safepoints. Must be a
|
|
// multiple of eight.
|
|
// TODO(all): Refine this number.
|
|
const int kNumSafepointRegisters = 32;
|
|
|
|
// Define the list of registers actually saved at safepoints.
|
|
// Note that the number of saved registers may be smaller than the reserved
|
|
// space, i.e. kNumSafepointSavedRegisters <= kNumSafepointRegisters.
|
|
#define kSafepointSavedRegisters CPURegList::GetSafepointSavedRegisters().list()
|
|
#define kNumSafepointSavedRegisters \
|
|
CPURegList::GetSafepointSavedRegisters().Count();
|
|
|
|
class EntryFrameConstants : public AllStatic {
|
|
public:
|
|
static const int kCallerFPOffset =
|
|
-(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
|
|
};
|
|
|
|
class ExitFrameConstants : public TypedFrameConstants {
|
|
public:
|
|
static const int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
|
|
static const int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
|
|
DEFINE_TYPED_FRAME_SIZES(2);
|
|
static const int kLastExitFrameField = kCodeOffset;
|
|
|
|
static const int kConstantPoolOffset = 0; // Not used
|
|
};
|
|
|
|
|
|
class JavaScriptFrameConstants : public AllStatic {
|
|
public:
|
|
// FP-relative.
|
|
static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset;
|
|
|
|
// There are two words on the stack (saved fp and saved lr) between fp and
|
|
// the arguments.
|
|
static const int kLastParameterOffset = 2 * kPointerSize;
|
|
|
|
static const int kFunctionOffset = StandardFrameConstants::kFunctionOffset;
|
|
};
|
|
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|
|
|
|
#endif // V8_ARM64_FRAMES_ARM64_H_
|