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

Side by Side Diff: src/mips/assembler-mips.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/ia32/deoptimizer-ia32.cc ('k') | src/mips/assembler-mips-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 (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 2797 matching lines...) Expand 10 before | Expand all | Expand 10 after
2808 CodeDesc desc; // The new buffer. 2808 CodeDesc desc; // The new buffer.
2809 if (buffer_size_ < 1 * MB) { 2809 if (buffer_size_ < 1 * MB) {
2810 desc.buffer_size = 2*buffer_size_; 2810 desc.buffer_size = 2*buffer_size_;
2811 } else { 2811 } else {
2812 desc.buffer_size = buffer_size_ + 1*MB; 2812 desc.buffer_size = buffer_size_ + 1*MB;
2813 } 2813 }
2814 CHECK_GT(desc.buffer_size, 0); // No overflow. 2814 CHECK_GT(desc.buffer_size, 0); // No overflow.
2815 2815
2816 // Set up new buffer. 2816 // Set up new buffer.
2817 desc.buffer = NewArray<byte>(desc.buffer_size); 2817 desc.buffer = NewArray<byte>(desc.buffer_size);
2818 desc.origin = this;
2818 2819
2819 desc.instr_size = pc_offset(); 2820 desc.instr_size = pc_offset();
2820 desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); 2821 desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
2821 2822
2822 // Copy the data. 2823 // Copy the data.
2823 int pc_delta = desc.buffer - buffer_; 2824 int pc_delta = desc.buffer - buffer_;
2824 int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_); 2825 int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_);
2825 MemMove(desc.buffer, buffer_, desc.instr_size); 2826 MemMove(desc.buffer, buffer_, desc.instr_size);
2826 MemMove(reloc_info_writer.pos() + rc_delta, reloc_info_writer.pos(), 2827 MemMove(reloc_info_writer.pos() + rc_delta, reloc_info_writer.pos(),
2827 desc.reloc_size); 2828 desc.reloc_size);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
2886 void Assembler::emit_code_stub_address(Code* stub) { 2887 void Assembler::emit_code_stub_address(Code* stub) {
2887 CheckBuffer(); 2888 CheckBuffer();
2888 *reinterpret_cast<uint32_t*>(pc_) = 2889 *reinterpret_cast<uint32_t*>(pc_) =
2889 reinterpret_cast<uint32_t>(stub->instruction_start()); 2890 reinterpret_cast<uint32_t>(stub->instruction_start());
2890 pc_ += sizeof(uint32_t); 2891 pc_ += sizeof(uint32_t);
2891 } 2892 }
2892 2893
2893 2894
2894 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { 2895 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
2895 // We do not try to reuse pool constants. 2896 // We do not try to reuse pool constants.
2896 RelocInfo rinfo(pc_, rmode, data, NULL); 2897 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL);
2897 if (rmode >= RelocInfo::COMMENT && 2898 if (rmode >= RelocInfo::COMMENT &&
2898 rmode <= RelocInfo::DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL) { 2899 rmode <= RelocInfo::DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL) {
2899 // Adjust code for new modes. 2900 // Adjust code for new modes.
2900 DCHECK(RelocInfo::IsDebugBreakSlot(rmode) 2901 DCHECK(RelocInfo::IsDebugBreakSlot(rmode)
2901 || RelocInfo::IsComment(rmode) 2902 || RelocInfo::IsComment(rmode)
2902 || RelocInfo::IsPosition(rmode)); 2903 || RelocInfo::IsPosition(rmode));
2903 // These modes do not need an entry in the constant pool. 2904 // These modes do not need an entry in the constant pool.
2904 } 2905 }
2905 if (!RelocInfo::IsNone(rinfo.rmode())) { 2906 if (!RelocInfo::IsNone(rinfo.rmode())) {
2906 // Don't record external references unless the heap will be serialized. 2907 // Don't record external references unless the heap will be serialized.
2907 if (rmode == RelocInfo::EXTERNAL_REFERENCE && 2908 if (rmode == RelocInfo::EXTERNAL_REFERENCE &&
2908 !serializer_enabled() && !emit_debug_code()) { 2909 !serializer_enabled() && !emit_debug_code()) {
2909 return; 2910 return;
2910 } 2911 }
2911 DCHECK(buffer_space() >= kMaxRelocSize); // Too late to grow buffer here. 2912 DCHECK(buffer_space() >= kMaxRelocSize); // Too late to grow buffer here.
2912 if (rmode == RelocInfo::CODE_TARGET_WITH_ID) { 2913 if (rmode == RelocInfo::CODE_TARGET_WITH_ID) {
2913 RelocInfo reloc_info_with_ast_id(pc_, 2914 RelocInfo reloc_info_with_ast_id(isolate(), pc_, rmode,
2914 rmode, 2915 RecordedAstId().ToInt(), NULL);
2915 RecordedAstId().ToInt(),
2916 NULL);
2917 ClearRecordedAstId(); 2916 ClearRecordedAstId();
2918 reloc_info_writer.Write(&reloc_info_with_ast_id); 2917 reloc_info_writer.Write(&reloc_info_with_ast_id);
2919 } else { 2918 } else {
2920 reloc_info_writer.Write(&rinfo); 2919 reloc_info_writer.Write(&rinfo);
2921 } 2920 }
2922 } 2921 }
2923 } 2922 }
2924 2923
2925 2924
2926 void Assembler::BlockTrampolinePoolFor(int instructions) { 2925 void Assembler::BlockTrampolinePoolFor(int instructions) {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
3048 3047
3049 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 3048 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
3050 Assembler::FlushICacheWithoutIsolate(pc, 2 * sizeof(int32_t)); 3049 Assembler::FlushICacheWithoutIsolate(pc, 2 * sizeof(int32_t));
3051 } 3050 }
3052 } 3051 }
3053 3052
3054 } // namespace internal 3053 } // namespace internal
3055 } // namespace v8 3054 } // namespace v8
3056 3055
3057 #endif // V8_TARGET_ARCH_MIPS 3056 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/deoptimizer-ia32.cc ('k') | src/mips/assembler-mips-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698