| 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 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 // Must preserve the result register. | 960 // Must preserve the result register. |
| 961 void PopTryHandler(); | 961 void PopTryHandler(); |
| 962 | 962 |
| 963 // Passes thrown value to the handler of top of the try handler chain. | 963 // Passes thrown value to the handler of top of the try handler chain. |
| 964 void Throw(Register value); | 964 void Throw(Register value); |
| 965 | 965 |
| 966 // Propagates an uncatchable exception to the top of the current JS stack's | 966 // Propagates an uncatchable exception to the top of the current JS stack's |
| 967 // handler chain. | 967 // handler chain. |
| 968 void ThrowUncatchable(Register value); | 968 void ThrowUncatchable(Register value); |
| 969 | 969 |
| 970 // Throw a message string as an exception. |
| 971 void Throw(BailoutReason reason); |
| 972 |
| 973 // Throw a message string as an exception if a condition is not true. |
| 974 void ThrowIf(Condition cc, BailoutReason reason, Register rs, Operand rt); |
| 975 |
| 970 // Copies a fixed number of fields of heap objects from src to dst. | 976 // Copies a fixed number of fields of heap objects from src to dst. |
| 971 void CopyFields(Register dst, Register src, RegList temps, int field_count); | 977 void CopyFields(Register dst, Register src, RegList temps, int field_count); |
| 972 | 978 |
| 973 // Copies a number of bytes from src to dst. All registers are clobbered. On | 979 // Copies a number of bytes from src to dst. All registers are clobbered. On |
| 974 // exit src and dst will point to the place just after where the last byte was | 980 // exit src and dst will point to the place just after where the last byte was |
| 975 // read or written and length will be zero. | 981 // read or written and length will be zero. |
| 976 void CopyBytes(Register src, | 982 void CopyBytes(Register src, |
| 977 Register dst, | 983 Register dst, |
| 978 Register length, | 984 Register length, |
| 979 Register scratch); | 985 Register scratch); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 // Call a runtime routine. | 1198 // Call a runtime routine. |
| 1193 void CallRuntime(const Runtime::Function* f, | 1199 void CallRuntime(const Runtime::Function* f, |
| 1194 int num_arguments, | 1200 int num_arguments, |
| 1195 SaveFPRegsMode save_doubles = kDontSaveFPRegs); | 1201 SaveFPRegsMode save_doubles = kDontSaveFPRegs); |
| 1196 void CallRuntimeSaveDoubles(Runtime::FunctionId id) { | 1202 void CallRuntimeSaveDoubles(Runtime::FunctionId id) { |
| 1197 const Runtime::Function* function = Runtime::FunctionForId(id); | 1203 const Runtime::Function* function = Runtime::FunctionForId(id); |
| 1198 CallRuntime(function, function->nargs, kSaveFPRegs); | 1204 CallRuntime(function, function->nargs, kSaveFPRegs); |
| 1199 } | 1205 } |
| 1200 | 1206 |
| 1201 // Convenience function: Same as above, but takes the fid instead. | 1207 // Convenience function: Same as above, but takes the fid instead. |
| 1202 void CallRuntime(Runtime::FunctionId id, int num_arguments) { | 1208 void CallRuntime(Runtime::FunctionId id, |
| 1203 CallRuntime(Runtime::FunctionForId(id), num_arguments); | 1209 int num_arguments, |
| 1210 SaveFPRegsMode save_doubles = kDontSaveFPRegs) { |
| 1211 CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles); |
| 1204 } | 1212 } |
| 1205 | 1213 |
| 1206 // Convenience function: call an external reference. | 1214 // Convenience function: call an external reference. |
| 1207 void CallExternalReference(const ExternalReference& ext, | 1215 void CallExternalReference(const ExternalReference& ext, |
| 1208 int num_arguments, | 1216 int num_arguments, |
| 1209 BranchDelaySlot bd = PROTECT); | 1217 BranchDelaySlot bd = PROTECT); |
| 1210 | 1218 |
| 1211 // Tail call of a runtime routine (jump). | 1219 // Tail call of a runtime routine (jump). |
| 1212 // Like JumpToExternalReference, but also takes care of passing the number | 1220 // Like JumpToExternalReference, but also takes care of passing the number |
| 1213 // of parameters. | 1221 // of parameters. |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 } | 1366 } |
| 1359 | 1367 |
| 1360 // Test for overflow < 0: use BranchOnOverflow() or BranchOnNoOverflow(). | 1368 // Test for overflow < 0: use BranchOnOverflow() or BranchOnNoOverflow(). |
| 1361 void SmiTagCheckOverflow(Register reg, Register overflow); | 1369 void SmiTagCheckOverflow(Register reg, Register overflow); |
| 1362 void SmiTagCheckOverflow(Register dst, Register src, Register overflow); | 1370 void SmiTagCheckOverflow(Register dst, Register src, Register overflow); |
| 1363 | 1371 |
| 1364 void SmiTag(Register dst, Register src) { | 1372 void SmiTag(Register dst, Register src) { |
| 1365 Addu(dst, src, src); | 1373 Addu(dst, src, src); |
| 1366 } | 1374 } |
| 1367 | 1375 |
| 1376 // Try to convert int32 to smi. If the value is to large, preserve |
| 1377 // the original value and jump to not_a_smi. Destroys scratch and |
| 1378 // sets flags. |
| 1379 void TrySmiTag(Register reg, Register scratch, Label* not_a_smi) { |
| 1380 TrySmiTag(reg, reg, scratch, not_a_smi); |
| 1381 } |
| 1382 void TrySmiTag(Register dst, |
| 1383 Register src, |
| 1384 Register scratch, |
| 1385 Label* not_a_smi) { |
| 1386 SmiTagCheckOverflow(at, src, scratch); |
| 1387 BranchOnOverflow(not_a_smi, scratch); |
| 1388 mov(dst, at); |
| 1389 } |
| 1390 |
| 1368 void SmiUntag(Register reg) { | 1391 void SmiUntag(Register reg) { |
| 1369 sra(reg, reg, kSmiTagSize); | 1392 sra(reg, reg, kSmiTagSize); |
| 1370 } | 1393 } |
| 1371 | 1394 |
| 1372 void SmiUntag(Register dst, Register src) { | 1395 void SmiUntag(Register dst, Register src) { |
| 1373 sra(dst, src, kSmiTagSize); | 1396 sra(dst, src, kSmiTagSize); |
| 1374 } | 1397 } |
| 1375 | 1398 |
| 1399 // Test if the register contains a smi. |
| 1400 inline void SmiTst(Register value, Register scratch) { |
| 1401 And(scratch, value, Operand(kSmiTagMask)); |
| 1402 } |
| 1403 inline void NonNegativeSmiTst(Register value, Register scratch) { |
| 1404 And(scratch, value, Operand(kSmiTagMask | kSmiSignMask)); |
| 1405 } |
| 1406 |
| 1376 // Untag the source value into destination and jump if source is a smi. | 1407 // Untag the source value into destination and jump if source is a smi. |
| 1377 // Souce and destination can be the same register. | 1408 // Souce and destination can be the same register. |
| 1378 void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case); | 1409 void UntagAndJumpIfSmi(Register dst, Register src, Label* smi_case); |
| 1379 | 1410 |
| 1380 // Untag the source value into destination and jump if source is not a smi. | 1411 // Untag the source value into destination and jump if source is not a smi. |
| 1381 // Souce and destination can be the same register. | 1412 // Souce and destination can be the same register. |
| 1382 void UntagAndJumpIfNotSmi(Register dst, Register src, Label* non_smi_case); | 1413 void UntagAndJumpIfNotSmi(Register dst, Register src, Label* non_smi_case); |
| 1383 | 1414 |
| 1384 // Jump the register contains a smi. | 1415 // Jump the register contains a smi. |
| 1385 void JumpIfSmi(Register value, | 1416 void JumpIfSmi(Register value, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1445 Label* failure); | 1476 Label* failure); |
| 1446 | 1477 |
| 1447 // Check if instance type is sequential ASCII string and jump to label if | 1478 // Check if instance type is sequential ASCII string and jump to label if |
| 1448 // it is not. | 1479 // it is not. |
| 1449 void JumpIfInstanceTypeIsNotSequentialAscii(Register type, | 1480 void JumpIfInstanceTypeIsNotSequentialAscii(Register type, |
| 1450 Register scratch, | 1481 Register scratch, |
| 1451 Label* failure); | 1482 Label* failure); |
| 1452 | 1483 |
| 1453 void JumpIfNotUniqueName(Register reg, Label* not_unique_name); | 1484 void JumpIfNotUniqueName(Register reg, Label* not_unique_name); |
| 1454 | 1485 |
| 1486 void EmitSeqStringSetCharCheck(Register string, |
| 1487 Register index, |
| 1488 Register value, |
| 1489 Register scratch, |
| 1490 uint32_t encoding_mask); |
| 1491 |
| 1455 // Test that both first and second are sequential ASCII strings. | 1492 // Test that both first and second are sequential ASCII strings. |
| 1456 // Assume that they are non-smis. | 1493 // Assume that they are non-smis. |
| 1457 void JumpIfNonSmisNotBothSequentialAsciiStrings(Register first, | 1494 void JumpIfNonSmisNotBothSequentialAsciiStrings(Register first, |
| 1458 Register second, | 1495 Register second, |
| 1459 Register scratch1, | 1496 Register scratch1, |
| 1460 Register scratch2, | 1497 Register scratch2, |
| 1461 Label* failure); | 1498 Label* failure); |
| 1462 | 1499 |
| 1463 // Test that both first and second are sequential ASCII strings. | 1500 // Test that both first and second are sequential ASCII strings. |
| 1464 // Check that they are non-smis. | 1501 // Check that they are non-smis. |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1649 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1686 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
| 1650 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1687 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 1651 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1688 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 1652 #else | 1689 #else |
| 1653 #define ACCESS_MASM(masm) masm-> | 1690 #define ACCESS_MASM(masm) masm-> |
| 1654 #endif | 1691 #endif |
| 1655 | 1692 |
| 1656 } } // namespace v8::internal | 1693 } } // namespace v8::internal |
| 1657 | 1694 |
| 1658 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1695 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
| OLD | NEW |