Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: src/compiler/machine-type.h

Issue 515173002: Add MachineSignature, which is an encapsulation of the machine types for parameters and return valu… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/machine-operator.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_MACHINE_TYPE_H_ 5 #ifndef V8_COMPILER_MACHINE_TYPE_H_
6 #define V8_COMPILER_MACHINE_TYPE_H_ 6 #define V8_COMPILER_MACHINE_TYPE_H_
7 7
8 #include "src/globals.h" 8 #include "src/globals.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 case kRepFloat64: 101 case kRepFloat64:
102 return 8; 102 return 8;
103 case kRepTagged: 103 case kRepTagged:
104 return kPointerSize; 104 return kPointerSize;
105 default: 105 default:
106 UNREACHABLE(); 106 UNREACHABLE();
107 return kPointerSize; 107 return kPointerSize;
108 } 108 }
109 } 109 }
110 110
111 // Describes the inputs and outputs of a function or call in terms of machine
112 // types.
113 class MachineSignature {
114 public:
115 MachineSignature(uint8_t return_count, uint16_t param_count,
116 MachineType* reps)
117 : return_count_(return_count), param_count_(param_count), reps_(reps) {}
118
119 int GetReturnCount() const { return return_count_; }
120 int GetParamCount() const { return param_count_; }
121
122 MachineType GetParameterType(int index) const {
123 DCHECK(index >= 0 && index < param_count_);
124 return reps_[return_count_ + index];
125 }
126
127 MachineType GetReturnType(int index = 0) const {
128 DCHECK(index >= 0 && index < return_count_);
129 return reps_[index];
130 }
131
132 protected:
133 uint8_t return_count_;
134 uint16_t param_count_;
135 MachineType* reps_;
136 };
111 } // namespace compiler 137 } // namespace compiler
112 } // namespace internal 138 } // namespace internal
113 } // namespace v8 139 } // namespace v8
114 140
115 #endif // V8_COMPILER_MACHINE_TYPE_H_ 141 #endif // V8_COMPILER_MACHINE_TYPE_H_
OLDNEW
« no previous file with comments | « src/compiler/machine-operator.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698