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 1204 matching lines...) Loading... |
1215 // control continues at the label not_power_of_two. If reg is a power of two | 1215 // control continues at the label not_power_of_two. If reg is a power of two |
1216 // the register scratch contains the value of (reg - 1) when control falls | 1216 // the register scratch contains the value of (reg - 1) when control falls |
1217 // through. | 1217 // through. |
1218 void JumpIfNotPowerOfTwoOrZero(Register reg, | 1218 void JumpIfNotPowerOfTwoOrZero(Register reg, |
1219 Register scratch, | 1219 Register scratch, |
1220 Label* not_power_of_two_or_zero); | 1220 Label* not_power_of_two_or_zero); |
1221 | 1221 |
1222 // ------------------------------------------------------------------------- | 1222 // ------------------------------------------------------------------------- |
1223 // Smi utilities. | 1223 // Smi utilities. |
1224 | 1224 |
1225 // Try to convert int32 to smi. If the value is to large, preserve | |
1226 // the original value and jump to not_a_smi. Destroys scratch and | |
1227 // sets flags. | |
1228 // This is only used by crankshaft atm so it is unimplemented on MIPS. | |
1229 void TrySmiTag(Register reg, Label* not_a_smi, Register scratch) { | |
1230 UNIMPLEMENTED_MIPS(); | |
1231 } | |
1232 | |
1233 void SmiTag(Register reg) { | 1225 void SmiTag(Register reg) { |
1234 Addu(reg, reg, reg); | 1226 Addu(reg, reg, reg); |
1235 } | 1227 } |
1236 | 1228 |
1237 // Test for overflow < 0: use BranchOnOverflow() or BranchOnNoOverflow(). | 1229 // Test for overflow < 0: use BranchOnOverflow() or BranchOnNoOverflow(). |
1238 void SmiTagCheckOverflow(Register reg, Register overflow) { | 1230 void SmiTagCheckOverflow(Register reg, Register overflow); |
1239 mov(overflow, reg); // Save original value. | 1231 void SmiTagCheckOverflow(Register dst, Register src, Register overflow); |
1240 addu(reg, reg, reg); | |
1241 xor_(overflow, overflow, reg); // Overflow if (value ^ 2 * value) < 0. | |
1242 } | |
1243 | 1232 |
1244 void SmiTag(Register dst, Register src) { | 1233 void SmiTag(Register dst, Register src) { |
1245 Addu(dst, src, src); | 1234 Addu(dst, src, src); |
1246 } | 1235 } |
1247 | 1236 |
1248 void SmiUntag(Register reg) { | 1237 void SmiUntag(Register reg) { |
1249 sra(reg, reg, kSmiTagSize); | 1238 sra(reg, reg, kSmiTagSize); |
1250 } | 1239 } |
1251 | 1240 |
1252 void SmiUntag(Register dst, Register src) { | 1241 void SmiUntag(Register dst, Register src) { |
(...skipping 216 matching lines...) Loading... |
1469 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1458 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
1470 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1459 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1471 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1460 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1472 #else | 1461 #else |
1473 #define ACCESS_MASM(masm) masm-> | 1462 #define ACCESS_MASM(masm) masm-> |
1474 #endif | 1463 #endif |
1475 | 1464 |
1476 } } // namespace v8::internal | 1465 } } // namespace v8::internal |
1477 | 1466 |
1478 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1467 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |