Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1357)

Side by Side Diff: src/ia32/macro-assembler-ia32.h

Issue 7029030: Use page header information to test for InNewSpace. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Addressed review comments. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/macro-assembler-ia32-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 Register value, 72 Register value,
73 Register address); 73 Register address);
74 74
75 // For page containing |object| mark region covering |addr| dirty. 75 // For page containing |object| mark region covering |addr| dirty.
76 // RememberedSetHelper only works if the object is not in new 76 // RememberedSetHelper only works if the object is not in new
77 // space. 77 // space.
78 void RememberedSetHelper(Register addr, 78 void RememberedSetHelper(Register addr,
79 Register scratch, 79 Register scratch,
80 SaveFPRegsMode save_fp); 80 SaveFPRegsMode save_fp);
81 81
82 // Check if object is in new space.
83 // scratch can be object itself, but it will be clobbered.
84 template <typename LabelType>
85 void InNewSpace(Register object,
86 Register scratch,
87 Condition cc, // equal for new space, not_equal otherwise.
88 LabelType* branch);
89
90 template<typename LabelType> 82 template<typename LabelType>
91 void CheckPageFlag(Register object, 83 void CheckPageFlag(Register object,
92 Register scratch, 84 Register scratch,
93 MemoryChunk::MemoryChunkFlags flag, 85 MemoryChunk::MemoryChunkFlags flag,
94 Condition cc, 86 Condition cc,
95 LabelType* condition_met); 87 LabelType* condition_met);
96 88
97 // Check if an object has a given incremental marking colour. Also uses ecx! 89 // Check if an object has a given incremental marking colour. Also uses ecx!
98 // The colour bits are found by splitting the address at the bit offset 90 // The colour bits are found by splitting the address at the bit offset
99 // indicated by the mask: bits that are zero in the mask are used for the 91 // indicated by the mask: bits that are zero in the mask are used for the
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 // Compute memory operands for safepoint stack slots. 778 // Compute memory operands for safepoint stack slots.
787 Operand SafepointRegisterSlot(Register reg); 779 Operand SafepointRegisterSlot(Register reg);
788 static int SafepointRegisterStackIndex(int reg_code); 780 static int SafepointRegisterStackIndex(int reg_code);
789 781
790 // Needs access to SafepointRegisterStackIndex for optimized frame 782 // Needs access to SafepointRegisterStackIndex for optimized frame
791 // traversal. 783 // traversal.
792 friend class OptimizedFrame; 784 friend class OptimizedFrame;
793 }; 785 };
794 786
795 787
796 template <typename LabelType>
797 void MacroAssembler::InNewSpace(Register object,
798 Register scratch,
799 Condition cc,
800 LabelType* branch) {
801 ASSERT(cc == equal || cc == not_equal);
802 if (Serializer::enabled()) {
803 // Can't do arithmetic on external references if it might get serialized.
804 Move(scratch, object);
805 // The mask isn't really an address. We load it as an external reference in
806 // case the size of the new space is different between the snapshot maker
807 // and the running system.
808 and_(Operand(scratch),
809 Immediate(ExternalReference::new_space_mask(isolate())));
810 cmp(Operand(scratch),
811 Immediate(ExternalReference::new_space_start(isolate())));
812 j(cc, branch);
813 } else {
814 int32_t new_space_start = reinterpret_cast<int32_t>(
815 ExternalReference::new_space_start(isolate()).address());
816 if (object.is(scratch)) {
817 sub(Operand(scratch), Immediate(new_space_start));
818 } else {
819 lea(scratch, Operand(object, -new_space_start));
820 }
821 and_(scratch, isolate()->heap()->NewSpaceMask());
822 j(cc, branch);
823 }
824 }
825
826
827 // The code patcher is used to patch (typically) small parts of code e.g. for 788 // The code patcher is used to patch (typically) small parts of code e.g. for
828 // debugging and other types of instrumentation. When using the code patcher 789 // debugging and other types of instrumentation. When using the code patcher
829 // the exact number of bytes specified must be emitted. Is not legal to emit 790 // the exact number of bytes specified must be emitted. Is not legal to emit
830 // relocation information. If any of these constraints are violated it causes 791 // relocation information. If any of these constraints are violated it causes
831 // an assertion. 792 // an assertion.
832 class CodePatcher { 793 class CodePatcher {
833 public: 794 public:
834 CodePatcher(byte* address, int size); 795 CodePatcher(byte* address, int size);
835 virtual ~CodePatcher(); 796 virtual ~CodePatcher();
836 797
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 } \ 855 } \
895 masm-> 856 masm->
896 #else 857 #else
897 #define ACCESS_MASM(masm) masm-> 858 #define ACCESS_MASM(masm) masm->
898 #endif 859 #endif
899 860
900 861
901 } } // namespace v8::internal 862 } } // namespace v8::internal
902 863
903 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ 864 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/macro-assembler-ia32-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698