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

Side by Side Diff: src/assembler.cc

Issue 1477343002: Pass an isolate to RelocInfo (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years 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
« no previous file with comments | « src/assembler.h ('k') | src/debug/debug.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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 if (SetMode(RelocInfo::CODE_AGE_SEQUENCE)) { 734 if (SetMode(RelocInfo::CODE_AGE_SEQUENCE)) {
735 rinfo_.data_ = 0; 735 rinfo_.data_ = 0;
736 rinfo_.pc_ = old_code_age_sequence; 736 rinfo_.pc_ = old_code_age_sequence;
737 return; 737 return;
738 } 738 }
739 } 739 }
740 done_ = true; 740 done_ = true;
741 } 741 }
742 742
743 743
744 RelocIterator::RelocIterator(Code* code, int mode_mask) { 744 RelocIterator::RelocIterator(Code* code, int mode_mask)
745 : rinfo_(code->map()->GetIsolate()) {
745 rinfo_.host_ = code; 746 rinfo_.host_ = code;
746 rinfo_.pc_ = code->instruction_start(); 747 rinfo_.pc_ = code->instruction_start();
747 rinfo_.data_ = 0; 748 rinfo_.data_ = 0;
748 // Relocation info is read backwards. 749 // Relocation info is read backwards.
749 pos_ = code->relocation_start() + code->relocation_size(); 750 pos_ = code->relocation_start() + code->relocation_size();
750 end_ = code->relocation_start(); 751 end_ = code->relocation_start();
751 done_ = false; 752 done_ = false;
752 mode_mask_ = mode_mask; 753 mode_mask_ = mode_mask;
753 last_id_ = 0; 754 last_id_ = 0;
754 last_position_ = 0; 755 last_position_ = 0;
755 byte* sequence = code->FindCodeAgeSequence(); 756 byte* sequence = code->FindCodeAgeSequence();
756 // We get the isolate from the map, because at serialization time 757 // We get the isolate from the map, because at serialization time
757 // the code pointer has been cloned and isn't really in heap space. 758 // the code pointer has been cloned and isn't really in heap space.
758 Isolate* isolate = code->map()->GetIsolate(); 759 Isolate* isolate = code->map()->GetIsolate();
759 if (sequence != NULL && !Code::IsYoungSequence(isolate, sequence)) { 760 if (sequence != NULL && !Code::IsYoungSequence(isolate, sequence)) {
760 code_age_sequence_ = sequence; 761 code_age_sequence_ = sequence;
761 } else { 762 } else {
762 code_age_sequence_ = NULL; 763 code_age_sequence_ = NULL;
763 } 764 }
764 if (mode_mask_ == 0) pos_ = end_; 765 if (mode_mask_ == 0) pos_ = end_;
765 next(); 766 next();
766 } 767 }
767 768
768 769
769 RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask) { 770 RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask)
771 : rinfo_(desc.origin->isolate()) {
770 rinfo_.pc_ = desc.buffer; 772 rinfo_.pc_ = desc.buffer;
771 rinfo_.data_ = 0; 773 rinfo_.data_ = 0;
772 // Relocation info is read backwards. 774 // Relocation info is read backwards.
773 pos_ = desc.buffer + desc.buffer_size; 775 pos_ = desc.buffer + desc.buffer_size;
774 end_ = pos_ - desc.reloc_size; 776 end_ = pos_ - desc.reloc_size;
775 done_ = false; 777 done_ = false;
776 mode_mask_ = mode_mask; 778 mode_mask_ = mode_mask;
777 last_id_ = 0; 779 last_id_ = 0;
778 last_position_ = 0; 780 last_position_ = 0;
779 code_age_sequence_ = NULL; 781 code_age_sequence_ = NULL;
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1906 1908
1907 1909
1908 void Assembler::DataAlign(int m) { 1910 void Assembler::DataAlign(int m) {
1909 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); 1911 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m));
1910 while ((pc_offset() & (m - 1)) != 0) { 1912 while ((pc_offset() & (m - 1)) != 0) {
1911 db(0); 1913 db(0);
1912 } 1914 }
1913 } 1915 }
1914 } // namespace internal 1916 } // namespace internal
1915 } // namespace v8 1917 } // namespace v8
OLDNEW
« no previous file with comments | « src/assembler.h ('k') | src/debug/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698