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

Side by Side Diff: src/ia32/lithium-ia32.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/arm/lithium-arm.h ('k') | src/mips/lithium-mips.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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 bool ClobbersRegisters() const { return is_call_; } 264 bool ClobbersRegisters() const { return is_call_; }
265 virtual bool ClobbersDoubleRegisters() const { 265 virtual bool ClobbersDoubleRegisters() const {
266 return is_call_ || 266 return is_call_ ||
267 (!CpuFeatures::IsSupported(SSE2) && 267 (!CpuFeatures::IsSupported(SSE2) &&
268 // We only have rudimentary X87Stack tracking, thus in general 268 // We only have rudimentary X87Stack tracking, thus in general
269 // cannot handle deoptimization nor phi-nodes. 269 // cannot handle deoptimization nor phi-nodes.
270 (HasEnvironment() || IsControl())); 270 (HasEnvironment() || IsControl()));
271 } 271 }
272 272
273 virtual bool HasResult() const = 0; 273 virtual bool HasResult() const = 0;
274 virtual LOperand* result() = 0; 274 virtual LOperand* result() const = 0;
275 275
276 bool HasDoubleRegisterResult(); 276 bool HasDoubleRegisterResult();
277 bool HasDoubleRegisterInput(); 277 bool HasDoubleRegisterInput();
278 bool IsDoubleInput(X87Register reg, LCodeGen* cgen); 278 bool IsDoubleInput(X87Register reg, LCodeGen* cgen);
279 279
280 LOperand* FirstInput() { return InputAt(0); } 280 LOperand* FirstInput() { return InputAt(0); }
281 LOperand* Output() { return HasResult() ? result() : NULL; } 281 LOperand* Output() { return HasResult() ? result() : NULL; }
282 282
283 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } 283 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; }
284 284
(...skipping 19 matching lines...) Expand all
304 304
305 305
306 // R = number of result operands (0 or 1). 306 // R = number of result operands (0 or 1).
307 // I = number of input operands. 307 // I = number of input operands.
308 // T = number of temporary operands. 308 // T = number of temporary operands.
309 template<int R, int I, int T> 309 template<int R, int I, int T>
310 class LTemplateInstruction: public LInstruction { 310 class LTemplateInstruction: public LInstruction {
311 public: 311 public:
312 // Allow 0 or 1 output operands. 312 // Allow 0 or 1 output operands.
313 STATIC_ASSERT(R == 0 || R == 1); 313 STATIC_ASSERT(R == 0 || R == 1);
314 virtual bool HasResult() const { return R != 0; } 314 virtual bool HasResult() const { return R != 0 && result() != NULL; }
315 void set_result(LOperand* operand) { results_[0] = operand; } 315 void set_result(LOperand* operand) { results_[0] = operand; }
316 LOperand* result() { return results_[0]; } 316 LOperand* result() const { return results_[0]; }
317 317
318 protected: 318 protected:
319 EmbeddedContainer<LOperand*, R> results_; 319 EmbeddedContainer<LOperand*, R> results_;
320 EmbeddedContainer<LOperand*, I> inputs_; 320 EmbeddedContainer<LOperand*, I> inputs_;
321 EmbeddedContainer<LOperand*, T> temps_; 321 EmbeddedContainer<LOperand*, T> temps_;
322 322
323 private: 323 private:
324 // Iterator support. 324 // Iterator support.
325 virtual int InputCount() { return I; } 325 virtual int InputCount() { return I; }
326 virtual LOperand* InputAt(int i) { return inputs_[i]; } 326 virtual LOperand* InputAt(int i) { return inputs_[i]; }
(...skipping 2613 matching lines...) Expand 10 before | Expand all | Expand 10 after
2940 2940
2941 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2941 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2942 }; 2942 };
2943 2943
2944 #undef DECLARE_HYDROGEN_ACCESSOR 2944 #undef DECLARE_HYDROGEN_ACCESSOR
2945 #undef DECLARE_CONCRETE_INSTRUCTION 2945 #undef DECLARE_CONCRETE_INSTRUCTION
2946 2946
2947 } } // namespace v8::internal 2947 } } // namespace v8::internal
2948 2948
2949 #endif // V8_IA32_LITHIUM_IA32_H_ 2949 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/mips/lithium-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698