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

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

Issue 528993002: First step to cleanup the power-of-2 mess. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: clang-format Created 6 years, 3 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/arm64/assembler-arm64.h ('k') | src/arm64/lithium-arm64.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // 2 //
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are 4 // modification, are permitted provided that the following conditions are
5 // met: 5 // met:
6 // 6 //
7 // * Redistributions of source code must retain the above copyright 7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above 9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following 10 // copyright notice, this list of conditions and the following
(...skipping 15 matching lines...) Expand all
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 28
29 #include "src/v8.h" 29 #include "src/v8.h"
30 30
31 #if V8_TARGET_ARCH_ARM64 31 #if V8_TARGET_ARCH_ARM64
32 32
33 #define ARM64_DEFINE_REG_STATICS 33 #define ARM64_DEFINE_REG_STATICS
34 34
35 #include "src/arm64/assembler-arm64-inl.h" 35 #include "src/arm64/assembler-arm64-inl.h"
36 #include "src/base/bits.h"
36 #include "src/base/cpu.h" 37 #include "src/base/cpu.h"
37 38
38 namespace v8 { 39 namespace v8 {
39 namespace internal { 40 namespace internal {
40 41
41 42
42 // ----------------------------------------------------------------------------- 43 // -----------------------------------------------------------------------------
43 // CpuFeatures implementation. 44 // CpuFeatures implementation.
44 45
45 void CpuFeatures::ProbeImpl(bool cross_compile) { 46 void CpuFeatures::ProbeImpl(bool cross_compile) {
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 desc->buffer_size = buffer_size_; 595 desc->buffer_size = buffer_size_;
595 desc->instr_size = pc_offset(); 596 desc->instr_size = pc_offset();
596 desc->reloc_size = (reinterpret_cast<byte*>(buffer_) + buffer_size_) - 597 desc->reloc_size = (reinterpret_cast<byte*>(buffer_) + buffer_size_) -
597 reloc_info_writer.pos(); 598 reloc_info_writer.pos();
598 desc->origin = this; 599 desc->origin = this;
599 } 600 }
600 } 601 }
601 602
602 603
603 void Assembler::Align(int m) { 604 void Assembler::Align(int m) {
604 DCHECK(m >= 4 && IsPowerOf2(m)); 605 DCHECK(m >= 4 && base::bits::IsPowerOfTwo32(m));
605 while ((pc_offset() & (m - 1)) != 0) { 606 while ((pc_offset() & (m - 1)) != 0) {
606 nop(); 607 nop();
607 } 608 }
608 } 609 }
609 610
610 611
611 void Assembler::CheckLabelLinkChain(Label const * label) { 612 void Assembler::CheckLabelLinkChain(Label const * label) {
612 #ifdef DEBUG 613 #ifdef DEBUG
613 if (label->is_linked()) { 614 if (label->is_linked()) {
614 int linkoffset = label->pos(); 615 int linkoffset = label->pos();
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
2201 Emit(HLT | ImmException(code)); 2202 Emit(HLT | ImmException(code));
2202 } 2203 }
2203 2204
2204 2205
2205 void Assembler::brk(int code) { 2206 void Assembler::brk(int code) {
2206 DCHECK(is_uint16(code)); 2207 DCHECK(is_uint16(code));
2207 Emit(BRK | ImmException(code)); 2208 Emit(BRK | ImmException(code));
2208 } 2209 }
2209 2210
2210 2211
2212 void Assembler::EmitStringData(const char* string) {
2213 size_t len = strlen(string) + 1;
2214 DCHECK(RoundUp(len, kInstructionSize) <= static_cast<size_t>(kGap));
2215 EmitData(string, len);
2216 // Pad with NULL characters until pc_ is aligned.
2217 const char pad[] = {'\0', '\0', '\0', '\0'};
2218 STATIC_ASSERT(sizeof(pad) == kInstructionSize);
2219 EmitData(pad, RoundUp(pc_offset(), kInstructionSize) - pc_offset());
2220 }
2221
2222
2211 void Assembler::debug(const char* message, uint32_t code, Instr params) { 2223 void Assembler::debug(const char* message, uint32_t code, Instr params) {
2212 #ifdef USE_SIMULATOR 2224 #ifdef USE_SIMULATOR
2213 // Don't generate simulator specific code if we are building a snapshot, which 2225 // Don't generate simulator specific code if we are building a snapshot, which
2214 // might be run on real hardware. 2226 // might be run on real hardware.
2215 if (!serializer_enabled()) { 2227 if (!serializer_enabled()) {
2216 // The arguments to the debug marker need to be contiguous in memory, so 2228 // The arguments to the debug marker need to be contiguous in memory, so
2217 // make sure we don't try to emit pools. 2229 // make sure we don't try to emit pools.
2218 BlockPoolsScope scope(this); 2230 BlockPoolsScope scope(this);
2219 2231
2220 Label start; 2232 Label start;
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
3120 movz(scratch, (target_offset >> 16) & 0xFFFF, 16); 3132 movz(scratch, (target_offset >> 16) & 0xFFFF, 16);
3121 movk(scratch, (target_offset >> 32) & 0xFFFF, 32); 3133 movk(scratch, (target_offset >> 32) & 0xFFFF, 32);
3122 DCHECK((target_offset >> 48) == 0); 3134 DCHECK((target_offset >> 48) == 0);
3123 add(rd, rd, scratch); 3135 add(rd, rd, scratch);
3124 } 3136 }
3125 3137
3126 3138
3127 } } // namespace v8::internal 3139 } } // namespace v8::internal
3128 3140
3129 #endif // V8_TARGET_ARCH_ARM64 3141 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/assembler-arm64.h ('k') | src/arm64/lithium-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698