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

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

Issue 148263012: A64: Rejig truncating and non double to i/smi (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/a64/lithium-a64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 V(ConstantD) \ 86 V(ConstantD) \
87 V(ConstantI) \ 87 V(ConstantI) \
88 V(ConstantS) \ 88 V(ConstantS) \
89 V(ConstantT) \ 89 V(ConstantT) \
90 V(Context) \ 90 V(Context) \
91 V(DateField) \ 91 V(DateField) \
92 V(DebugBreak) \ 92 V(DebugBreak) \
93 V(DeclareGlobals) \ 93 V(DeclareGlobals) \
94 V(Deoptimize) \ 94 V(Deoptimize) \
95 V(DivI) \ 95 V(DivI) \
96 V(DoubleToI) \ 96 V(DoubleToIntOrSmi) \
97 V(DoubleToSmi) \
98 V(Drop) \ 97 V(Drop) \
99 V(DummyUse) \ 98 V(DummyUse) \
100 V(ElementsKind) \ 99 V(ElementsKind) \
101 V(ForInCacheArray) \ 100 V(ForInCacheArray) \
102 V(ForInPrepareMap) \ 101 V(ForInPrepareMap) \
103 V(FunctionLiteral) \ 102 V(FunctionLiteral) \
104 V(GetCachedArrayIndex) \ 103 V(GetCachedArrayIndex) \
105 V(GlobalObject) \ 104 V(GlobalObject) \
106 V(GlobalReceiver) \ 105 V(GlobalReceiver) \
107 V(Goto) \ 106 V(Goto) \
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 V(StringCharFromCode) \ 181 V(StringCharFromCode) \
183 V(StringCompareAndBranch) \ 182 V(StringCompareAndBranch) \
184 V(StringLength) \ 183 V(StringLength) \
185 V(SubI) \ 184 V(SubI) \
186 V(TaggedToI) \ 185 V(TaggedToI) \
187 V(ThisFunction) \ 186 V(ThisFunction) \
188 V(Throw) \ 187 V(Throw) \
189 V(ToFastProperties) \ 188 V(ToFastProperties) \
190 V(TransitionElementsKind) \ 189 V(TransitionElementsKind) \
191 V(TrapAllocationMemento) \ 190 V(TrapAllocationMemento) \
191 V(TruncateDoubleToIntOrSmi) \
192 V(Typeof) \ 192 V(Typeof) \
193 V(TypeofIsAndBranch) \ 193 V(TypeofIsAndBranch) \
194 V(Uint32ToDouble) \ 194 V(Uint32ToDouble) \
195 V(UnknownOSRValue) \ 195 V(UnknownOSRValue) \
196 V(ValueOf) \ 196 V(ValueOf) \
197 V(CheckMapValue) \ 197 V(CheckMapValue) \
198 V(LoadFieldByIndex) \ 198 V(LoadFieldByIndex) \
199 V(WrapReceiver) 199 V(WrapReceiver)
200 200
201 201
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 1200
1201 LOperand* left() { return inputs_[0]; } 1201 LOperand* left() { return inputs_[0]; }
1202 LOperand* right() { return inputs_[1]; } 1202 LOperand* right() { return inputs_[1]; }
1203 LOperand* temp() { return temps_[0]; } 1203 LOperand* temp() { return temps_[0]; }
1204 1204
1205 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") 1205 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
1206 DECLARE_HYDROGEN_ACCESSOR(Div) 1206 DECLARE_HYDROGEN_ACCESSOR(Div)
1207 }; 1207 };
1208 1208
1209 1209
1210 class LDoubleToI: public LTemplateInstruction<1, 1, 2> { 1210 class LDoubleToIntOrSmi: public LTemplateInstruction<1, 1, 0> {
1211 public: 1211 public:
1212 LDoubleToI(LOperand* value, LOperand* temp1, LOperand* temp2) { 1212 explicit LDoubleToIntOrSmi(LOperand* value) {
1213 inputs_[0] = value; 1213 inputs_[0] = value;
1214 temps_[0] = temp1;
1215 temps_[1] = temp2;
1216 } 1214 }
1217 1215
1218 LOperand* value() { return inputs_[0]; } 1216 LOperand* value() { return inputs_[0]; }
1219 LOperand* temp1() { return temps_[0]; }
1220 LOperand* temp2() { return temps_[1]; }
1221 1217
1222 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") 1218 DECLARE_CONCRETE_INSTRUCTION(DoubleToIntOrSmi, "double-to-int-or-smi")
1223 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) 1219 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
1224 1220
1225 bool truncating() { return hydrogen()->CanTruncateToInt32(); } 1221 bool tag_result() { return hydrogen()->representation().IsSmi(); }
1226 }; 1222 };
1227 1223
1228 1224
1229 class LDoubleToSmi: public LTemplateInstruction<1, 1, 2> {
1230 public:
1231 LDoubleToSmi(LOperand* value, LOperand* temp1, LOperand* temp2) {
1232 inputs_[0] = value;
1233 temps_[0] = temp1;
1234 temps_[1] = temp2;
1235 }
1236
1237 LOperand* value() { return inputs_[0]; }
1238 LOperand* temp1() { return temps_[0]; }
1239 LOperand* temp2() { return temps_[1]; }
1240
1241 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-smi")
1242 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
1243
1244 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1245 };
1246
1247
1248 class LElementsKind: public LTemplateInstruction<1, 1, 0> { 1225 class LElementsKind: public LTemplateInstruction<1, 1, 0> {
1249 public: 1226 public:
1250 explicit LElementsKind(LOperand* value) { 1227 explicit LElementsKind(LOperand* value) {
1251 inputs_[0] = value; 1228 inputs_[0] = value;
1252 } 1229 }
1253 1230
1254 LOperand* value() { return inputs_[0]; } 1231 LOperand* value() { return inputs_[0]; }
1255 1232
1256 DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind") 1233 DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind")
1257 DECLARE_HYDROGEN_ACCESSOR(ElementsKind) 1234 DECLARE_HYDROGEN_ACCESSOR(ElementsKind)
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after
2582 } 2559 }
2583 2560
2584 LOperand* object() { return inputs_[0]; } 2561 LOperand* object() { return inputs_[0]; }
2585 LOperand* temp1() { return temps_[0]; } 2562 LOperand* temp1() { return temps_[0]; }
2586 LOperand* temp2() { return temps_[1]; } 2563 LOperand* temp2() { return temps_[1]; }
2587 2564
2588 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, "trap-allocation-memento") 2565 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, "trap-allocation-memento")
2589 }; 2566 };
2590 2567
2591 2568
2569 class LTruncateDoubleToIntOrSmi: public LTemplateInstruction<1, 1, 2> {
2570 public:
2571 LTruncateDoubleToIntOrSmi(LOperand* value, LOperand* temp1, LOperand* temp2) {
2572 inputs_[0] = value;
2573 temps_[0] = temp1;
2574 temps_[1] = temp2;
2575 }
2576
2577 LOperand* value() { return inputs_[0]; }
2578 LOperand* temp1() { return temps_[0]; }
2579 LOperand* temp2() { return temps_[1]; }
2580
2581 DECLARE_CONCRETE_INSTRUCTION(TruncateDoubleToIntOrSmi,
2582 "truncate-double-to-int-or-smi")
2583 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
2584
2585 bool tag_result() { return hydrogen()->representation().IsSmi(); }
2586 };
2587
2588
2592 class LTypeof: public LTemplateInstruction<1, 1, 0> { 2589 class LTypeof: public LTemplateInstruction<1, 1, 0> {
2593 public: 2590 public:
2594 explicit LTypeof(LOperand* value) { 2591 explicit LTypeof(LOperand* value) {
2595 inputs_[0] = value; 2592 inputs_[0] = value;
2596 } 2593 }
2597 2594
2598 LOperand* value() { return inputs_[0]; } 2595 LOperand* value() { return inputs_[0]; }
2599 2596
2600 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") 2597 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2601 }; 2598 };
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
2865 2862
2866 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2863 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2867 }; 2864 };
2868 2865
2869 #undef DECLARE_HYDROGEN_ACCESSOR 2866 #undef DECLARE_HYDROGEN_ACCESSOR
2870 #undef DECLARE_CONCRETE_INSTRUCTION 2867 #undef DECLARE_CONCRETE_INSTRUCTION
2871 2868
2872 } } // namespace v8::internal 2869 } } // namespace v8::internal
2873 2870
2874 #endif // V8_A64_LITHIUM_A64_H_ 2871 #endif // V8_A64_LITHIUM_A64_H_
OLDNEW
« no previous file with comments | « no previous file | src/a64/lithium-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698