OLD | NEW |
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 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 } | 1235 } |
1236 | 1236 |
1237 void SmiUntag(Register reg) { | 1237 void SmiUntag(Register reg) { |
1238 sra(reg, reg, kSmiTagSize); | 1238 sra(reg, reg, kSmiTagSize); |
1239 } | 1239 } |
1240 | 1240 |
1241 void SmiUntag(Register dst, Register src) { | 1241 void SmiUntag(Register dst, Register src) { |
1242 sra(dst, src, kSmiTagSize); | 1242 sra(dst, src, kSmiTagSize); |
1243 } | 1243 } |
1244 | 1244 |
| 1245 // Untag the source value into destination and jump if source is a smi. |
| 1246 // Souce and destination can be the same register. |
| 1247 void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case); |
| 1248 |
| 1249 // Untag the source value into destination and jump if source is not a smi. |
| 1250 // Souce and destination can be the same register. |
| 1251 void UntagAndJumpIfNotSmi(Register dst, Register src, Label* non_smi_case); |
| 1252 |
1245 // Jump the register contains a smi. | 1253 // Jump the register contains a smi. |
1246 inline void JumpIfSmi(Register value, Label* smi_label, | 1254 void JumpIfSmi(Register value, |
1247 Register scratch = at, | 1255 Label* smi_label, |
1248 BranchDelaySlot bd = PROTECT) { | 1256 Register scratch = at, |
1249 ASSERT_EQ(0, kSmiTag); | 1257 BranchDelaySlot bd = PROTECT); |
1250 andi(scratch, value, kSmiTagMask); | |
1251 Branch(bd, smi_label, eq, scratch, Operand(zero_reg)); | |
1252 } | |
1253 | 1258 |
1254 // Jump if the register contains a non-smi. | 1259 // Jump if the register contains a non-smi. |
1255 inline void JumpIfNotSmi(Register value, Label* not_smi_label, | 1260 void JumpIfNotSmi(Register value, |
1256 Register scratch = at) { | 1261 Label* not_smi_label, |
1257 ASSERT_EQ(0, kSmiTag); | 1262 Register scratch = at, |
1258 andi(scratch, value, kSmiTagMask); | 1263 BranchDelaySlot bd = PROTECT); |
1259 Branch(not_smi_label, ne, scratch, Operand(zero_reg)); | |
1260 } | |
1261 | 1264 |
1262 // Jump if either of the registers contain a non-smi. | 1265 // Jump if either of the registers contain a non-smi. |
1263 void JumpIfNotBothSmi(Register reg1, Register reg2, Label* on_not_both_smi); | 1266 void JumpIfNotBothSmi(Register reg1, Register reg2, Label* on_not_both_smi); |
1264 // Jump if either of the registers contain a smi. | 1267 // Jump if either of the registers contain a smi. |
1265 void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi); | 1268 void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi); |
1266 | 1269 |
1267 // Abort execution if argument is a smi. Used in debug code. | 1270 // Abort execution if argument is a smi. Used in debug code. |
1268 void AbortIfSmi(Register object); | 1271 void AbortIfSmi(Register object); |
1269 void AbortIfNotSmi(Register object); | 1272 void AbortIfNotSmi(Register object); |
1270 | 1273 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1461 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
1459 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1462 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1460 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1463 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1461 #else | 1464 #else |
1462 #define ACCESS_MASM(masm) masm-> | 1465 #define ACCESS_MASM(masm) masm-> |
1463 #endif | 1466 #endif |
1464 | 1467 |
1465 } } // namespace v8::internal | 1468 } } // namespace v8::internal |
1466 | 1469 |
1467 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1470 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |