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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 Register key, | 543 Register key, |
544 Register r0, | 544 Register r0, |
545 Register r1, | 545 Register r1, |
546 Register r2, | 546 Register r2, |
547 Register result); | 547 Register result); |
548 | 548 |
549 | 549 |
550 // --------------------------------------------------------------------------- | 550 // --------------------------------------------------------------------------- |
551 // Allocation support | 551 // Allocation support |
552 | 552 |
553 // Allocate an object in new space. If the new space is exhausted control | 553 // Allocate an object in new space or old pointer space. If the given space |
554 // continues at the gc_required label. The allocated object is returned in | 554 // is exhausted control continues at the gc_required label. The allocated |
555 // result and end of the new object is returned in result_end. The register | 555 // object is returned in result and end of the new object is returned in |
556 // scratch can be passed as no_reg in which case an additional object | 556 // result_end. The register scratch can be passed as no_reg in which case |
557 // reference will be added to the reloc info. The returned pointers in result | 557 // an additional object reference will be added to the reloc info. The |
558 // and result_end have not yet been tagged as heap objects. If | 558 // returned pointers in result and result_end have not yet been tagged as |
559 // result_contains_top_on_entry is true the content of result is known to be | 559 // heap objects. If result_contains_top_on_entry is true the content of |
560 // the allocation top on entry (could be result_end from a previous call to | 560 // result is known to be the allocation top on entry (could be result_end |
561 // AllocateInNewSpace). If result_contains_top_on_entry is true scratch | 561 // from a previous call). If result_contains_top_on_entry is true scratch |
562 // should be no_reg as it is never used. | 562 // should be no_reg as it is never used. |
563 void AllocateInNewSpace(int object_size, | 563 enum AllocationTarget { |
564 Register result, | 564 NEW_SPACE, |
565 Register result_end, | 565 OLD_POINTER_SPACE |
566 Register scratch, | 566 }; |
567 Label* gc_required, | 567 |
568 AllocationFlags flags); | 568 void Allocate(int object_size, |
| 569 Register result, |
| 570 Register result_end, |
| 571 Register scratch, |
| 572 Label* gc_required, |
| 573 AllocationFlags flags, |
| 574 AllocationTarget target); |
569 | 575 |
570 void AllocateInNewSpace(int header_size, | 576 void AllocateInNewSpace(int header_size, |
571 ScaleFactor element_size, | 577 ScaleFactor element_size, |
572 Register element_count, | 578 Register element_count, |
573 RegisterValueType element_count_type, | 579 RegisterValueType element_count_type, |
574 Register result, | 580 Register result, |
575 Register result_end, | 581 Register result_end, |
576 Register scratch, | 582 Register scratch, |
577 Label* gc_required, | 583 Label* gc_required, |
578 AllocationFlags flags); | 584 AllocationFlags flags); |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 InvokeFlag flag, | 891 InvokeFlag flag, |
886 Label::Distance done_distance, | 892 Label::Distance done_distance, |
887 const CallWrapper& call_wrapper = NullCallWrapper(), | 893 const CallWrapper& call_wrapper = NullCallWrapper(), |
888 CallKind call_kind = CALL_AS_METHOD); | 894 CallKind call_kind = CALL_AS_METHOD); |
889 | 895 |
890 void EnterExitFramePrologue(); | 896 void EnterExitFramePrologue(); |
891 void EnterExitFrameEpilogue(int argc, bool save_doubles); | 897 void EnterExitFrameEpilogue(int argc, bool save_doubles); |
892 | 898 |
893 void LeaveExitFrameEpilogue(); | 899 void LeaveExitFrameEpilogue(); |
894 | 900 |
| 901 ExternalReference GetTopAddress(AllocationTarget target); |
| 902 ExternalReference GetLimitAddress(AllocationTarget target); |
| 903 |
895 // Allocation support helpers. | 904 // Allocation support helpers. |
896 void LoadAllocationTopHelper(Register result, | 905 void LoadAllocationTopHelper(Register result, |
897 Register scratch, | 906 Register scratch, |
898 AllocationFlags flags); | 907 AllocationFlags flags, |
899 void UpdateAllocationTopHelper(Register result_end, Register scratch); | 908 AllocationTarget target); |
| 909 |
| 910 void UpdateAllocationTopHelper(Register result_end, |
| 911 Register scratch, |
| 912 AllocationTarget target); |
900 | 913 |
901 // Helper for PopHandleScope. Allowed to perform a GC and returns | 914 // Helper for PopHandleScope. Allowed to perform a GC and returns |
902 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and | 915 // NULL if gc_allowed. Does not perform a GC if !gc_allowed, and |
903 // possibly returns a failure object indicating an allocation failure. | 916 // possibly returns a failure object indicating an allocation failure. |
904 MUST_USE_RESULT MaybeObject* PopHandleScopeHelper(Register saved, | 917 MUST_USE_RESULT MaybeObject* PopHandleScopeHelper(Register saved, |
905 Register scratch, | 918 Register scratch, |
906 bool gc_allowed); | 919 bool gc_allowed); |
907 | 920 |
908 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace. | 921 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace. |
909 void InNewSpace(Register object, | 922 void InNewSpace(Register object, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 } \ | 1017 } \ |
1005 masm-> | 1018 masm-> |
1006 #else | 1019 #else |
1007 #define ACCESS_MASM(masm) masm-> | 1020 #define ACCESS_MASM(masm) masm-> |
1008 #endif | 1021 #endif |
1009 | 1022 |
1010 | 1023 |
1011 } } // namespace v8::internal | 1024 } } // namespace v8::internal |
1012 | 1025 |
1013 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 1026 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |