Home | History | Annotate | Download | only in s390
      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 #ifndef V8_S390_FRAME_CONSTANTS_S390_H_
      6 #define V8_S390_FRAME_CONSTANTS_S390_H_
      7 
      8 #include "src/base/macros.h"
      9 #include "src/frame-constants.h"
     10 
     11 namespace v8 {
     12 namespace internal {
     13 
     14 class EntryFrameConstants : public AllStatic {
     15  public:
     16   static constexpr int kCallerFPOffset =
     17       -(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
     18 };
     19 
     20 class ExitFrameConstants : public TypedFrameConstants {
     21  public:
     22   static constexpr int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
     23   static constexpr int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1);
     24   DEFINE_TYPED_FRAME_SIZES(2);
     25 
     26   // The caller fields are below the frame pointer on the stack.
     27   static constexpr int kCallerFPOffset = 0 * kPointerSize;
     28   // The calling JS function is below FP.
     29   static constexpr int kCallerPCOffset = 1 * kPointerSize;
     30 
     31   // FP-relative displacement of the caller's SP.  It points just
     32   // below the saved PC.
     33   static constexpr int kCallerSPDisplacement = 2 * kPointerSize;
     34 };
     35 
     36 class WasmCompileLazyFrameConstants : public TypedFrameConstants {
     37  public:
     38   static constexpr int kNumberOfSavedGpParamRegs = 5;
     39 #ifdef V8_TARGET_ARCH_S390X
     40   static constexpr int kNumberOfSavedFpParamRegs = 4;
     41 #else
     42   static constexpr int kNumberOfSavedFpParamRegs = 2;
     43 #endif
     44 
     45   // FP-relative.
     46   static constexpr int kWasmInstanceOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0);
     47   static constexpr int kFixedFrameSizeFromFp =
     48       TypedFrameConstants::kFixedFrameSizeFromFp +
     49       kNumberOfSavedGpParamRegs * kPointerSize +
     50       kNumberOfSavedFpParamRegs * kDoubleSize;
     51 };
     52 
     53 class JavaScriptFrameConstants : public AllStatic {
     54  public:
     55   // FP-relative.
     56   static constexpr int kLocal0Offset =
     57       StandardFrameConstants::kExpressionsOffset;
     58   static constexpr int kLastParameterOffset = +2 * kPointerSize;
     59   static constexpr int kFunctionOffset =
     60       StandardFrameConstants::kFunctionOffset;
     61 
     62   // Caller SP-relative.
     63   static constexpr int kParam0Offset = -2 * kPointerSize;
     64   static constexpr int kReceiverOffset = -1 * kPointerSize;
     65 };
     66 
     67 }  // namespace internal
     68 }  // namespace v8
     69 
     70 #endif  // V8_S390_FRAME_CONSTANTS_S390_H_
     71