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 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 Register key, | 1017 Register key, |
1018 Register r0, | 1018 Register r0, |
1019 Register r1, | 1019 Register r1, |
1020 Register r2, | 1020 Register r2, |
1021 Register result); | 1021 Register result); |
1022 | 1022 |
1023 | 1023 |
1024 // --------------------------------------------------------------------------- | 1024 // --------------------------------------------------------------------------- |
1025 // Allocation support | 1025 // Allocation support |
1026 | 1026 |
1027 // Allocate an object in new space. If the new space is exhausted control | 1027 // Allocate an object in new space or old pointer space. If the given space |
1028 // continues at the gc_required label. The allocated object is returned in | 1028 // is exhausted control continues at the gc_required label. The allocated |
1029 // result and end of the new object is returned in result_end. The register | 1029 // object is returned in result and end of the new object is returned in |
1030 // scratch can be passed as no_reg in which case an additional object | 1030 // result_end. The register scratch can be passed as no_reg in which case |
1031 // reference will be added to the reloc info. The returned pointers in result | 1031 // an additional object reference will be added to the reloc info. The |
1032 // and result_end have not yet been tagged as heap objects. If | 1032 // returned pointers in result and result_end have not yet been tagged as |
1033 // result_contains_top_on_entry is true the content of result is known to be | 1033 // heap objects. If result_contains_top_on_entry is true the content of |
1034 // the allocation top on entry (could be result_end from a previous call to | 1034 // result is known to be the allocation top on entry (could be result_end |
1035 // AllocateInNewSpace). If result_contains_top_on_entry is true scratch | 1035 // from a previous call). If result_contains_top_on_entry is true scratch |
1036 // should be no_reg as it is never used. | 1036 // should be no_reg as it is never used. |
1037 void AllocateInNewSpace(int object_size, | 1037 void Allocate(int object_size, |
1038 Register result, | 1038 Register result, |
1039 Register result_end, | 1039 Register result_end, |
1040 Register scratch, | 1040 Register scratch, |
1041 Label* gc_required, | 1041 Label* gc_required, |
1042 AllocationFlags flags); | 1042 AllocationFlags flags); |
1043 | 1043 |
1044 void AllocateInNewSpace(int header_size, | 1044 void AllocateInNewSpace(int header_size, |
1045 ScaleFactor element_size, | 1045 ScaleFactor element_size, |
1046 Register element_count, | 1046 Register element_count, |
1047 Register result, | 1047 Register result, |
1048 Register result_end, | 1048 Register result_end, |
1049 Register scratch, | 1049 Register scratch, |
1050 Label* gc_required, | 1050 Label* gc_required, |
1051 AllocationFlags flags); | 1051 AllocationFlags flags); |
1052 | 1052 |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 | 1381 |
1382 void LeaveExitFrameEpilogue(); | 1382 void LeaveExitFrameEpilogue(); |
1383 | 1383 |
1384 // Allocation support helpers. | 1384 // Allocation support helpers. |
1385 // Loads the top of new-space into the result register. | 1385 // Loads the top of new-space into the result register. |
1386 // Otherwise the address of the new-space top is loaded into scratch (if | 1386 // Otherwise the address of the new-space top is loaded into scratch (if |
1387 // scratch is valid), and the new-space top is loaded into result. | 1387 // scratch is valid), and the new-space top is loaded into result. |
1388 void LoadAllocationTopHelper(Register result, | 1388 void LoadAllocationTopHelper(Register result, |
1389 Register scratch, | 1389 Register scratch, |
1390 AllocationFlags flags); | 1390 AllocationFlags flags); |
| 1391 |
1391 // Update allocation top with value in result_end register. | 1392 // Update allocation top with value in result_end register. |
1392 // If scratch is valid, it contains the address of the allocation top. | 1393 // If scratch is valid, it contains the address of the allocation top. |
1393 void UpdateAllocationTopHelper(Register result_end, Register scratch); | 1394 void UpdateAllocationTopHelper(Register result_end, |
| 1395 Register scratch, |
| 1396 AllocationFlags flags); |
1394 | 1397 |
1395 // Helper for PopHandleScope. Allowed to perform a GC and returns | 1398 // Helper for PopHandleScope. Allowed to perform a GC and returns |
1396 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and | 1399 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and |
1397 // possibly returns a failure object indicating an allocation failure. | 1400 // possibly returns a failure object indicating an allocation failure. |
1398 Object* PopHandleScopeHelper(Register saved, | 1401 Object* PopHandleScopeHelper(Register saved, |
1399 Register scratch, | 1402 Register scratch, |
1400 bool gc_allowed); | 1403 bool gc_allowed); |
1401 | 1404 |
1402 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace. | 1405 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace. |
1403 void InNewSpace(Register object, | 1406 void InNewSpace(Register object, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 masm->popfq(); \ | 1509 masm->popfq(); \ |
1507 } \ | 1510 } \ |
1508 masm-> | 1511 masm-> |
1509 #else | 1512 #else |
1510 #define ACCESS_MASM(masm) masm-> | 1513 #define ACCESS_MASM(masm) masm-> |
1511 #endif | 1514 #endif |
1512 | 1515 |
1513 } } // namespace v8::internal | 1516 } } // namespace v8::internal |
1514 | 1517 |
1515 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1518 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |