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

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: 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
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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 // Compute memory operands for safepoint stack slots. 786 // Compute memory operands for safepoint stack slots.
787 Operand SafepointRegisterSlot(Register reg); 787 Operand SafepointRegisterSlot(Register reg);
788 static int SafepointRegisterStackIndex(int reg_code); 788 static int SafepointRegisterStackIndex(int reg_code);
789 789
790 // Needs access to SafepointRegisterStackIndex for optimized frame 790 // Needs access to SafepointRegisterStackIndex for optimized frame
791 // traversal. 791 // traversal.
792 friend class OptimizedFrame; 792 friend class OptimizedFrame;
793 }; 793 };
794 794
795 795
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 796 // 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 797 // 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 798 // 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 799 // relocation information. If any of these constraints are violated it causes
831 // an assertion. 800 // an assertion.
832 class CodePatcher { 801 class CodePatcher {
833 public: 802 public:
834 CodePatcher(byte* address, int size); 803 CodePatcher(byte* address, int size);
835 virtual ~CodePatcher(); 804 virtual ~CodePatcher();
836 805
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 } \ 863 } \
895 masm-> 864 masm->
896 #else 865 #else
897 #define ACCESS_MASM(masm) masm-> 866 #define ACCESS_MASM(masm) masm->
898 #endif 867 #endif
899 868
900 869
901 } } // namespace v8::internal 870 } } // namespace v8::internal
902 871
903 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ 872 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698