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

Side by Side Diff: src/x64/macro-assembler-x64.h

Issue 2872005: X64: Change some smi operations to work on untagged integers instead. (Closed)
Patch Set: Addressed review comments. Created 10 years, 6 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
« no previous file with comments | « src/x64/ic-x64.cc ('k') | src/x64/macro-assembler-x64.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // Tag an integer value. The result must be known to be a valid smi value. 196 // Tag an integer value. The result must be known to be a valid smi value.
197 // Only uses the low 32 bits of the src register. Sets the N and Z flags 197 // Only uses the low 32 bits of the src register. Sets the N and Z flags
198 // based on the value of the resulting integer. 198 // based on the value of the resulting integer.
199 void Integer32ToSmi(Register dst, Register src); 199 void Integer32ToSmi(Register dst, Register src);
200 200
201 // Tag an integer value if possible, or jump the integer value cannot be 201 // Tag an integer value if possible, or jump the integer value cannot be
202 // represented as a smi. Only uses the low 32 bit of the src registers. 202 // represented as a smi. Only uses the low 32 bit of the src registers.
203 // NOTICE: Destroys the dst register even if unsuccessful! 203 // NOTICE: Destroys the dst register even if unsuccessful!
204 void Integer32ToSmi(Register dst, Register src, Label* on_overflow); 204 void Integer32ToSmi(Register dst, Register src, Label* on_overflow);
205 205
206 // Stores an integer32 value into a memory field that already holds a smi.
207 void Integer32ToSmiField(const Operand& dst, Register src);
208
206 // Adds constant to src and tags the result as a smi. 209 // Adds constant to src and tags the result as a smi.
207 // Result must be a valid smi. 210 // Result must be a valid smi.
208 void Integer64PlusConstantToSmi(Register dst, Register src, int constant); 211 void Integer64PlusConstantToSmi(Register dst, Register src, int constant);
209 212
210 // Convert smi to 32-bit integer. I.e., not sign extended into 213 // Convert smi to 32-bit integer. I.e., not sign extended into
211 // high 32 bits of destination. 214 // high 32 bits of destination.
212 void SmiToInteger32(Register dst, Register src); 215 void SmiToInteger32(Register dst, Register src);
213 void SmiToInteger32(Register dst, const Operand& src); 216 void SmiToInteger32(Register dst, const Operand& src);
214 217
215 // Convert smi to 64-bit integer (sign extended if necessary). 218 // Convert smi to 64-bit integer (sign extended if necessary).
216 void SmiToInteger64(Register dst, Register src); 219 void SmiToInteger64(Register dst, Register src);
220 void SmiToInteger64(Register dst, const Operand& src);
217 221
218 // Multiply a positive smi's integer value by a power of two. 222 // Multiply a positive smi's integer value by a power of two.
219 // Provides result as 64-bit integer value. 223 // Provides result as 64-bit integer value.
220 void PositiveSmiTimesPowerOfTwoToInteger64(Register dst, 224 void PositiveSmiTimesPowerOfTwoToInteger64(Register dst,
221 Register src, 225 Register src,
222 int power); 226 int power);
223 227
224 // Divide a positive smi's integer value by a power of two. 228 // Divide a positive smi's integer value by a power of two.
225 // Provides result as 32-bit integer value. 229 // Provides result as 32-bit integer value.
226 void PositiveSmiDivPowerOfTwoToInteger32(Register dst, 230 void PositiveSmiDivPowerOfTwoToInteger32(Register dst,
227 Register src, 231 Register src,
228 int power); 232 int power);
229 233
230 234
231 // Simple comparison of smis. 235 // Simple comparison of smis.
232 void SmiCompare(Register dst, Register src); 236 void SmiCompare(Register dst, Register src);
233 void SmiCompare(Register dst, Smi* src); 237 void SmiCompare(Register dst, Smi* src);
234 void SmiCompare(Register dst, const Operand& src); 238 void SmiCompare(Register dst, const Operand& src);
235 void SmiCompare(const Operand& dst, Register src); 239 void SmiCompare(const Operand& dst, Register src);
236 void SmiCompare(const Operand& dst, Smi* src); 240 void SmiCompare(const Operand& dst, Smi* src);
241 // Compare the int32 in src register to the value of the smi stored at dst.
242 void SmiCompareInteger32(const Operand& dst, Register src);
237 // Sets sign and zero flags depending on value of smi in register. 243 // Sets sign and zero flags depending on value of smi in register.
238 void SmiTest(Register src); 244 void SmiTest(Register src);
239 245
240 // Functions performing a check on a known or potential smi. Returns 246 // Functions performing a check on a known or potential smi. Returns
241 // a condition that is satisfied if the check is successful. 247 // a condition that is satisfied if the check is successful.
242 248
243 // Is the value a tagged smi. 249 // Is the value a tagged smi.
244 Condition CheckSmi(Register src); 250 Condition CheckSmi(Register src);
245 251
246 // Is the value a positive tagged smi. 252 // Is the value a positive tagged smi.
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 } \ 890 } \
885 masm-> 891 masm->
886 #else 892 #else
887 #define ACCESS_MASM(masm) masm-> 893 #define ACCESS_MASM(masm) masm->
888 #endif 894 #endif
889 895
890 896
891 } } // namespace v8::internal 897 } } // namespace v8::internal
892 898
893 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ 899 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_
OLDNEW
« no previous file with comments | « src/x64/ic-x64.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698