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

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

Issue 21037004: Fix HasResult method of LTemplateInstruction to properly handle LCheckSmi (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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/mips/lithium-mips.h ('k') | no next file » | 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 bool ClobbersTemps() const { return is_call_; } 259 bool ClobbersTemps() const { return is_call_; }
260 bool ClobbersRegisters() const { return is_call_; } 260 bool ClobbersRegisters() const { return is_call_; }
261 bool ClobbersDoubleRegisters() const { return is_call_; } 261 bool ClobbersDoubleRegisters() const { return is_call_; }
262 262
263 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } 263 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
264 264
265 // Interface to the register allocator and iterators. 265 // Interface to the register allocator and iterators.
266 bool IsMarkedAsCall() const { return is_call_; } 266 bool IsMarkedAsCall() const { return is_call_; }
267 267
268 virtual bool HasResult() const = 0; 268 virtual bool HasResult() const = 0;
269 virtual LOperand* result() = 0; 269 virtual LOperand* result() const = 0;
270 270
271 LOperand* FirstInput() { return InputAt(0); } 271 LOperand* FirstInput() { return InputAt(0); }
272 LOperand* Output() { return HasResult() ? result() : NULL; } 272 LOperand* Output() { return HasResult() ? result() : NULL; }
273 273
274 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } 274 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; }
275 275
276 #ifdef DEBUG 276 #ifdef DEBUG
277 void VerifyCall(); 277 void VerifyCall();
278 #endif 278 #endif
279 279
(...skipping 15 matching lines...) Expand all
295 295
296 296
297 // R = number of result operands (0 or 1). 297 // R = number of result operands (0 or 1).
298 // I = number of input operands. 298 // I = number of input operands.
299 // T = number of temporary operands. 299 // T = number of temporary operands.
300 template<int R, int I, int T> 300 template<int R, int I, int T>
301 class LTemplateInstruction: public LInstruction { 301 class LTemplateInstruction: public LInstruction {
302 public: 302 public:
303 // Allow 0 or 1 output operands. 303 // Allow 0 or 1 output operands.
304 STATIC_ASSERT(R == 0 || R == 1); 304 STATIC_ASSERT(R == 0 || R == 1);
305 virtual bool HasResult() const { return R != 0; } 305 virtual bool HasResult() const { return R != 0 && result() != NULL; }
306 void set_result(LOperand* operand) { results_[0] = operand; } 306 void set_result(LOperand* operand) { results_[0] = operand; }
307 LOperand* result() { return results_[0]; } 307 LOperand* result() const { return results_[0]; }
308 308
309 protected: 309 protected:
310 EmbeddedContainer<LOperand*, R> results_; 310 EmbeddedContainer<LOperand*, R> results_;
311 EmbeddedContainer<LOperand*, I> inputs_; 311 EmbeddedContainer<LOperand*, I> inputs_;
312 EmbeddedContainer<LOperand*, T> temps_; 312 EmbeddedContainer<LOperand*, T> temps_;
313 313
314 private: 314 private:
315 // Iterator support. 315 // Iterator support.
316 virtual int InputCount() { return I; } 316 virtual int InputCount() { return I; }
317 virtual LOperand* InputAt(int i) { return inputs_[i]; } 317 virtual LOperand* InputAt(int i) { return inputs_[i]; }
(...skipping 2388 matching lines...) Expand 10 before | Expand all | Expand 10 after
2706 2706
2707 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2707 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2708 }; 2708 };
2709 2709
2710 #undef DECLARE_HYDROGEN_ACCESSOR 2710 #undef DECLARE_HYDROGEN_ACCESSOR
2711 #undef DECLARE_CONCRETE_INSTRUCTION 2711 #undef DECLARE_CONCRETE_INSTRUCTION
2712 2712
2713 } } // namespace v8::int 2713 } } // namespace v8::int
2714 2714
2715 #endif // V8_X64_LITHIUM_X64_H_ 2715 #endif // V8_X64_LITHIUM_X64_H_
OLDNEW
« no previous file with comments | « src/mips/lithium-mips.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698