lithium-mips.h revision 257744e915dfc84d6d07a6b2accf8402d9ffc708
1// 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 false; 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(HGraph* graph) { } 217 218 HGraph* graph() const { 219 UNIMPLEMENTED(); 220 return NULL; 221 } 222 223 const ZoneList<LPointerMap*>* pointer_maps() const { 224 UNIMPLEMENTED(); 225 return NULL; 226 } 227 228 LOperand* GetNextSpillSlot(bool double_slot) { 229 UNIMPLEMENTED(); 230 return NULL; 231 } 232 233 LConstantOperand* DefineConstantOperand(HConstant* constant) { 234 UNIMPLEMENTED(); 235 return NULL; 236 } 237 238 LLabel* GetLabel(int block_id) const { 239 UNIMPLEMENTED(); 240 return NULL; 241 } 242 243 const ZoneList<LInstruction*>* instructions() const { 244 UNIMPLEMENTED(); 245 return NULL; 246 } 247 248 int GetParameterStackSlot(int index) const { 249 UNIMPLEMENTED(); 250 return 0; 251 } 252 253 void AddGapMove(int index, LOperand* from, LOperand* to) { UNIMPLEMENTED(); } 254 255 LGap* GetGapAt(int index) const { 256 UNIMPLEMENTED(); 257 return NULL; 258 } 259 260 bool IsGapAt(int index) const { 261 UNIMPLEMENTED(); 262 return false; 263 } 264 265 int NearestGapPos(int index) const { 266 UNIMPLEMENTED(); 267 return 0; 268 } 269 270 void MarkEmptyBlocks() { UNIMPLEMENTED(); } 271 272 CompilationInfo* info() const { 273 UNIMPLEMENTED(); 274 return NULL; 275 } 276 277#ifdef DEBUG 278 void Verify() { UNIMPLEMENTED(); } 279#endif 280}; 281 282 283class LChunkBuilder BASE_EMBEDDED { 284 public: 285 LChunkBuilder(CompilationInfo*&, HGraph* graph, LAllocator* allocator) { } 286 287 // Build the sequence for the graph. 288 LChunk* Build() { 289 UNIMPLEMENTED(); 290 return NULL; 291 }; 292 293 // Declare methods that deal with the individual node types. 294#define DECLARE_DO(type) LInstruction* Do##type(H##type* node) { \ 295 UNIMPLEMENTED(); \ 296 return NULL; \ 297 } 298 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) 299#undef DECLARE_DO 300 301 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 302}; 303 304 305} } // namespace v8::internal 306 307#endif // V8_MIPS_LITHIUM_MIPS_H_ 308