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 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 Register key, | 1005 Register key, |
1006 Register r0, | 1006 Register r0, |
1007 Register r1, | 1007 Register r1, |
1008 Register r2, | 1008 Register r2, |
1009 Register result); | 1009 Register result); |
1010 | 1010 |
1011 | 1011 |
1012 // --------------------------------------------------------------------------- | 1012 // --------------------------------------------------------------------------- |
1013 // Allocation support | 1013 // Allocation support |
1014 | 1014 |
1015 // Allocate an object in new space. If the new space is exhausted control | 1015 // Allocate an object in new space or old pointer space. If the given space |
1016 // continues at the gc_required label. The allocated object is returned in | 1016 // is exhausted control continues at the gc_required label. The allocated |
1017 // result and end of the new object is returned in result_end. The register | 1017 // object is returned in result and end of the new object is returned in |
1018 // scratch can be passed as no_reg in which case an additional object | 1018 // result_end. The register scratch can be passed as no_reg in which case |
1019 // reference will be added to the reloc info. The returned pointers in result | 1019 // an additional object reference will be added to the reloc info. The |
1020 // and result_end have not yet been tagged as heap objects. If | 1020 // returned pointers in result and result_end have not yet been tagged as |
1021 // result_contains_top_on_entry is true the content of result is known to be | 1021 // heap objects. If result_contains_top_on_entry is true the content of |
1022 // the allocation top on entry (could be result_end from a previous call to | 1022 // result is known to be the allocation top on entry (could be result_end |
1023 // AllocateInNewSpace). If result_contains_top_on_entry is true scratch | 1023 // from a previous call). If result_contains_top_on_entry is true scratch |
1024 // should be no_reg as it is never used. | 1024 // should be no_reg as it is never used. |
1025 void AllocateInNewSpace(int object_size, | 1025 enum AllocationTarget { |
1026 Register result, | 1026 NEW_SPACE, |
1027 Register result_end, | 1027 OLD_POINTER_SPACE |
1028 Register scratch, | 1028 }; |
1029 Label* gc_required, | 1029 |
1030 AllocationFlags flags); | 1030 void Allocate(int object_size, |
| 1031 Register result, |
| 1032 Register result_end, |
| 1033 Register scratch, |
| 1034 Label* gc_required, |
| 1035 AllocationFlags flags, |
| 1036 AllocationTarget target); |
1031 | 1037 |
1032 void AllocateInNewSpace(int header_size, | 1038 void AllocateInNewSpace(int header_size, |
1033 ScaleFactor element_size, | 1039 ScaleFactor element_size, |
1034 Register element_count, | 1040 Register element_count, |
1035 Register result, | 1041 Register result, |
1036 Register result_end, | 1042 Register result_end, |
1037 Register scratch, | 1043 Register scratch, |
1038 Label* gc_required, | 1044 Label* gc_required, |
1039 AllocationFlags flags); | 1045 AllocationFlags flags); |
1040 | 1046 |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 CallKind call_kind = CALL_AS_METHOD); | 1367 CallKind call_kind = CALL_AS_METHOD); |
1362 | 1368 |
1363 void EnterExitFramePrologue(bool save_rax); | 1369 void EnterExitFramePrologue(bool save_rax); |
1364 | 1370 |
1365 // Allocates arg_stack_space * kPointerSize memory (not GCed) on the stack | 1371 // Allocates arg_stack_space * kPointerSize memory (not GCed) on the stack |
1366 // accessible via StackSpaceOperand. | 1372 // accessible via StackSpaceOperand. |
1367 void EnterExitFrameEpilogue(int arg_stack_space, bool save_doubles); | 1373 void EnterExitFrameEpilogue(int arg_stack_space, bool save_doubles); |
1368 | 1374 |
1369 void LeaveExitFrameEpilogue(); | 1375 void LeaveExitFrameEpilogue(); |
1370 | 1376 |
| 1377 ExternalReference GetTopAddress(AllocationTarget target); |
| 1378 ExternalReference GetLimitAddress(AllocationTarget target); |
| 1379 |
1371 // Allocation support helpers. | 1380 // Allocation support helpers. |
1372 // Loads the top of new-space into the result register. | 1381 // Loads the top of new-space into the result register. |
1373 // Otherwise the address of the new-space top is loaded into scratch (if | 1382 // Otherwise the address of the new-space top is loaded into scratch (if |
1374 // scratch is valid), and the new-space top is loaded into result. | 1383 // scratch is valid), and the new-space top is loaded into result. |
1375 void LoadAllocationTopHelper(Register result, | 1384 void LoadAllocationTopHelper(Register result, |
1376 Register scratch, | 1385 Register scratch, |
1377 AllocationFlags flags); | 1386 AllocationFlags flags, |
| 1387 AllocationTarget target); |
1378 // Update allocation top with value in result_end register. | 1388 // Update allocation top with value in result_end register. |
1379 // If scratch is valid, it contains the address of the allocation top. | 1389 // If scratch is valid, it contains the address of the allocation top. |
1380 void UpdateAllocationTopHelper(Register result_end, Register scratch); | 1390 void UpdateAllocationTopHelper(Register result_end, |
| 1391 Register scratch, |
| 1392 AllocationTarget target); |
1381 | 1393 |
1382 // Helper for PopHandleScope. Allowed to perform a GC and returns | 1394 // Helper for PopHandleScope. Allowed to perform a GC and returns |
1383 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and | 1395 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and |
1384 // possibly returns a failure object indicating an allocation failure. | 1396 // possibly returns a failure object indicating an allocation failure. |
1385 Object* PopHandleScopeHelper(Register saved, | 1397 Object* PopHandleScopeHelper(Register saved, |
1386 Register scratch, | 1398 Register scratch, |
1387 bool gc_allowed); | 1399 bool gc_allowed); |
1388 | 1400 |
1389 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace. | 1401 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace. |
1390 void InNewSpace(Register object, | 1402 void InNewSpace(Register object, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 masm->popfq(); \ | 1505 masm->popfq(); \ |
1494 } \ | 1506 } \ |
1495 masm-> | 1507 masm-> |
1496 #else | 1508 #else |
1497 #define ACCESS_MASM(masm) masm-> | 1509 #define ACCESS_MASM(masm) masm-> |
1498 #endif | 1510 #endif |
1499 | 1511 |
1500 } } // namespace v8::internal | 1512 } } // namespace v8::internal |
1501 | 1513 |
1502 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1514 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |