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

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

Issue 18041003: Implement X87 stack tracking and x87 multiplication (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 V(MathFloorOfDiv) \ 136 V(MathFloorOfDiv) \
137 V(MathLog) \ 137 V(MathLog) \
138 V(MathMinMax) \ 138 V(MathMinMax) \
139 V(MathPowHalf) \ 139 V(MathPowHalf) \
140 V(MathRound) \ 140 V(MathRound) \
141 V(MathSin) \ 141 V(MathSin) \
142 V(MathSqrt) \ 142 V(MathSqrt) \
143 V(MathTan) \ 143 V(MathTan) \
144 V(ModI) \ 144 V(ModI) \
145 V(MulI) \ 145 V(MulI) \
146 V(NegateNoSSE2D) \
147 V(NumberTagD) \ 146 V(NumberTagD) \
148 V(NumberTagI) \ 147 V(NumberTagI) \
149 V(NumberTagU) \ 148 V(NumberTagU) \
150 V(NumberUntagD) \ 149 V(NumberUntagD) \
151 V(OsrEntry) \ 150 V(OsrEntry) \
152 V(OuterContext) \ 151 V(OuterContext) \
153 V(Parameter) \ 152 V(Parameter) \
154 V(Power) \ 153 V(Power) \
155 V(Random) \ 154 V(Random) \
156 V(PushArgument) \ 155 V(PushArgument) \
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 HValue* hydrogen_value() const { return hydrogen_value_; } 259 HValue* hydrogen_value() const { return hydrogen_value_; }
261 260
262 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } 261 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
263 262
264 void MarkAsCall() { is_call_ = true; } 263 void MarkAsCall() { is_call_ = true; }
265 264
266 // Interface to the register allocator and iterators. 265 // Interface to the register allocator and iterators.
267 bool ClobbersTemps() const { return is_call_; } 266 bool ClobbersTemps() const { return is_call_; }
268 bool ClobbersRegisters() const { return is_call_; } 267 bool ClobbersRegisters() const { return is_call_; }
269 virtual bool ClobbersDoubleRegisters() const { 268 virtual bool ClobbersDoubleRegisters() const {
270 return is_call_ || !CpuFeatures::IsSupported(SSE2); 269 return is_call_ ||
270 (!CpuFeatures::IsSupported(SSE2) &&
271 // We only have rudimentary X87Stack tracking, thus in general
272 // cannot handle deoptimization nor phi-nodes.
273 (HasEnvironment() || IsControl()));
271 } 274 }
272 275
273 virtual bool HasResult() const = 0; 276 virtual bool HasResult() const = 0;
274 virtual LOperand* result() = 0; 277 virtual LOperand* result() = 0;
275 278
276 bool HasDoubleRegisterResult(); 279 bool HasDoubleRegisterResult();
277 bool HasDoubleRegisterInput(); 280 bool HasDoubleRegisterInput();
281 bool IsDoubleInput(X87Register reg, LCodeGen* cgen);
278 282
279 LOperand* FirstInput() { return InputAt(0); } 283 LOperand* FirstInput() { return InputAt(0); }
280 LOperand* Output() { return HasResult() ? result() : NULL; } 284 LOperand* Output() { return HasResult() ? result() : NULL; }
281 285
282 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } 286 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; }
283 287
284 #ifdef DEBUG 288 #ifdef DEBUG
285 void VerifyCall(); 289 void VerifyCall();
286 #endif 290 #endif
287 291
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 376
373 private: 377 private:
374 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; 378 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
375 HBasicBlock* block_; 379 HBasicBlock* block_;
376 }; 380 };
377 381
378 382
379 class LInstructionGap: public LGap { 383 class LInstructionGap: public LGap {
380 public: 384 public:
381 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } 385 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
382 virtual bool ClobbersDoubleRegisters() const { return false; }
383 386
384 virtual bool HasInterestingComment(LCodeGen* gen) const { 387 virtual bool HasInterestingComment(LCodeGen* gen) const {
385 return !IsRedundant(); 388 return !IsRedundant();
386 } 389 }
387 390
388 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") 391 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
389 }; 392 };
390 393
391 394
392 class LGoto: public LTemplateInstruction<0, 0, 0> { 395 class LGoto: public LTemplateInstruction<0, 0, 0> {
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 657
655 LOperand* left() { return inputs_[0]; } 658 LOperand* left() { return inputs_[0]; }
656 LOperand* right() { return inputs_[1]; } 659 LOperand* right() { return inputs_[1]; }
657 LOperand* temp() { return temps_[0]; } 660 LOperand* temp() { return temps_[0]; }
658 661
659 DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv, "math-floor-of-div") 662 DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv, "math-floor-of-div")
660 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 663 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
661 }; 664 };
662 665
663 666
664 class LNegateNoSSE2D: public LTemplateInstruction<1, 1, 0> {
665 public:
666 explicit LNegateNoSSE2D(LOperand* value) {
667 inputs_[0] = value;
668 }
669
670 LOperand* value() { return inputs_[0]; }
671
672 DECLARE_CONCRETE_INSTRUCTION(NegateNoSSE2D, "negate-no-sse2-d")
673 };
674
675
676 class LMulI: public LTemplateInstruction<1, 2, 1> { 667 class LMulI: public LTemplateInstruction<1, 2, 1> {
677 public: 668 public:
678 LMulI(LOperand* left, LOperand* right, LOperand* temp) { 669 LMulI(LOperand* left, LOperand* right, LOperand* temp) {
679 inputs_[0] = left; 670 inputs_[0] = left;
680 inputs_[1] = right; 671 inputs_[1] = right;
681 temps_[0] = temp; 672 temps_[0] = temp;
682 } 673 }
683 674
684 LOperand* left() { return inputs_[0]; } 675 LOperand* left() { return inputs_[0]; }
685 LOperand* right() { return inputs_[1]; } 676 LOperand* right() { return inputs_[1]; }
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); } 1207 Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); }
1217 }; 1208 };
1218 1209
1219 1210
1220 class LConstantD: public LTemplateInstruction<1, 0, 1> { 1211 class LConstantD: public LTemplateInstruction<1, 0, 1> {
1221 public: 1212 public:
1222 explicit LConstantD(LOperand* temp) { 1213 explicit LConstantD(LOperand* temp) {
1223 temps_[0] = temp; 1214 temps_[0] = temp;
1224 } 1215 }
1225 1216
1226 virtual bool ClobbersDoubleRegisters() const {
1227 return false;
1228 }
1229
1230 LOperand* temp() { return temps_[0]; } 1217 LOperand* temp() { return temps_[0]; }
1231 1218
1232 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") 1219 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
1233 DECLARE_HYDROGEN_ACCESSOR(Constant) 1220 DECLARE_HYDROGEN_ACCESSOR(Constant)
1234 1221
1235 double value() const { return hydrogen()->DoubleValue(); } 1222 double value() const { return hydrogen()->DoubleValue(); }
1236 }; 1223 };
1237 1224
1238 1225
1239 class LConstantT: public LTemplateInstruction<1, 0, 0> { 1226 class LConstantT: public LTemplateInstruction<1, 0, 0> {
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
2200 class LNumberUntagD: public LTemplateInstruction<1, 1, 1> { 2187 class LNumberUntagD: public LTemplateInstruction<1, 1, 1> {
2201 public: 2188 public:
2202 explicit LNumberUntagD(LOperand* value, LOperand* temp) { 2189 explicit LNumberUntagD(LOperand* value, LOperand* temp) {
2203 inputs_[0] = value; 2190 inputs_[0] = value;
2204 temps_[0] = temp; 2191 temps_[0] = temp;
2205 } 2192 }
2206 2193
2207 LOperand* value() { return inputs_[0]; } 2194 LOperand* value() { return inputs_[0]; }
2208 LOperand* temp() { return temps_[0]; } 2195 LOperand* temp() { return temps_[0]; }
2209 2196
2210 virtual bool ClobbersDoubleRegisters() const { 2197 virtual bool ClobbersDoubleRegisters() const { return false; }
2211 return false;
2212 }
2213 2198
2214 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") 2199 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
2215 DECLARE_HYDROGEN_ACCESSOR(Change); 2200 DECLARE_HYDROGEN_ACCESSOR(Change);
2216 }; 2201 };
2217 2202
2218 2203
2219 class LSmiUntag: public LTemplateInstruction<1, 1, 0> { 2204 class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
2220 public: 2205 public:
2221 LSmiUntag(LOperand* value, bool needs_check) 2206 LSmiUntag(LOperand* value, bool needs_check)
2222 : needs_check_(needs_check) { 2207 : needs_check_(needs_check) {
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
2878 bool is_unused() const { return status_ == UNUSED; } 2863 bool is_unused() const { return status_ == UNUSED; }
2879 bool is_building() const { return status_ == BUILDING; } 2864 bool is_building() const { return status_ == BUILDING; }
2880 bool is_done() const { return status_ == DONE; } 2865 bool is_done() const { return status_ == DONE; }
2881 bool is_aborted() const { return status_ == ABORTED; } 2866 bool is_aborted() const { return status_ == ABORTED; }
2882 2867
2883 void Abort(const char* reason); 2868 void Abort(const char* reason);
2884 2869
2885 // Methods for getting operands for Use / Define / Temp. 2870 // Methods for getting operands for Use / Define / Temp.
2886 LUnallocated* ToUnallocated(Register reg); 2871 LUnallocated* ToUnallocated(Register reg);
2887 LUnallocated* ToUnallocated(XMMRegister reg); 2872 LUnallocated* ToUnallocated(XMMRegister reg);
2888 LUnallocated* ToUnallocated(X87TopOfStackRegister reg); 2873 LUnallocated* ToUnallocated(X87Register reg);
2889 2874
2890 // Methods for setting up define-use relationships. 2875 // Methods for setting up define-use relationships.
2891 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); 2876 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
2892 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); 2877 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
2893 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, 2878 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
2894 XMMRegister fixed_register); 2879 XMMRegister fixed_register);
2895 MUST_USE_RESULT LOperand* UseX87TopOfStack(HValue* value);
2896 2880
2897 // A value that is guaranteed to be allocated to a register. 2881 // A value that is guaranteed to be allocated to a register.
2898 // Operand created by UseRegister is guaranteed to be live until the end of 2882 // Operand created by UseRegister is guaranteed to be live until the end of
2899 // instruction. This means that register allocator will not reuse it's 2883 // instruction. This means that register allocator will not reuse it's
2900 // register for any other operand inside instruction. 2884 // register for any other operand inside instruction.
2901 // Operand created by UseRegisterAtStart is guaranteed to be live only at 2885 // Operand created by UseRegisterAtStart is guaranteed to be live only at
2902 // instruction start. Register allocator is free to assign the same register 2886 // instruction start. Register allocator is free to assign the same register
2903 // to some other operand used inside instruction (i.e. temporary or 2887 // to some other operand used inside instruction (i.e. temporary or
2904 // output). 2888 // output).
2905 MUST_USE_RESULT LOperand* UseRegister(HValue* value); 2889 MUST_USE_RESULT LOperand* UseRegister(HValue* value);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
2999 2983
3000 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2984 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
3001 }; 2985 };
3002 2986
3003 #undef DECLARE_HYDROGEN_ACCESSOR 2987 #undef DECLARE_HYDROGEN_ACCESSOR
3004 #undef DECLARE_CONCRETE_INSTRUCTION 2988 #undef DECLARE_CONCRETE_INSTRUCTION
3005 2989
3006 } } // namespace v8::internal 2990 } } // namespace v8::internal
3007 2991
3008 #endif // V8_IA32_LITHIUM_IA32_H_ 2992 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698