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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
477 const Condition cond = al); | 477 const Condition cond = al); |
478 void VFPCompareAndLoadFlags(const DwVfpRegister src1, | 478 void VFPCompareAndLoadFlags(const DwVfpRegister src1, |
479 const double src2, | 479 const double src2, |
480 const Register fpscr_flags, | 480 const Register fpscr_flags, |
481 const Condition cond = al); | 481 const Condition cond = al); |
482 | 482 |
483 void Vmov(const DwVfpRegister dst, | 483 void Vmov(const DwVfpRegister dst, |
484 const double imm, | 484 const double imm, |
485 const Register scratch = no_reg); | 485 const Register scratch = no_reg); |
486 | 486 |
487 void VmovHigh(Register dst, DwVfpRegister src); | |
488 void VmovHigh(DwVfpRegister dst, Register src); | |
489 void VmovLow(Register dst, DwVfpRegister src); | |
490 void VmovLow(DwVfpRegister dst, Register src); | |
491 | |
487 // Converts the smi or heap number in object to an int32 using the rules | 492 // Converts the smi or heap number in object to an int32 using the rules |
488 // for ToInt32 as described in ECMAScript 9.5.: the value is truncated | 493 // for ToInt32 as described in ECMAScript 9.5.: the value is truncated |
489 // and brought into the range -2^31 .. +2^31 - 1. | 494 // and brought into the range -2^31 .. +2^31 - 1. |
490 void ConvertNumberToInt32(Register object, | 495 void ConvertNumberToInt32(Register object, |
491 Register dst, | 496 Register dst, |
492 Register heap_number_map, | 497 Register heap_number_map, |
493 Register scratch1, | 498 Register scratch1, |
494 Register scratch2, | 499 Register scratch2, |
495 Register scratch3, | 500 Register scratch3, |
496 DwVfpRegister double_scratch1, | 501 DwVfpRegister double_scratch1, |
497 DwVfpRegister double_scratch2, | 502 LowDwVfpRegister double_scratch2, |
498 Label* not_int32); | 503 Label* not_int32); |
499 | 504 |
500 // Loads the number from object into dst register. | 505 // Loads the number from object into dst register. |
501 // If |object| is neither smi nor heap number, |not_number| is jumped to | 506 // If |object| is neither smi nor heap number, |not_number| is jumped to |
502 // with |object| still intact. | 507 // with |object| still intact. |
503 void LoadNumber(Register object, | 508 void LoadNumber(Register object, |
504 DwVfpRegister dst, | 509 LowDwVfpRegister dst, |
505 Register heap_number_map, | 510 Register heap_number_map, |
506 Register scratch, | 511 Register scratch, |
507 Label* not_number); | 512 Label* not_number); |
508 | 513 |
509 // Loads the number from object into double_dst in the double format. | 514 // Loads the number from object into double_dst in the double format. |
510 // Control will jump to not_int32 if the value cannot be exactly represented | 515 // Control will jump to not_int32 if the value cannot be exactly represented |
511 // by a 32-bit integer. | 516 // by a 32-bit integer. |
512 // Floating point value in the 32-bit integer range that are not exact integer | 517 // Floating point value in the 32-bit integer range that are not exact integer |
513 // won't be loaded. | 518 // won't be loaded. |
514 void LoadNumberAsInt32Double(Register object, | 519 void LoadNumberAsInt32Double(Register object, |
515 DwVfpRegister double_dst, | 520 DwVfpRegister double_dst, |
516 Register heap_number_map, | 521 Register heap_number_map, |
517 Register scratch, | 522 Register scratch, |
518 DwVfpRegister double_scratch, | 523 LowDwVfpRegister double_scratch, |
519 Label* not_int32); | 524 Label* not_int32); |
520 | 525 |
521 // Loads the number from object into dst as a 32-bit integer. | 526 // Loads the number from object into dst as a 32-bit integer. |
522 // Control will jump to not_int32 if the object cannot be exactly represented | 527 // Control will jump to not_int32 if the object cannot be exactly represented |
523 // by a 32-bit integer. | 528 // by a 32-bit integer. |
524 // Floating point value in the 32-bit integer range that are not exact integer | 529 // Floating point value in the 32-bit integer range that are not exact integer |
525 // won't be converted. | 530 // won't be converted. |
526 void LoadNumberAsInt32(Register object, | 531 void LoadNumberAsInt32(Register object, |
527 Register dst, | 532 Register dst, |
528 Register heap_number_map, | 533 Register heap_number_map, |
529 Register scratch, | 534 Register scratch, |
530 DwVfpRegister double_scratch0, | 535 DwVfpRegister double_scratch0, |
531 DwVfpRegister double_scratch1, | 536 LowDwVfpRegister double_scratch1, |
532 Label* not_int32); | 537 Label* not_int32); |
533 | 538 |
534 | 539 |
535 // Enter exit frame. | 540 // Enter exit frame. |
536 // stack_space - extra stack space, used for alignment before call to C. | 541 // stack_space - extra stack space, used for alignment before call to C. |
537 void EnterExitFrame(bool save_doubles, int stack_space = 0); | 542 void EnterExitFrame(bool save_doubles, int stack_space = 0); |
538 | 543 |
539 // Leave the current exit frame. Expects the return value in r0. | 544 // Leave the current exit frame. Expects the return value in r0. |
540 // Expect the number of values, pushed prior to the exit frame, to | 545 // Expect the number of values, pushed prior to the exit frame, to |
541 // remove in a register (or no_reg, if there is nothing to remove). | 546 // remove in a register (or no_reg, if there is nothing to remove). |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
789 void AllocateHeapNumberWithValue(Register result, | 794 void AllocateHeapNumberWithValue(Register result, |
790 DwVfpRegister value, | 795 DwVfpRegister value, |
791 Register scratch1, | 796 Register scratch1, |
792 Register scratch2, | 797 Register scratch2, |
793 Register heap_number_map, | 798 Register heap_number_map, |
794 Label* gc_required); | 799 Label* gc_required); |
795 | 800 |
796 // Copies a fixed number of fields of heap objects from src to dst. | 801 // Copies a fixed number of fields of heap objects from src to dst. |
797 void CopyFields(Register dst, | 802 void CopyFields(Register dst, |
798 Register src, | 803 Register src, |
799 DwVfpRegister double_scratch, | 804 LowDwVfpRegister double_scratch, |
800 SwVfpRegister single_scratch, | |
801 int field_count); | 805 int field_count); |
802 | 806 |
803 // Copies a number of bytes from src to dst. All registers are clobbered. On | 807 // Copies a number of bytes from src to dst. All registers are clobbered. On |
804 // exit src and dst will point to the place just after where the last byte was | 808 // exit src and dst will point to the place just after where the last byte was |
805 // read or written and length will be zero. | 809 // read or written and length will be zero. |
806 void CopyBytes(Register src, | 810 void CopyBytes(Register src, |
807 Register dst, | 811 Register dst, |
808 Register length, | 812 Register length, |
809 Register scratch); | 813 Register scratch); |
810 | 814 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
867 Register scratch, | 871 Register scratch, |
868 Label* fail); | 872 Label* fail); |
869 | 873 |
870 // Check to see if maybe_number can be stored as a double in | 874 // Check to see if maybe_number can be stored as a double in |
871 // FastDoubleElements. If it can, store it at the index specified by key in | 875 // FastDoubleElements. If it can, store it at the index specified by key in |
872 // the FastDoubleElements array elements. Otherwise jump to fail. | 876 // the FastDoubleElements array elements. Otherwise jump to fail. |
873 void StoreNumberToDoubleElements(Register value_reg, | 877 void StoreNumberToDoubleElements(Register value_reg, |
874 Register key_reg, | 878 Register key_reg, |
875 Register elements_reg, | 879 Register elements_reg, |
876 Register scratch1, | 880 Register scratch1, |
881 LowDwVfpRegister double_scratch0, | |
ulan
2013/07/25 11:49:54
double_scratch would be more consistent with the r
| |
877 Label* fail, | 882 Label* fail, |
878 int elements_offset = 0); | 883 int elements_offset = 0); |
879 | 884 |
880 // Compare an object's map with the specified map and its transitioned | 885 // Compare an object's map with the specified map and its transitioned |
881 // elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. Condition flags are | 886 // elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. Condition flags are |
882 // set with result of map compare. If multiple map compares are required, the | 887 // set with result of map compare. If multiple map compares are required, the |
883 // compare sequences branches to early_success. | 888 // compare sequences branches to early_success. |
884 void CompareMap(Register obj, | 889 void CompareMap(Register obj, |
885 Register scratch, | 890 Register scratch, |
886 Handle<Map> map, | 891 Handle<Map> map, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
950 // hash - holds the index's hash. Clobbered. | 955 // hash - holds the index's hash. Clobbered. |
951 // index - holds the overwritten index on exit. | 956 // index - holds the overwritten index on exit. |
952 void IndexFromHash(Register hash, Register index); | 957 void IndexFromHash(Register hash, Register index); |
953 | 958 |
954 // Get the number of least significant bits from a register | 959 // Get the number of least significant bits from a register |
955 void GetLeastBitsFromSmi(Register dst, Register src, int num_least_bits); | 960 void GetLeastBitsFromSmi(Register dst, Register src, int num_least_bits); |
956 void GetLeastBitsFromInt32(Register dst, Register src, int mun_least_bits); | 961 void GetLeastBitsFromInt32(Register dst, Register src, int mun_least_bits); |
957 | 962 |
958 // Load the value of a smi object into a double register. | 963 // Load the value of a smi object into a double register. |
959 // The register value must be between d0 and d15. | 964 // The register value must be between d0 and d15. |
960 void SmiToDouble(DwVfpRegister value, Register smi); | 965 void SmiToDouble(LowDwVfpRegister value, Register smi); |
961 | 966 |
962 // Check if a double can be exactly represented as a signed 32-bit integer. | 967 // Check if a double can be exactly represented as a signed 32-bit integer. |
963 // Z flag set to one if true. | 968 // Z flag set to one if true. |
964 void TestDoubleIsInt32(DwVfpRegister double_input, | 969 void TestDoubleIsInt32(DwVfpRegister double_input, |
965 DwVfpRegister double_scratch); | 970 LowDwVfpRegister double_scratch); |
966 | 971 |
967 // Try to convert a double to a signed 32-bit integer. | 972 // Try to convert a double to a signed 32-bit integer. |
968 // Z flag set to one and result assigned if the conversion is exact. | 973 // Z flag set to one and result assigned if the conversion is exact. |
969 void TryDoubleToInt32Exact(Register result, | 974 void TryDoubleToInt32Exact(Register result, |
970 DwVfpRegister double_input, | 975 DwVfpRegister double_input, |
971 DwVfpRegister double_scratch); | 976 LowDwVfpRegister double_scratch); |
972 | 977 |
973 // Floor a double and writes the value to the result register. | 978 // Floor a double and writes the value to the result register. |
974 // Go to exact if the conversion is exact (to be able to test -0), | 979 // Go to exact if the conversion is exact (to be able to test -0), |
975 // fall through calling code if an overflow occurred, else go to done. | 980 // fall through calling code if an overflow occurred, else go to done. |
981 // In return, input_high is loaded with high bits of input. | |
976 void TryInt32Floor(Register result, | 982 void TryInt32Floor(Register result, |
977 DwVfpRegister double_input, | 983 DwVfpRegister double_input, |
978 Register input_high, | 984 Register input_high, |
979 DwVfpRegister double_scratch, | 985 LowDwVfpRegister double_scratch, |
980 Label* done, | 986 Label* done, |
981 Label* exact); | 987 Label* exact); |
982 | 988 |
983 // Performs a truncating conversion of a floating point number as used by | 989 // Performs a truncating conversion of a floating point number as used by |
984 // the JS bitwise operations. See ECMA-262 9.5: ToInt32. | 990 // the JS bitwise operations. See ECMA-262 9.5: ToInt32. |
985 // Double_scratch must be between d0 and d15. | 991 // Double_scratch must be between d0 and d15. |
986 // Exits with 'result' holding the answer and all other registers clobbered. | 992 // Exits with 'result' holding the answer and all other registers clobbered. |
987 void ECMAToInt32(Register result, | 993 void ECMAToInt32(Register result, |
988 DwVfpRegister double_input, | 994 DwVfpRegister double_input, |
989 Register scratch, | 995 Register scratch, |
990 Register scratch_high, | 996 Register scratch_high, |
991 Register scratch_low, | 997 Register scratch_low, |
992 DwVfpRegister double_scratch); | 998 LowDwVfpRegister double_scratch); |
993 | 999 |
994 // Check whether d16-d31 are available on the CPU. The result is given by the | 1000 // Check whether d16-d31 are available on the CPU. The result is given by the |
995 // Z condition flag: Z==0 if d16-d31 available, Z==1 otherwise. | 1001 // Z condition flag: Z==0 if d16-d31 available, Z==1 otherwise. |
996 void CheckFor32DRegs(Register scratch); | 1002 void CheckFor32DRegs(Register scratch); |
997 | 1003 |
998 // Does a runtime check for 16/32 FP registers. Either way, pushes 32 double | 1004 // Does a runtime check for 16/32 FP registers. Either way, pushes 32 double |
999 // values to location, saving [d0..(d15|d31)]. | 1005 // values to location, saving [d0..(d15|d31)]. |
1000 void SaveFPRegs(Register location, Register scratch); | 1006 void SaveFPRegs(Register location, Register scratch); |
1001 | 1007 |
1002 // Does a runtime check for 16/32 FP registers. Either way, pops 32 double | 1008 // Does a runtime check for 16/32 FP registers. Either way, pops 32 double |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1304 // Get the location of a relocated constant (its address in the constant pool) | 1310 // Get the location of a relocated constant (its address in the constant pool) |
1305 // from its load site. | 1311 // from its load site. |
1306 void GetRelocatedValueLocation(Register ldr_location, | 1312 void GetRelocatedValueLocation(Register ldr_location, |
1307 Register result); | 1313 Register result); |
1308 | 1314 |
1309 | 1315 |
1310 void ClampUint8(Register output_reg, Register input_reg); | 1316 void ClampUint8(Register output_reg, Register input_reg); |
1311 | 1317 |
1312 void ClampDoubleToUint8(Register result_reg, | 1318 void ClampDoubleToUint8(Register result_reg, |
1313 DwVfpRegister input_reg, | 1319 DwVfpRegister input_reg, |
1314 DwVfpRegister temp_double_reg); | 1320 LowDwVfpRegister temp_double_reg); |
ulan
2013/07/25 11:49:54
double_scratch would be more consistent with the r
| |
1315 | 1321 |
1316 | 1322 |
1317 void LoadInstanceDescriptors(Register map, Register descriptors); | 1323 void LoadInstanceDescriptors(Register map, Register descriptors); |
1318 void EnumLength(Register dst, Register map); | 1324 void EnumLength(Register dst, Register map); |
1319 void NumberOfOwnDescriptors(Register dst, Register map); | 1325 void NumberOfOwnDescriptors(Register dst, Register map); |
1320 | 1326 |
1321 template<typename Field> | 1327 template<typename Field> |
1322 void DecodeField(Register reg) { | 1328 void DecodeField(Register reg) { |
1323 static const int shift = Field::kShift; | 1329 static const int shift = Field::kShift; |
1324 static const int mask = (Field::kMask >> shift) << kSmiTagSize; | 1330 static const int mask = (Field::kMask >> shift) << kSmiTagSize; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1450 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1456 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1451 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1457 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1452 #else | 1458 #else |
1453 #define ACCESS_MASM(masm) masm-> | 1459 #define ACCESS_MASM(masm) masm-> |
1454 #endif | 1460 #endif |
1455 | 1461 |
1456 | 1462 |
1457 } } // namespace v8::internal | 1463 } } // namespace v8::internal |
1458 | 1464 |
1459 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 1465 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |