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

Side by Side Diff: src/arm/lithium-arm.h

Issue 10878073: First steps towards named Litihium operands. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « no previous file | src/arm/lithium-codegen-arm.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } 253 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
254 254
255 void MarkAsCall() { is_call_ = true; } 255 void MarkAsCall() { is_call_ = true; }
256 256
257 // Interface to the register allocator and iterators. 257 // Interface to the register allocator and iterators.
258 bool IsMarkedAsCall() const { return is_call_; } 258 bool IsMarkedAsCall() const { return is_call_; }
259 259
260 virtual bool HasResult() const = 0; 260 virtual bool HasResult() const = 0;
261 virtual LOperand* result() = 0; 261 virtual LOperand* result() = 0;
262 262
263 virtual int InputCount() = 0;
264 virtual LOperand* InputAt(int i) = 0;
265 virtual int TempCount() = 0; 263 virtual int TempCount() = 0;
266 virtual LOperand* TempAt(int i) = 0; 264 virtual LOperand* TempAt(int i) = 0;
267 265
268 LOperand* FirstInput() { return InputAt(0); } 266 LOperand* FirstInput() { return InputAt(0); }
269 LOperand* Output() { return HasResult() ? result() : NULL; } 267 LOperand* Output() { return HasResult() ? result() : NULL; }
270 268
271 #ifdef DEBUG 269 #ifdef DEBUG
272 void VerifyCall(); 270 void VerifyCall();
273 #endif 271 #endif
274 272
275 private: 273 private:
274 // Iterator support.
275 friend class InputIterator;
276 virtual int InputCount() = 0;
277 virtual LOperand* InputAt(int i) = 0;
278
276 LEnvironment* environment_; 279 LEnvironment* environment_;
277 SetOncePointer<LPointerMap> pointer_map_; 280 SetOncePointer<LPointerMap> pointer_map_;
278 HValue* hydrogen_value_; 281 HValue* hydrogen_value_;
279 bool is_call_; 282 bool is_call_;
280 }; 283 };
281 284
282 285
283 // R = number of result operands (0 or 1). 286 // R = number of result operands (0 or 1).
284 // I = number of input operands. 287 // I = number of input operands.
285 // T = number of temporary operands. 288 // T = number of temporary operands.
286 template<int R, int I, int T> 289 template<int R, int I, int T>
287 class LTemplateInstruction: public LInstruction { 290 class LTemplateInstruction: public LInstruction {
288 public: 291 public:
289 // Allow 0 or 1 output operands. 292 // Allow 0 or 1 output operands.
290 STATIC_ASSERT(R == 0 || R == 1); 293 STATIC_ASSERT(R == 0 || R == 1);
291 virtual bool HasResult() const { return R != 0; } 294 virtual bool HasResult() const { return R != 0; }
292 void set_result(LOperand* operand) { results_[0] = operand; } 295 void set_result(LOperand* operand) { results_[0] = operand; }
293 LOperand* result() { return results_[0]; } 296 LOperand* result() { return results_[0]; }
294 297
295 int InputCount() { return I; }
296 LOperand* InputAt(int i) { return inputs_[i]; } 298 LOperand* InputAt(int i) { return inputs_[i]; }
297 299
298 int TempCount() { return T; } 300 int TempCount() { return T; }
299 LOperand* TempAt(int i) { return temps_[i]; } 301 LOperand* TempAt(int i) { return temps_[i]; }
300 302
301 protected: 303 protected:
302 EmbeddedContainer<LOperand*, R> results_; 304 EmbeddedContainer<LOperand*, R> results_;
303 EmbeddedContainer<LOperand*, I> inputs_; 305 EmbeddedContainer<LOperand*, I> inputs_;
304 EmbeddedContainer<LOperand*, T> temps_; 306 EmbeddedContainer<LOperand*, T> temps_;
307
308 private:
309 virtual int InputCount() { return I; }
305 }; 310 };
306 311
307 312
308 class LGap: public LTemplateInstruction<0, 0, 0> { 313 class LGap: public LTemplateInstruction<0, 0, 0> {
309 public: 314 public:
310 explicit LGap(HBasicBlock* block) 315 explicit LGap(HBasicBlock* block)
311 : block_(block) { 316 : block_(block) {
312 parallel_moves_[BEFORE] = NULL; 317 parallel_moves_[BEFORE] = NULL;
313 parallel_moves_[START] = NULL; 318 parallel_moves_[START] = NULL;
314 parallel_moves_[END] = NULL; 319 parallel_moves_[END] = NULL;
(...skipping 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2423 2428
2424 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2429 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2425 }; 2430 };
2426 2431
2427 #undef DECLARE_HYDROGEN_ACCESSOR 2432 #undef DECLARE_HYDROGEN_ACCESSOR
2428 #undef DECLARE_CONCRETE_INSTRUCTION 2433 #undef DECLARE_CONCRETE_INSTRUCTION
2429 2434
2430 } } // namespace v8::internal 2435 } } // namespace v8::internal
2431 2436
2432 #endif // V8_ARM_LITHIUM_ARM_H_ 2437 #endif // V8_ARM_LITHIUM_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698