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

Side by Side Diff: src/mips/assembler-mips.cc

Issue 1573953002: MIPS: Fix dd() implementations for compact branches. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use Align(). Created 4 years, 11 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
« no previous file with comments | « src/mips/assembler-mips.h ('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 2847 matching lines...) Expand 10 before | Expand all | Expand 10 after
2858 rmode == RelocInfo::INTERNAL_REFERENCE) { 2858 rmode == RelocInfo::INTERNAL_REFERENCE) {
2859 byte* p = reinterpret_cast<byte*>(it.rinfo()->pc()); 2859 byte* p = reinterpret_cast<byte*>(it.rinfo()->pc());
2860 RelocateInternalReference(rmode, p, pc_delta); 2860 RelocateInternalReference(rmode, p, pc_delta);
2861 } 2861 }
2862 } 2862 }
2863 DCHECK(!overflow()); 2863 DCHECK(!overflow());
2864 } 2864 }
2865 2865
2866 2866
2867 void Assembler::db(uint8_t data) { 2867 void Assembler::db(uint8_t data) {
2868 CheckBuffer(); 2868 CheckForEmitInForbiddenSlot();
2869 *reinterpret_cast<uint8_t*>(pc_) = data; 2869 EmitHelper(data);
2870 pc_ += sizeof(uint8_t);
2871 } 2870 }
2872 2871
2873 2872
2874 void Assembler::dd(uint32_t data) { 2873 void Assembler::dd(uint32_t data) {
2875 CheckBuffer(); 2874 CheckForEmitInForbiddenSlot();
2876 *reinterpret_cast<uint32_t*>(pc_) = data; 2875 EmitHelper(data);
2877 pc_ += sizeof(uint32_t);
2878 } 2876 }
2879 2877
2880 2878
2881 void Assembler::dq(uint64_t data) { 2879 void Assembler::dq(uint64_t data) {
2882 CheckBuffer(); 2880 CheckForEmitInForbiddenSlot();
2883 *reinterpret_cast<uint64_t*>(pc_) = data; 2881 EmitHelper(data);
2884 pc_ += sizeof(uint64_t);
2885 } 2882 }
2886 2883
2887 2884
2888 void Assembler::dd(Label* label) { 2885 void Assembler::dd(Label* label) {
2889 CheckBuffer();
2890 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
2891 uint32_t data; 2886 uint32_t data;
2887 CheckForEmitInForbiddenSlot();
2892 if (label->is_bound()) { 2888 if (label->is_bound()) {
2893 data = reinterpret_cast<uint32_t>(buffer_ + label->pos()); 2889 data = reinterpret_cast<uint32_t>(buffer_ + label->pos());
2894 } else { 2890 } else {
2895 data = jump_address(label); 2891 data = jump_address(label);
2896 internal_reference_positions_.insert(label->pos()); 2892 internal_reference_positions_.insert(label->pos());
2897 } 2893 }
2898 *reinterpret_cast<uint32_t*>(pc_) = data; 2894 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE);
2899 pc_ += sizeof(uint32_t); 2895 EmitHelper(data);
2900 } 2896 }
2901 2897
2902 2898
2903 void Assembler::emit_code_stub_address(Code* stub) {
2904 CheckBuffer();
2905 *reinterpret_cast<uint32_t*>(pc_) =
2906 reinterpret_cast<uint32_t>(stub->instruction_start());
2907 pc_ += sizeof(uint32_t);
2908 }
2909
2910
2911 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { 2899 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
2912 // We do not try to reuse pool constants. 2900 // We do not try to reuse pool constants.
2913 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); 2901 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL);
2914 if (rmode >= RelocInfo::COMMENT && 2902 if (rmode >= RelocInfo::COMMENT &&
2915 rmode <= RelocInfo::DEBUG_BREAK_SLOT_AT_CALL) { 2903 rmode <= RelocInfo::DEBUG_BREAK_SLOT_AT_CALL) {
2916 // Adjust code for new modes. 2904 // Adjust code for new modes.
2917 DCHECK(RelocInfo::IsDebugBreakSlot(rmode) 2905 DCHECK(RelocInfo::IsDebugBreakSlot(rmode)
2918 || RelocInfo::IsComment(rmode) 2906 || RelocInfo::IsComment(rmode)
2919 || RelocInfo::IsPosition(rmode)); 2907 || RelocInfo::IsPosition(rmode));
2920 // These modes do not need an entry in the constant pool. 2908 // These modes do not need an entry in the constant pool.
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
3063 3051
3064 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 3052 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
3065 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t)); 3053 Assembler::FlushICache(isolate, pc, 2 * sizeof(int32_t));
3066 } 3054 }
3067 } 3055 }
3068 3056
3069 } // namespace internal 3057 } // namespace internal
3070 } // namespace v8 3058 } // namespace v8
3071 3059
3072 #endif // V8_TARGET_ARCH_MIPS 3060 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.h ('k') | src/mips/assembler-mips-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698