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

Side by Side Diff: src/mips64/code-stubs-mips64.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/mips/code-stubs-mips.cc ('k') | src/ppc/code-stubs-ppc.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 4103 matching lines...) Expand 10 before | Expand all | Expand 10 after
4114 __ And(index, index, 4114 __ And(index, index,
4115 Operand(name->Hash() + NameDictionary::GetProbeOffset(i))); 4115 Operand(name->Hash() + NameDictionary::GetProbeOffset(i)));
4116 4116
4117 // Scale the index by multiplying by the entry size. 4117 // Scale the index by multiplying by the entry size.
4118 STATIC_ASSERT(NameDictionary::kEntrySize == 3); 4118 STATIC_ASSERT(NameDictionary::kEntrySize == 3);
4119 __ dsll(at, index, 1); 4119 __ dsll(at, index, 1);
4120 __ Daddu(index, index, at); // index *= 3. 4120 __ Daddu(index, index, at); // index *= 3.
4121 4121
4122 Register entity_name = scratch0; 4122 Register entity_name = scratch0;
4123 // Having undefined at this place means the name is not contained. 4123 // Having undefined at this place means the name is not contained.
4124 DCHECK_EQ(kSmiTagSize, 1); 4124 STATIC_ASSERT(kSmiTagSize == 1);
4125 Register tmp = properties; 4125 Register tmp = properties;
4126 4126
4127 __ dsll(scratch0, index, kPointerSizeLog2); 4127 __ dsll(scratch0, index, kPointerSizeLog2);
4128 __ Daddu(tmp, properties, scratch0); 4128 __ Daddu(tmp, properties, scratch0);
4129 __ ld(entity_name, FieldMemOperand(tmp, kElementsStartOffset)); 4129 __ ld(entity_name, FieldMemOperand(tmp, kElementsStartOffset));
4130 4130
4131 DCHECK(!tmp.is(entity_name)); 4131 DCHECK(!tmp.is(entity_name));
4132 __ LoadRoot(tmp, Heap::kUndefinedValueRootIndex); 4132 __ LoadRoot(tmp, Heap::kUndefinedValueRootIndex);
4133 __ Branch(done, eq, entity_name, Operand(tmp)); 4133 __ Branch(done, eq, entity_name, Operand(tmp));
4134 4134
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
4204 // the hash in a separate instruction. The value hash + i + i * i is right 4204 // the hash in a separate instruction. The value hash + i + i * i is right
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 __ Daddu(scratch2, scratch2, Operand( 4208 __ Daddu(scratch2, scratch2, Operand(
4209 NameDictionary::GetProbeOffset(i) << Name::kHashShift)); 4209 NameDictionary::GetProbeOffset(i) << Name::kHashShift));
4210 } 4210 }
4211 __ dsrl(scratch2, scratch2, Name::kHashShift); 4211 __ dsrl(scratch2, scratch2, 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 entry size.
4215 DCHECK(NameDictionary::kEntrySize == 3); 4215 STATIC_ASSERT(NameDictionary::kEntrySize == 3);
4216 // scratch2 = scratch2 * 3. 4216 // scratch2 = scratch2 * 3.
4217 4217
4218 __ dsll(at, scratch2, 1); 4218 __ dsll(at, scratch2, 1);
4219 __ Daddu(scratch2, scratch2, at); 4219 __ Daddu(scratch2, scratch2, at);
4220 4220
4221 // Check if the key is identical to the name. 4221 // Check if the key is identical to the name.
4222 __ dsll(at, scratch2, kPointerSizeLog2); 4222 __ dsll(at, scratch2, kPointerSizeLog2);
4223 __ Daddu(scratch2, elements, at); 4223 __ Daddu(scratch2, elements, at);
4224 __ ld(at, FieldMemOperand(scratch2, kElementsStartOffset)); 4224 __ ld(at, FieldMemOperand(scratch2, kElementsStartOffset));
4225 __ Branch(done, eq, name, Operand(at)); 4225 __ Branch(done, eq, name, Operand(at));
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
4292 1 << (32 - Name::kHashFieldOffset)); 4292 1 << (32 - Name::kHashFieldOffset));
4293 __ Daddu(index, hash, Operand( 4293 __ Daddu(index, hash, Operand(
4294 NameDictionary::GetProbeOffset(i) << Name::kHashShift)); 4294 NameDictionary::GetProbeOffset(i) << Name::kHashShift));
4295 } else { 4295 } else {
4296 __ mov(index, hash); 4296 __ mov(index, hash);
4297 } 4297 }
4298 __ dsrl(index, index, Name::kHashShift); 4298 __ dsrl(index, index, Name::kHashShift);
4299 __ And(index, mask, index); 4299 __ And(index, mask, index);
4300 4300
4301 // Scale the index by multiplying by the entry size. 4301 // Scale the index by multiplying by the entry size.
4302 DCHECK(NameDictionary::kEntrySize == 3); 4302 STATIC_ASSERT(NameDictionary::kEntrySize == 3);
4303 // index *= 3. 4303 // index *= 3.
4304 __ mov(at, index); 4304 __ mov(at, index);
4305 __ dsll(index, index, 1); 4305 __ dsll(index, index, 1);
4306 __ Daddu(index, index, at); 4306 __ Daddu(index, index, at);
4307 4307
4308 4308
4309 DCHECK_EQ(kSmiTagSize, 1); 4309 STATIC_ASSERT(kSmiTagSize == 1);
4310 __ dsll(index, index, kPointerSizeLog2); 4310 __ dsll(index, index, kPointerSizeLog2);
4311 __ Daddu(index, index, dictionary); 4311 __ Daddu(index, index, dictionary);
4312 __ ld(entry_key, FieldMemOperand(index, kElementsStartOffset)); 4312 __ ld(entry_key, FieldMemOperand(index, kElementsStartOffset));
4313 4313
4314 // Having undefined at this place means the name is not contained. 4314 // Having undefined at this place means the name is not contained.
4315 __ Branch(&not_in_dictionary, eq, entry_key, Operand(undefined)); 4315 __ Branch(&not_in_dictionary, eq, entry_key, Operand(undefined));
4316 4316
4317 // Stop if found the property. 4317 // Stop if found the property.
4318 __ Branch(&in_dictionary, eq, entry_key, Operand(key)); 4318 __ Branch(&in_dictionary, eq, entry_key, Operand(key));
4319 4319
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
5022 5022
5023 static void CreateArrayDispatchOneArgument(MacroAssembler* masm, 5023 static void CreateArrayDispatchOneArgument(MacroAssembler* masm,
5024 AllocationSiteOverrideMode mode) { 5024 AllocationSiteOverrideMode mode) {
5025 // a2 - allocation site (if mode != DISABLE_ALLOCATION_SITES) 5025 // a2 - allocation site (if mode != DISABLE_ALLOCATION_SITES)
5026 // a3 - kind (if mode != DISABLE_ALLOCATION_SITES) 5026 // a3 - kind (if mode != DISABLE_ALLOCATION_SITES)
5027 // a0 - number of arguments 5027 // a0 - number of arguments
5028 // a1 - constructor? 5028 // a1 - constructor?
5029 // sp[0] - last argument 5029 // sp[0] - last argument
5030 Label normal_sequence; 5030 Label normal_sequence;
5031 if (mode == DONT_OVERRIDE) { 5031 if (mode == DONT_OVERRIDE) {
5032 DCHECK(FAST_SMI_ELEMENTS == 0); 5032 STATIC_ASSERT(FAST_SMI_ELEMENTS == 0);
5033 DCHECK(FAST_HOLEY_SMI_ELEMENTS == 1); 5033 STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1);
5034 DCHECK(FAST_ELEMENTS == 2); 5034 STATIC_ASSERT(FAST_ELEMENTS == 2);
5035 DCHECK(FAST_HOLEY_ELEMENTS == 3); 5035 STATIC_ASSERT(FAST_HOLEY_ELEMENTS == 3);
5036 DCHECK(FAST_DOUBLE_ELEMENTS == 4); 5036 STATIC_ASSERT(FAST_DOUBLE_ELEMENTS == 4);
5037 DCHECK(FAST_HOLEY_DOUBLE_ELEMENTS == 5); 5037 STATIC_ASSERT(FAST_HOLEY_DOUBLE_ELEMENTS == 5);
5038 5038
5039 // is the low bit set? If so, we are holey and that is good. 5039 // is the low bit set? If so, we are holey and that is good.
5040 __ And(at, a3, Operand(1)); 5040 __ And(at, a3, Operand(1));
5041 __ Branch(&normal_sequence, ne, at, Operand(zero_reg)); 5041 __ Branch(&normal_sequence, ne, at, Operand(zero_reg));
5042 } 5042 }
5043 // look at the first argument 5043 // look at the first argument
5044 __ ld(a5, MemOperand(sp, 0)); 5044 __ ld(a5, MemOperand(sp, 0));
5045 __ Branch(&normal_sequence, eq, a5, Operand(zero_reg)); 5045 __ Branch(&normal_sequence, eq, a5, Operand(zero_reg));
5046 5046
5047 if (mode == DISABLE_ALLOCATION_SITES) { 5047 if (mode == DISABLE_ALLOCATION_SITES) {
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
5609 MemOperand(fp, 6 * kPointerSize), NULL); 5609 MemOperand(fp, 6 * kPointerSize), NULL);
5610 } 5610 }
5611 5611
5612 5612
5613 #undef __ 5613 #undef __
5614 5614
5615 } // namespace internal 5615 } // namespace internal
5616 } // namespace v8 5616 } // namespace v8
5617 5617
5618 #endif // V8_TARGET_ARCH_MIPS64 5618 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698