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

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

Issue 13426006: Improvements for x87 stack handling (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Last comments Created 7 years, 8 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/ia32/lithium-gap-resolver-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 V(CallStub) \ 67 V(CallStub) \
68 V(CheckFunction) \ 68 V(CheckFunction) \
69 V(CheckInstanceType) \ 69 V(CheckInstanceType) \
70 V(CheckMaps) \ 70 V(CheckMaps) \
71 V(CheckNonSmi) \ 71 V(CheckNonSmi) \
72 V(CheckPrototypeMaps) \ 72 V(CheckPrototypeMaps) \
73 V(CheckSmi) \ 73 V(CheckSmi) \
74 V(ClampDToUint8) \ 74 V(ClampDToUint8) \
75 V(ClampIToUint8) \ 75 V(ClampIToUint8) \
76 V(ClampTToUint8) \ 76 V(ClampTToUint8) \
77 V(ClampTToUint8NoSSE2) \
77 V(ClassOfTestAndBranch) \ 78 V(ClassOfTestAndBranch) \
78 V(CmpIDAndBranch) \ 79 V(CmpIDAndBranch) \
79 V(CmpObjectEqAndBranch) \ 80 V(CmpObjectEqAndBranch) \
80 V(CmpMapAndBranch) \ 81 V(CmpMapAndBranch) \
81 V(CmpT) \ 82 V(CmpT) \
82 V(CmpConstantEqAndBranch) \ 83 V(CmpConstantEqAndBranch) \
83 V(ConstantD) \ 84 V(ConstantD) \
84 V(ConstantI) \ 85 V(ConstantI) \
85 V(ConstantT) \ 86 V(ConstantT) \
86 V(Context) \ 87 V(Context) \
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 V(StoreKeyedGeneric) \ 161 V(StoreKeyedGeneric) \
161 V(StoreNamedField) \ 162 V(StoreNamedField) \
162 V(StoreNamedGeneric) \ 163 V(StoreNamedGeneric) \
163 V(StringAdd) \ 164 V(StringAdd) \
164 V(StringCharCodeAt) \ 165 V(StringCharCodeAt) \
165 V(StringCharFromCode) \ 166 V(StringCharFromCode) \
166 V(StringCompareAndBranch) \ 167 V(StringCompareAndBranch) \
167 V(StringLength) \ 168 V(StringLength) \
168 V(SubI) \ 169 V(SubI) \
169 V(TaggedToI) \ 170 V(TaggedToI) \
171 V(TaggedToINoSSE2) \
170 V(ThisFunction) \ 172 V(ThisFunction) \
171 V(Throw) \ 173 V(Throw) \
172 V(ToFastProperties) \ 174 V(ToFastProperties) \
173 V(TransitionElementsKind) \ 175 V(TransitionElementsKind) \
174 V(TrapAllocationMemento) \ 176 V(TrapAllocationMemento) \
175 V(Typeof) \ 177 V(Typeof) \
176 V(TypeofIsAndBranch) \ 178 V(TypeofIsAndBranch) \
177 V(UnaryMathOperation) \ 179 V(UnaryMathOperation) \
178 V(UnknownOSRValue) \ 180 V(UnknownOSRValue) \
179 V(ValueOf) \ 181 V(ValueOf) \
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 // Interface to the register allocator and iterators. 260 // Interface to the register allocator and iterators.
259 bool ClobbersTemps() const { return is_call_; } 261 bool ClobbersTemps() const { return is_call_; }
260 bool ClobbersRegisters() const { return is_call_; } 262 bool ClobbersRegisters() const { return is_call_; }
261 virtual bool ClobbersDoubleRegisters() const { 263 virtual bool ClobbersDoubleRegisters() const {
262 return is_call_ || !CpuFeatures::IsSupported(SSE2); 264 return is_call_ || !CpuFeatures::IsSupported(SSE2);
263 } 265 }
264 266
265 virtual bool HasResult() const = 0; 267 virtual bool HasResult() const = 0;
266 virtual LOperand* result() = 0; 268 virtual LOperand* result() = 0;
267 269
270 bool HasDoubleRegisterResult();
271 bool HasDoubleRegisterInput();
272
268 LOperand* FirstInput() { return InputAt(0); } 273 LOperand* FirstInput() { return InputAt(0); }
269 LOperand* Output() { return HasResult() ? result() : NULL; } 274 LOperand* Output() { return HasResult() ? result() : NULL; }
270 275
271 #ifdef DEBUG 276 #ifdef DEBUG
272 void VerifyCall(); 277 void VerifyCall();
273 #endif 278 #endif
274 279
275 private: 280 private:
276 // Iterator support. 281 // Iterator support.
277 friend class InputIterator; 282 friend class InputIterator;
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 int32_t value() const { return hydrogen()->Integer32Value(); } 1086 int32_t value() const { return hydrogen()->Integer32Value(); }
1082 }; 1087 };
1083 1088
1084 1089
1085 class LConstantD: public LTemplateInstruction<1, 0, 1> { 1090 class LConstantD: public LTemplateInstruction<1, 0, 1> {
1086 public: 1091 public:
1087 explicit LConstantD(LOperand* temp) { 1092 explicit LConstantD(LOperand* temp) {
1088 temps_[0] = temp; 1093 temps_[0] = temp;
1089 } 1094 }
1090 1095
1096 virtual bool ClobbersDoubleRegisters() const {
1097 return false;
1098 }
1099
1091 LOperand* temp() { return temps_[0]; } 1100 LOperand* temp() { return temps_[0]; }
1092 1101
1093 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") 1102 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
1094 DECLARE_HYDROGEN_ACCESSOR(Constant) 1103 DECLARE_HYDROGEN_ACCESSOR(Constant)
1095 1104
1096 double value() const { return hydrogen()->DoubleValue(); } 1105 double value() const { return hydrogen()->DoubleValue(); }
1097 }; 1106 };
1098 1107
1099 1108
1100 class LConstantT: public LTemplateInstruction<1, 0, 0> { 1109 class LConstantT: public LTemplateInstruction<1, 0, 0> {
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 LOperand* value() { return inputs_[0]; } 2020 LOperand* value() { return inputs_[0]; }
2012 LOperand* temp() { return temps_[0]; } 2021 LOperand* temp() { return temps_[0]; }
2013 2022
2014 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") 2023 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
2015 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) 2024 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
2016 2025
2017 bool truncating() { return hydrogen()->CanTruncateToInt32(); } 2026 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
2018 }; 2027 };
2019 2028
2020 2029
2030 // Truncating conversion from a tagged value to an int32.
2031 class LTaggedToINoSSE2: public LTemplateInstruction<1, 1, 3> {
2032 public:
2033 LTaggedToINoSSE2(LOperand* value,
2034 LOperand* temp1,
2035 LOperand* temp2,
2036 LOperand* temp3) {
2037 inputs_[0] = value;
2038 temps_[0] = temp1;
2039 temps_[1] = temp2;
2040 temps_[2] = temp3;
2041 }
2042
2043 LOperand* value() { return inputs_[0]; }
2044 LOperand* scratch() { return temps_[0]; }
2045 LOperand* scratch2() { return temps_[1]; }
2046 LOperand* scratch3() { return temps_[2]; }
2047
2048 DECLARE_CONCRETE_INSTRUCTION(TaggedToINoSSE2, "tagged-to-i-nosse2")
2049 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
2050
2051 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
2052 };
2053
2054
2021 class LSmiTag: public LTemplateInstruction<1, 1, 0> { 2055 class LSmiTag: public LTemplateInstruction<1, 1, 0> {
2022 public: 2056 public:
2023 explicit LSmiTag(LOperand* value) { 2057 explicit LSmiTag(LOperand* value) {
2024 inputs_[0] = value; 2058 inputs_[0] = value;
2025 } 2059 }
2026 2060
2027 LOperand* value() { return inputs_[0]; } 2061 LOperand* value() { return inputs_[0]; }
2028 2062
2029 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") 2063 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
2030 }; 2064 };
2031 2065
2032 2066
2033 class LNumberUntagD: public LTemplateInstruction<1, 1, 1> { 2067 class LNumberUntagD: public LTemplateInstruction<1, 1, 1> {
2034 public: 2068 public:
2035 explicit LNumberUntagD(LOperand* value, LOperand* temp) { 2069 explicit LNumberUntagD(LOperand* value, LOperand* temp) {
2036 inputs_[0] = value; 2070 inputs_[0] = value;
2037 temps_[0] = temp; 2071 temps_[0] = temp;
2038 } 2072 }
2039 2073
2040 LOperand* value() { return inputs_[0]; } 2074 LOperand* value() { return inputs_[0]; }
2041 LOperand* temp() { return temps_[0]; } 2075 LOperand* temp() { return temps_[0]; }
2042 2076
2077 virtual bool ClobbersDoubleRegisters() const {
2078 return false;
2079 }
2080
2043 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") 2081 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
2044 DECLARE_HYDROGEN_ACCESSOR(Change); 2082 DECLARE_HYDROGEN_ACCESSOR(Change);
2045 }; 2083 };
2046 2084
2047 2085
2048 class LSmiUntag: public LTemplateInstruction<1, 1, 0> { 2086 class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
2049 public: 2087 public:
2050 LSmiUntag(LOperand* value, bool needs_check) 2088 LSmiUntag(LOperand* value, bool needs_check)
2051 : needs_check_(needs_check) { 2089 : needs_check_(needs_check) {
2052 inputs_[0] = value; 2090 inputs_[0] = value;
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
2373 inputs_[0] = value; 2411 inputs_[0] = value;
2374 temps_[0] = temp; 2412 temps_[0] = temp;
2375 } 2413 }
2376 2414
2377 LOperand* unclamped() { return inputs_[0]; } 2415 LOperand* unclamped() { return inputs_[0]; }
2378 2416
2379 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") 2417 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
2380 }; 2418 };
2381 2419
2382 2420
2421 // Truncating conversion from a tagged value to an int32.
2422 class LClampTToUint8NoSSE2: public LTemplateInstruction<1, 1, 3> {
2423 public:
2424 LClampTToUint8NoSSE2(LOperand* unclamped,
2425 LOperand* temp1,
2426 LOperand* temp2,
2427 LOperand* temp3) {
2428 inputs_[0] = unclamped;
2429 temps_[0] = temp1;
2430 temps_[1] = temp2;
2431 temps_[2] = temp3;
2432 }
2433
2434 LOperand* unclamped() { return inputs_[0]; }
2435 LOperand* scratch() { return temps_[0]; }
2436 LOperand* scratch2() { return temps_[1]; }
2437 LOperand* scratch3() { return temps_[2]; }
2438
2439 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8NoSSE2,
2440 "clamp-t-to-uint8-nosse2")
2441 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
2442 };
2443
2444
2383 class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> { 2445 class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> {
2384 public: 2446 public:
2385 explicit LCheckNonSmi(LOperand* value) { 2447 explicit LCheckNonSmi(LOperand* value) {
2386 inputs_[0] = value; 2448 inputs_[0] = value;
2387 } 2449 }
2388 2450
2389 LOperand* value() { return inputs_[0]; } 2451 LOperand* value() { return inputs_[0]; }
2390 2452
2391 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") 2453 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
2392 }; 2454 };
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
2735 // Methods for getting operands for Use / Define / Temp. 2797 // Methods for getting operands for Use / Define / Temp.
2736 LUnallocated* ToUnallocated(Register reg); 2798 LUnallocated* ToUnallocated(Register reg);
2737 LUnallocated* ToUnallocated(XMMRegister reg); 2799 LUnallocated* ToUnallocated(XMMRegister reg);
2738 LUnallocated* ToUnallocated(X87TopOfStackRegister reg); 2800 LUnallocated* ToUnallocated(X87TopOfStackRegister reg);
2739 2801
2740 // Methods for setting up define-use relationships. 2802 // Methods for setting up define-use relationships.
2741 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); 2803 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
2742 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); 2804 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
2743 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, 2805 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
2744 XMMRegister fixed_register); 2806 XMMRegister fixed_register);
2807 MUST_USE_RESULT LOperand* UseX87TopOfStack(HValue* value);
2745 2808
2746 // A value that is guaranteed to be allocated to a register. 2809 // A value that is guaranteed to be allocated to a register.
2747 // Operand created by UseRegister is guaranteed to be live until the end of 2810 // Operand created by UseRegister is guaranteed to be live until the end of
2748 // instruction. This means that register allocator will not reuse it's 2811 // instruction. This means that register allocator will not reuse it's
2749 // register for any other operand inside instruction. 2812 // register for any other operand inside instruction.
2750 // Operand created by UseRegisterAtStart is guaranteed to be live only at 2813 // Operand created by UseRegisterAtStart is guaranteed to be live only at
2751 // instruction start. Register allocator is free to assign the same register 2814 // instruction start. Register allocator is free to assign the same register
2752 // to some other operand used inside instruction (i.e. temporary or 2815 // to some other operand used inside instruction (i.e. temporary or
2753 // output). 2816 // output).
2754 MUST_USE_RESULT LOperand* UseRegister(HValue* value); 2817 MUST_USE_RESULT LOperand* UseRegister(HValue* value);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
2820 2883
2821 void VisitInstruction(HInstruction* current); 2884 void VisitInstruction(HInstruction* current);
2822 2885
2823 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); 2886 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
2824 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); 2887 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
2825 LInstruction* DoArithmeticD(Token::Value op, 2888 LInstruction* DoArithmeticD(Token::Value op,
2826 HArithmeticBinaryOperation* instr); 2889 HArithmeticBinaryOperation* instr);
2827 LInstruction* DoArithmeticT(Token::Value op, 2890 LInstruction* DoArithmeticT(Token::Value op,
2828 HArithmeticBinaryOperation* instr); 2891 HArithmeticBinaryOperation* instr);
2829 2892
2893 LOperand* GetStoreKeyedValueOperand(HStoreKeyed* instr);
2894
2830 LPlatformChunk* chunk_; 2895 LPlatformChunk* chunk_;
2831 CompilationInfo* info_; 2896 CompilationInfo* info_;
2832 HGraph* const graph_; 2897 HGraph* const graph_;
2833 Zone* zone_; 2898 Zone* zone_;
2834 Status status_; 2899 Status status_;
2835 HInstruction* current_instruction_; 2900 HInstruction* current_instruction_;
2836 HBasicBlock* current_block_; 2901 HBasicBlock* current_block_;
2837 HBasicBlock* next_block_; 2902 HBasicBlock* next_block_;
2838 int argument_count_; 2903 int argument_count_;
2839 LAllocator* allocator_; 2904 LAllocator* allocator_;
2840 int position_; 2905 int position_;
2841 LInstruction* instruction_pending_deoptimization_environment_; 2906 LInstruction* instruction_pending_deoptimization_environment_;
2842 BailoutId pending_deoptimization_ast_id_; 2907 BailoutId pending_deoptimization_ast_id_;
2843 2908
2844 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2909 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2845 }; 2910 };
2846 2911
2847 #undef DECLARE_HYDROGEN_ACCESSOR 2912 #undef DECLARE_HYDROGEN_ACCESSOR
2848 #undef DECLARE_CONCRETE_INSTRUCTION 2913 #undef DECLARE_CONCRETE_INSTRUCTION
2849 2914
2850 } } // namespace v8::internal 2915 } } // namespace v8::internal
2851 2916
2852 #endif // V8_IA32_LITHIUM_IA32_H_ 2917 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/lithium-gap-resolver-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698