Home | History | Annotate | Download | only in arm64
      1 // Copyright 2013 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 #include "src/frame-constants.h"
      6 
      7 #if V8_TARGET_ARCH_ARM64
      8 
      9 #include "src/arm64/assembler-arm64-inl.h"
     10 #include "src/arm64/assembler-arm64.h"
     11 #include "src/assembler.h"
     12 
     13 #include "src/arm64/frame-constants-arm64.h"
     14 
     15 namespace v8 {
     16 namespace internal {
     17 
     18 Register JavaScriptFrame::fp_register() { return v8::internal::fp; }
     19 Register JavaScriptFrame::context_register() { return cp; }
     20 Register JavaScriptFrame::constant_pool_pointer_register() { UNREACHABLE(); }
     21 
     22 int InterpreterFrameConstants::RegisterStackSlotCount(int register_count) {
     23   // Round up to a multiple of two, to make the frame a multiple of 16 bytes.
     24   return RoundUp(register_count, 2);
     25 }
     26 
     27 int BuiltinContinuationFrameConstants::PaddingSlotCount(int register_count) {
     28   // Round the total slot count up to a multiple of two, to make the frame a
     29   // multiple of 16 bytes.
     30   int slot_count = kFixedSlotCount + register_count;
     31   int rounded_slot_count = RoundUp(slot_count, 2);
     32   return rounded_slot_count - slot_count;
     33 }
     34 
     35 }  // namespace internal
     36 }  // namespace v8
     37 
     38 #endif  // V8_TARGET_ARCH_ARM64
     39