File: linkage-s390.cc

package info (click to toggle)
nodejs 4.8.2~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 62,476 kB
  • ctags: 111,183
  • sloc: cpp: 661,544; ansic: 31,406; python: 23,073; makefile: 1,418; sh: 1,384; perl: 255; lisp: 222; ruby: 76; xml: 50
file content (78 lines) | stat: -rw-r--r-- 2,782 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright 2015 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/assembler.h"
#include "src/code-stubs.h"
#include "src/compiler/linkage.h"
#include "src/compiler/linkage-impl.h"
#include "src/zone.h"

namespace v8 {
namespace internal {
namespace compiler {

struct S390LinkageHelperTraits {
  static Register ReturnValueReg() { return r2; }
  static Register ReturnValue2Reg() { return r3; }
  // TODO(Tara): Confirm if the JSCallFunctionReg = r3 is correct
  static Register JSCallFunctionReg() { return r3; }
  static Register ContextReg() { return cp; }
  static Register RuntimeCallFunctionReg() { return r3; }
  static Register RuntimeCallArgCountReg() { return r2; }
  static RegList CCalleeSaveRegisters() {
    return r6.bit() | r7.bit() | r8.bit() | r9.bit() | r10.bit() |
           fp.bit() | ip.bit() | r13.bit() | sp.bit();
  }
  static RegList CCalleeSaveFPRegisters() {
#if V8_TARGET_ARCH_S390X
    return d8.bit() | d9.bit() | d10.bit() |
      d11.bit() | d12.bit() | d13.bit() | d14.bit() | d15.bit();
#else
    return d2.bit() | d4.bit();
#endif
  }
  static Register CRegisterParameter(int i) {
    static Register register_parameters[] = {r2, r3, r4, r5, r6};
    return register_parameters[i];
  }
  static int CRegisterParametersLength() { return 5; }
  static int CStackBackingStoreLength() { return 0; }
};


typedef LinkageHelper<S390LinkageHelperTraits> LH;

CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr,
                                             int parameter_count,
                                             CallDescriptor::Flags flags) {
  return LH::GetJSCallDescriptor(zone, is_osr, parameter_count, flags);
}


CallDescriptor* Linkage::GetRuntimeCallDescriptor(
    Zone* zone, Runtime::FunctionId function, int parameter_count,
    Operator::Properties properties) {
  return LH::GetRuntimeCallDescriptor(zone, function, parameter_count,
                                      properties);
}


CallDescriptor* Linkage::GetStubCallDescriptor(
    Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
    int stack_parameter_count, CallDescriptor::Flags flags,
    Operator::Properties properties, MachineType return_type) {
  return LH::GetStubCallDescriptor(isolate, zone, descriptor,
                                   stack_parameter_count, flags, properties,
                                   return_type);
}


CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone,
                                                  const MachineSignature* sig) {
  return LH::GetSimplifiedCDescriptor(zone, sig);
}

}  // namespace compiler
}  // namespace internal
}  // namespace v8