OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 enum RememberedSetFinalAction { | 273 enum RememberedSetFinalAction { |
274 kReturnAtEnd, | 274 kReturnAtEnd, |
275 kFallThroughAtEnd | 275 kFallThroughAtEnd |
276 }; | 276 }; |
277 | 277 |
278 | 278 |
279 // Record in the remembered set the fact that we have a pointer to new space | 279 // Record in the remembered set the fact that we have a pointer to new space |
280 // at the address pointed to by the addr register. Only works if addr is not | 280 // at the address pointed to by the addr register. Only works if addr is not |
281 // in new space. | 281 // in new space. |
282 void RememberedSetHelper(Register addr, | 282 void RememberedSetHelper(Register object, // Used for debug code. |
| 283 Register addr, |
283 Register scratch, | 284 Register scratch, |
284 SaveFPRegsMode save_fp, | 285 SaveFPRegsMode save_fp, |
285 RememberedSetFinalAction and_then); | 286 RememberedSetFinalAction and_then); |
286 | 287 |
287 void CheckPageFlag(Register object, | 288 void CheckPageFlag(Register object, |
288 Register scratch, | 289 Register scratch, |
289 int mask, | 290 int mask, |
290 Condition cc, | 291 Condition cc, |
291 Label* condition_met); | 292 Label* condition_met); |
292 | 293 |
293 // Check if object is in new space. Jumps if the object is not in new space. | 294 // Check if object is in new space. Jumps if the object is not in new space. |
294 // The register scratch can be object itself, but it will be clobbered. | 295 // The register scratch can be object itself, but it will be clobbered. |
295 void JumpIfNotInNewSpace(Register object, | 296 void JumpIfNotInNewSpace(Register object, |
296 Register scratch, | 297 Register scratch, |
297 Label* branch) { | 298 Label* branch) { |
298 InNewSpace(object, scratch, ne, branch); | 299 InNewSpace(object, scratch, ne, branch); |
299 } | 300 } |
300 | 301 |
301 // Check if object is in new space. Jumps if the object is in new space. | 302 // Check if object is in new space. Jumps if the object is in new space. |
302 // The register scratch can be object itself, but it will be clobbered. | 303 // The register scratch can be object itself, but scratch will be clobbered. |
303 void JumpIfInNewSpace(Register object, | 304 void JumpIfInNewSpace(Register object, |
304 Register scratch, | 305 Register scratch, |
305 Label* branch) { | 306 Label* branch) { |
306 InNewSpace(object, scratch, eq, branch); | 307 InNewSpace(object, scratch, eq, branch); |
307 } | 308 } |
308 | 309 |
309 // Check if an object has a given incremental marking color. | 310 // Check if an object has a given incremental marking color. |
310 void HasColor(Register object, | 311 void HasColor(Register object, |
311 Register scratch0, | 312 Register scratch0, |
312 Register scratch1, | 313 Register scratch1, |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 void CopyFields(Register dst, Register src, RegList temps, int field_count); | 862 void CopyFields(Register dst, Register src, RegList temps, int field_count); |
862 | 863 |
863 // Copies a number of bytes from src to dst. All registers are clobbered. On | 864 // Copies a number of bytes from src to dst. All registers are clobbered. On |
864 // exit src and dst will point to the place just after where the last byte was | 865 // exit src and dst will point to the place just after where the last byte was |
865 // read or written and length will be zero. | 866 // read or written and length will be zero. |
866 void CopyBytes(Register src, | 867 void CopyBytes(Register src, |
867 Register dst, | 868 Register dst, |
868 Register length, | 869 Register length, |
869 Register scratch); | 870 Register scratch); |
870 | 871 |
| 872 // Initialize fields with filler values. Fields starting at |start_offset| |
| 873 // not including end_offset are overwritten with the value in |filler|. At |
| 874 // the end the loop, |start_offset| takes the value of |end_offset|. |
| 875 void InitializeFieldsWithFiller(Register start_offset, |
| 876 Register end_offset, |
| 877 Register filler); |
| 878 |
871 // ------------------------------------------------------------------------- | 879 // ------------------------------------------------------------------------- |
872 // Support functions. | 880 // Support functions. |
873 | 881 |
874 // Try to get function prototype of a function and puts the value in | 882 // Try to get function prototype of a function and puts the value in |
875 // the result register. Checks that the function really is a | 883 // the result register. Checks that the function really is a |
876 // function and jumps to the miss label if the fast checks fail. The | 884 // function and jumps to the miss label if the fast checks fail. The |
877 // function register will be untouched; the other registers may be | 885 // function register will be untouched; the other registers may be |
878 // clobbered. | 886 // clobbered. |
879 void TryGetFunctionPrototype(Register function, | 887 void TryGetFunctionPrototype(Register function, |
880 Register result, | 888 Register result, |
881 Register scratch, | 889 Register scratch, |
882 Label* miss); | 890 Label* miss); |
883 | 891 |
884 void GetObjectType(Register function, | 892 void GetObjectType(Register function, |
885 Register map, | 893 Register map, |
886 Register type_reg); | 894 Register type_reg); |
887 | 895 |
888 // Check if a map for a JSObject indicates that the object has fast elements. | 896 // Check if a map for a JSObject indicates that the object has fast elements. |
889 // Jump to the specified label if it does not. | 897 // Jump to the specified label if it does not. |
890 void CheckFastElements(Register map, | 898 void CheckFastElements(Register map, |
891 Register scratch, | 899 Register scratch, |
892 Label* fail); | 900 Label* fail); |
893 | 901 |
| 902 // Check if a map for a JSObject indicates that the object can have both smi |
| 903 // and HeapObject elements. Jump to the specified label if it does not. |
| 904 void CheckFastObjectElements(Register map, |
| 905 Register scratch, |
| 906 Label* fail); |
| 907 |
| 908 // Check if a map for a JSObject indicates that the object has fast smi only |
| 909 // elements. Jump to the specified label if it does not. |
| 910 void CheckFastSmiOnlyElements(Register map, |
| 911 Register scratch, |
| 912 Label* fail); |
| 913 |
| 914 // Check to see if maybe_number can be stored as a double in |
| 915 // FastDoubleElements. If it can, store it at the index specified by key in |
| 916 // the FastDoubleElements array elements, otherwise jump to fail. |
| 917 void StoreNumberToDoubleElements(Register value_reg, |
| 918 Register key_reg, |
| 919 Register receiver_reg, |
| 920 Register elements_reg, |
| 921 Register scratch1, |
| 922 Register scratch2, |
| 923 Register scratch3, |
| 924 Register scratch4, |
| 925 Label* fail); |
| 926 |
894 // Check if the map of an object is equal to a specified map (either | 927 // Check if the map of an object is equal to a specified map (either |
895 // given directly or as an index into the root list) and branch to | 928 // given directly or as an index into the root list) and branch to |
896 // label if not. Skip the smi check if not required (object is known | 929 // label if not. Skip the smi check if not required (object is known |
897 // to be a heap object). | 930 // to be a heap object). |
898 void CheckMap(Register obj, | 931 void CheckMap(Register obj, |
899 Register scratch, | 932 Register scratch, |
900 Handle<Map> map, | 933 Handle<Map> map, |
901 Label* fail, | 934 Label* fail, |
902 SmiCheckType smi_check_type); | 935 SmiCheckType smi_check_type); |
903 | 936 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 // Arguments 1-4 are placed in registers a0 thru a3 respectively. | 1114 // Arguments 1-4 are placed in registers a0 thru a3 respectively. |
1082 // Arguments 5..n are stored to stack using following: | 1115 // Arguments 5..n are stored to stack using following: |
1083 // sw(t0, CFunctionArgumentOperand(5)); | 1116 // sw(t0, CFunctionArgumentOperand(5)); |
1084 | 1117 |
1085 // Calls a C function and cleans up the space for arguments allocated | 1118 // Calls a C function and cleans up the space for arguments allocated |
1086 // by PrepareCallCFunction. The called function is not allowed to trigger a | 1119 // by PrepareCallCFunction. The called function is not allowed to trigger a |
1087 // garbage collection, since that might move the code and invalidate the | 1120 // garbage collection, since that might move the code and invalidate the |
1088 // return address (unless this is somehow accounted for by the called | 1121 // return address (unless this is somehow accounted for by the called |
1089 // function). | 1122 // function). |
1090 void CallCFunction(ExternalReference function, int num_arguments); | 1123 void CallCFunction(ExternalReference function, int num_arguments); |
1091 void CallCFunction(Register function, Register scratch, int num_arguments); | 1124 void CallCFunction(Register function, int num_arguments); |
1092 void CallCFunction(ExternalReference function, | 1125 void CallCFunction(ExternalReference function, |
1093 int num_reg_arguments, | 1126 int num_reg_arguments, |
1094 int num_double_arguments); | 1127 int num_double_arguments); |
1095 void CallCFunction(Register function, Register scratch, | 1128 void CallCFunction(Register function, |
1096 int num_reg_arguments, | 1129 int num_reg_arguments, |
1097 int num_double_arguments); | 1130 int num_double_arguments); |
1098 void GetCFunctionDoubleResult(const DoubleRegister dst); | 1131 void GetCFunctionDoubleResult(const DoubleRegister dst); |
1099 | 1132 |
1100 // There are two ways of passing double arguments on MIPS, depending on | 1133 // There are two ways of passing double arguments on MIPS, depending on |
1101 // whether soft or hard floating point ABI is used. These functions | 1134 // whether soft or hard floating point ABI is used. These functions |
1102 // abstract parameter passing for the three different ways we call | 1135 // abstract parameter passing for the three different ways we call |
1103 // C functions from generated code. | 1136 // C functions from generated code. |
1104 void SetCallCDoubleArguments(DoubleRegister dreg); | 1137 void SetCallCDoubleArguments(DoubleRegister dreg); |
1105 void SetCallCDoubleArguments(DoubleRegister dreg1, DoubleRegister dreg2); | 1138 void SetCallCDoubleArguments(DoubleRegister dreg1, DoubleRegister dreg2); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 void EnterFrame(StackFrame::Type type); | 1342 void EnterFrame(StackFrame::Type type); |
1310 void LeaveFrame(StackFrame::Type type); | 1343 void LeaveFrame(StackFrame::Type type); |
1311 | 1344 |
1312 // Patch the relocated value (lui/ori pair). | 1345 // Patch the relocated value (lui/ori pair). |
1313 void PatchRelocatedValue(Register li_location, | 1346 void PatchRelocatedValue(Register li_location, |
1314 Register scratch, | 1347 Register scratch, |
1315 Register new_value); | 1348 Register new_value); |
1316 | 1349 |
1317 private: | 1350 private: |
1318 void CallCFunctionHelper(Register function, | 1351 void CallCFunctionHelper(Register function, |
1319 ExternalReference function_reference, | |
1320 Register scratch, | |
1321 int num_reg_arguments, | 1352 int num_reg_arguments, |
1322 int num_double_arguments); | 1353 int num_double_arguments); |
1323 | 1354 |
1324 void BranchShort(int16_t offset, BranchDelaySlot bdslot = PROTECT); | 1355 void BranchShort(int16_t offset, BranchDelaySlot bdslot = PROTECT); |
1325 void BranchShort(int16_t offset, Condition cond, Register rs, | 1356 void BranchShort(int16_t offset, Condition cond, Register rs, |
1326 const Operand& rt, | 1357 const Operand& rt, |
1327 BranchDelaySlot bdslot = PROTECT); | 1358 BranchDelaySlot bdslot = PROTECT); |
1328 void BranchShort(Label* L, BranchDelaySlot bdslot = PROTECT); | 1359 void BranchShort(Label* L, BranchDelaySlot bdslot = PROTECT); |
1329 void BranchShort(Label* L, Condition cond, Register rs, | 1360 void BranchShort(Label* L, Condition cond, Register rs, |
1330 const Operand& rt, | 1361 const Operand& rt, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1428 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1459 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
1429 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1460 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1430 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1461 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1431 #else | 1462 #else |
1432 #define ACCESS_MASM(masm) masm-> | 1463 #define ACCESS_MASM(masm) masm-> |
1433 #endif | 1464 #endif |
1434 | 1465 |
1435 } } // namespace v8::internal | 1466 } } // namespace v8::internal |
1436 | 1467 |
1437 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1468 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |