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

Side by Side Diff: src/ppc/code-stubs-ppc.cc

Issue 1251593009: convert a bunch of DCHECKs to STATIC_ASSERT (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add missing include Created 5 years, 5 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/mips64/code-stubs-mips64.cc ('k') | src/x64/code-stubs-x64.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_PPC 7 #if V8_TARGET_ARCH_PPC
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 4194 matching lines...) Expand 10 before | Expand all | Expand 10 after
4205 // shifted in the following and instruction. 4205 // shifted in the following and instruction.
4206 DCHECK(NameDictionary::GetProbeOffset(i) < 4206 DCHECK(NameDictionary::GetProbeOffset(i) <
4207 1 << (32 - Name::kHashFieldOffset)); 4207 1 << (32 - Name::kHashFieldOffset));
4208 __ addi(scratch2, scratch2, 4208 __ addi(scratch2, scratch2,
4209 Operand(NameDictionary::GetProbeOffset(i) << Name::kHashShift)); 4209 Operand(NameDictionary::GetProbeOffset(i) << Name::kHashShift));
4210 } 4210 }
4211 __ srwi(scratch2, scratch2, Operand(Name::kHashShift)); 4211 __ srwi(scratch2, scratch2, Operand(Name::kHashShift));
4212 __ and_(scratch2, scratch1, scratch2); 4212 __ and_(scratch2, scratch1, scratch2);
4213 4213
4214 // Scale the index by multiplying by the element size. 4214 // Scale the index by multiplying by the element size.
4215 DCHECK(NameDictionary::kEntrySize == 3); 4215 STATIC_ASSERT(NameDictionary::kEntrySize == 3);
4216 // scratch2 = scratch2 * 3. 4216 // scratch2 = scratch2 * 3.
4217 __ ShiftLeftImm(ip, scratch2, Operand(1)); 4217 __ ShiftLeftImm(ip, scratch2, Operand(1));
4218 __ add(scratch2, scratch2, ip); 4218 __ add(scratch2, scratch2, ip);
4219 4219
4220 // Check if the key is identical to the name. 4220 // Check if the key is identical to the name.
4221 __ ShiftLeftImm(ip, scratch2, Operand(kPointerSizeLog2)); 4221 __ ShiftLeftImm(ip, scratch2, Operand(kPointerSizeLog2));
4222 __ add(scratch2, elements, ip); 4222 __ add(scratch2, elements, ip);
4223 __ LoadP(ip, FieldMemOperand(scratch2, kElementsStartOffset)); 4223 __ LoadP(ip, FieldMemOperand(scratch2, kElementsStartOffset));
4224 __ cmp(name, ip); 4224 __ cmp(name, ip);
4225 __ beq(done); 4225 __ beq(done);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
4294 1 << (32 - Name::kHashFieldOffset)); 4294 1 << (32 - Name::kHashFieldOffset));
4295 __ addi(index, hash, 4295 __ addi(index, hash,
4296 Operand(NameDictionary::GetProbeOffset(i) << Name::kHashShift)); 4296 Operand(NameDictionary::GetProbeOffset(i) << Name::kHashShift));
4297 } else { 4297 } else {
4298 __ mr(index, hash); 4298 __ mr(index, hash);
4299 } 4299 }
4300 __ srwi(r0, index, Operand(Name::kHashShift)); 4300 __ srwi(r0, index, Operand(Name::kHashShift));
4301 __ and_(index, mask, r0); 4301 __ and_(index, mask, r0);
4302 4302
4303 // Scale the index by multiplying by the entry size. 4303 // Scale the index by multiplying by the entry size.
4304 DCHECK(NameDictionary::kEntrySize == 3); 4304 STATIC_ASSERT(NameDictionary::kEntrySize == 3);
4305 __ ShiftLeftImm(scratch, index, Operand(1)); 4305 __ ShiftLeftImm(scratch, index, Operand(1));
4306 __ add(index, index, scratch); // index *= 3. 4306 __ add(index, index, scratch); // index *= 3.
4307 4307
4308 __ ShiftLeftImm(scratch, index, Operand(kPointerSizeLog2)); 4308 __ ShiftLeftImm(scratch, index, Operand(kPointerSizeLog2));
4309 __ add(index, dictionary, scratch); 4309 __ add(index, dictionary, scratch);
4310 __ LoadP(entry_key, FieldMemOperand(index, kElementsStartOffset)); 4310 __ LoadP(entry_key, FieldMemOperand(index, kElementsStartOffset));
4311 4311
4312 // Having undefined at this place means the name is not contained. 4312 // Having undefined at this place means the name is not contained.
4313 __ cmp(entry_key, undefined); 4313 __ cmp(entry_key, undefined);
4314 __ beq(&not_in_dictionary); 4314 __ beq(&not_in_dictionary);
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
5033 5033
5034 static void CreateArrayDispatchOneArgument(MacroAssembler* masm, 5034 static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
5035 AllocationSiteOverrideMode mode) { 5035 AllocationSiteOverrideMode mode) {
5036 // r5 - allocation site (if mode != DISABLE_ALLOCATION_SITES) 5036 // r5 - allocation site (if mode != DISABLE_ALLOCATION_SITES)
5037 // r6 - kind (if mode != DISABLE_ALLOCATION_SITES) 5037 // r6 - kind (if mode != DISABLE_ALLOCATION_SITES)
5038 // r3 - number of arguments 5038 // r3 - number of arguments
5039 // r4 - constructor? 5039 // r4 - constructor?
5040 // sp[0] - last argument 5040 // sp[0] - last argument
5041 Label normal_sequence; 5041 Label normal_sequence;
5042 if (mode == DONT_OVERRIDE) { 5042 if (mode == DONT_OVERRIDE) {
5043 DCHECK(FAST_SMI_ELEMENTS == 0); 5043 STATIC_ASSERT(FAST_SMI_ELEMENTS == 0);
5044 DCHECK(FAST_HOLEY_SMI_ELEMENTS == 1); 5044 STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1);
5045 DCHECK(FAST_ELEMENTS == 2); 5045 STATIC_ASSERT(FAST_ELEMENTS == 2);
5046 DCHECK(FAST_HOLEY_ELEMENTS == 3); 5046 STATIC_ASSERT(FAST_HOLEY_ELEMENTS == 3);
5047 DCHECK(FAST_DOUBLE_ELEMENTS == 4); 5047 STATIC_ASSERT(FAST_DOUBLE_ELEMENTS == 4);
5048 DCHECK(FAST_HOLEY_DOUBLE_ELEMENTS == 5); 5048 STATIC_ASSERT(FAST_HOLEY_DOUBLE_ELEMENTS == 5);
5049 5049
5050 // is the low bit set? If so, we are holey and that is good. 5050 // is the low bit set? If so, we are holey and that is good.
5051 __ andi(r0, r6, Operand(1)); 5051 __ andi(r0, r6, Operand(1));
5052 __ bne(&normal_sequence, cr0); 5052 __ bne(&normal_sequence, cr0);
5053 } 5053 }
5054 5054
5055 // look at the first argument 5055 // look at the first argument
5056 __ LoadP(r8, MemOperand(sp, 0)); 5056 __ LoadP(r8, MemOperand(sp, 0));
5057 __ cmpi(r8, Operand::Zero()); 5057 __ cmpi(r8, Operand::Zero());
5058 __ beq(&normal_sequence); 5058 __ beq(&normal_sequence);
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
5673 kStackUnwindSpace, NULL, 5673 kStackUnwindSpace, NULL,
5674 MemOperand(fp, 6 * kPointerSize), NULL); 5674 MemOperand(fp, 6 * kPointerSize), NULL);
5675 } 5675 }
5676 5676
5677 5677
5678 #undef __ 5678 #undef __
5679 } // namespace internal 5679 } // namespace internal
5680 } // namespace v8 5680 } // namespace v8
5681 5681
5682 #endif // V8_TARGET_ARCH_PPC 5682 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698