blob: e11dfabb11f8fa5e27d06477808745243159bce3 [file] [log] [blame]
lrn@chromium.org7516f052011-03-30 08:52:27 +00001// Copyright 2011 the V8 project authors. All rights reserved.
2// Redistribution and use in source and binary forms, with or without
3// modification, are permitted provided that the following conditions are
4// met:
5//
6// * Redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer.
8// * Redistributions in binary form must reproduce the above
9// copyright notice, this list of conditions and the following
10// disclaimer in the documentation and/or other materials provided
11// with the distribution.
12// * Neither the name of Google Inc. nor the names of its
13// contributors may be used to endorse or promote products derived
14// from this software without specific prior written permission.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28#ifndef V8_MIPS_LITHIUM_MIPS_H_
29#define V8_MIPS_LITHIUM_MIPS_H_
30
31#include "hydrogen.h"
32#include "lithium-allocator.h"
33#include "lithium.h"
34#include "safepoint-table.h"
35
36// Note: this file was taken from the X64 version. ARM has a partially working
37// lithium implementation, but for now it is not ported to mips.
38
39namespace v8 {
40namespace internal {
41
42// Forward declarations.
43class LCodeGen;
44class LEnvironment;
45class Translation;
46
47class LInstruction: public ZoneObject {
48 public:
49 LInstruction() { }
50 virtual ~LInstruction() { }
51
52 // Predicates should be generated by macro as in lithium-ia32.h.
53 virtual bool IsLabel() const {
54 UNIMPLEMENTED();
55 return false;
56 }
57 virtual bool IsOsrEntry() const {
58 UNIMPLEMENTED();
59 return false;
60 }
61
62 LPointerMap* pointer_map() const {
63 UNIMPLEMENTED();
64 return NULL;
65 }
66
67 bool HasPointerMap() const {
68 UNIMPLEMENTED();
69 return false;
70 }
71
72 void set_environment(LEnvironment* env) { UNIMPLEMENTED(); }
73
74 LEnvironment* environment() const {
75 UNIMPLEMENTED();
76 return NULL;
77 }
78
79 bool HasEnvironment() const {
80 UNIMPLEMENTED();
81 return NULL;
82 }
83
84 virtual void PrintTo(StringStream* stream) const { UNIMPLEMENTED(); }
85
86 virtual bool IsControl() const {
87 UNIMPLEMENTED();
88 return false;
89 }
90
91 void MarkAsCall() { UNIMPLEMENTED(); }
92 void MarkAsSaveDoubles() { UNIMPLEMENTED(); }
93
94 // Interface to the register allocator and iterators.
95 bool IsMarkedAsCall() const {
96 UNIMPLEMENTED();
97 return false;
98 }
99
100 bool IsMarkedAsSaveDoubles() const {
101 UNIMPLEMENTED();
102 return false;
103 }
104
105 virtual bool HasResult() const {
106 UNIMPLEMENTED();
107 return false;
108 }
109
110 virtual LOperand* result() {
111 UNIMPLEMENTED();
112 return NULL;
113 }
114
115 virtual int InputCount() {
116 UNIMPLEMENTED();
117 return 0;
118 }
119
120 virtual LOperand* InputAt(int i) {
121 UNIMPLEMENTED();
122 return NULL;
123 }
124
125 virtual int TempCount() {
126 UNIMPLEMENTED();
127 return 0;
128 }
129
130 virtual LOperand* TempAt(int i) {
131 UNIMPLEMENTED();
132 return NULL;
133 }
134
135 LOperand* FirstInput() {
136 UNIMPLEMENTED();
137 return NULL;
138 }
139
140 LOperand* Output() {
141 UNIMPLEMENTED();
142 return NULL;
143 }
144
145#ifdef DEBUG
146 void VerifyCall() { UNIMPLEMENTED(); }
147#endif
148};
149
150
151class LGap: public LInstruction {
152 public:
153 explicit LGap(HBasicBlock* block) { }
154
155 HBasicBlock* block() const {
156 UNIMPLEMENTED();
157 return NULL;
158 }
159
160 enum InnerPosition {
161 BEFORE,
162 START,
163 END,
164 AFTER,
165 FIRST_INNER_POSITION = BEFORE,
166 LAST_INNER_POSITION = AFTER
167 };
168
169 LParallelMove* GetOrCreateParallelMove(InnerPosition pos) {
170 UNIMPLEMENTED();
171 return NULL;
172 }
173
174 LParallelMove* GetParallelMove(InnerPosition pos) {
175 UNIMPLEMENTED();
176 return NULL;
177 }
178};
179
180
181class LLabel: public LGap {
182 public:
183 explicit LLabel(HBasicBlock* block) : LGap(block) { }
184};
185
186
187class LOsrEntry: public LInstruction {
188 public:
189 // Function could be generated by a macro as in lithium-ia32.h.
190 static LOsrEntry* cast(LInstruction* instr) {
191 UNIMPLEMENTED();
192 return NULL;
193 }
194
195 LOperand** SpilledRegisterArray() {
196 UNIMPLEMENTED();
197 return NULL;
198 }
199 LOperand** SpilledDoubleRegisterArray() {
200 UNIMPLEMENTED();
201 return NULL;
202 }
203
204 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand) {
205 UNIMPLEMENTED();
206 }
207 void MarkSpilledDoubleRegister(int allocation_index,
208 LOperand* spill_operand) {
209 UNIMPLEMENTED();
210 }
211};
212
213
214class LChunk: public ZoneObject {
215 public:
216 explicit LChunk(CompilationInfo* info, HGraph* graph) { }
217
218 HGraph* graph() const {
219 UNIMPLEMENTED();
220 return NULL;
221 }
222
223 CompilationInfo* info() const { return NULL; }
224
225 const ZoneList<LPointerMap*>* pointer_maps() const {
226 UNIMPLEMENTED();
227 return NULL;
228 }
229
230 LOperand* GetNextSpillSlot(bool double_slot) {
231 UNIMPLEMENTED();
232 return NULL;
233 }
234
235 LConstantOperand* DefineConstantOperand(HConstant* constant) {
236 UNIMPLEMENTED();
237 return NULL;
238 }
239
240 LLabel* GetLabel(int block_id) const {
241 UNIMPLEMENTED();
242 return NULL;
243 }
244
245 const ZoneList<LInstruction*>* instructions() const {
246 UNIMPLEMENTED();
247 return NULL;
248 }
249
250 int GetParameterStackSlot(int index) const {
251 UNIMPLEMENTED();
252 return 0;
253 }
254
255 void AddGapMove(int index, LOperand* from, LOperand* to) { UNIMPLEMENTED(); }
256
257 LGap* GetGapAt(int index) const {
258 UNIMPLEMENTED();
259 return NULL;
260 }
261
262 bool IsGapAt(int index) const {
263 UNIMPLEMENTED();
264 return false;
265 }
266
267 int NearestGapPos(int index) const {
268 UNIMPLEMENTED();
269 return 0;
270 }
271
272 void MarkEmptyBlocks() { UNIMPLEMENTED(); }
273
274#ifdef DEBUG
275 void Verify() { UNIMPLEMENTED(); }
276#endif
277};
278
279
280class LChunkBuilder BASE_EMBEDDED {
281 public:
282 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) { }
283
284 // Build the sequence for the graph.
285 LChunk* Build() {
286 UNIMPLEMENTED();
287 return NULL;
288 };
289
290 // Declare methods that deal with the individual node types.
291#define DECLARE_DO(type) LInstruction* Do##type(H##type* node) { \
292 UNIMPLEMENTED(); \
293 return NULL; \
294 }
295 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
296#undef DECLARE_DO
297
298 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
299};
300
301
302} } // namespace v8::internal
303
304#endif // V8_MIPS_LITHIUM_MIPS_H_