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

Side by Side Diff: src/arm/stub-cache-arm.cc

Issue 7776010: Convert a bunch of ASSERTs to STATIC_ASSERTs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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/arm/lithium-codegen-arm.cc ('k') | src/ia32/builtins-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3479 matching lines...) Expand 10 before | Expand all | Expand 10 after
3490 __ ldr(ip, FieldMemOperand(r3, ExternalArray::kLengthOffset)); 3490 __ ldr(ip, FieldMemOperand(r3, ExternalArray::kLengthOffset));
3491 __ cmp(key, ip); 3491 __ cmp(key, ip);
3492 // Unsigned comparison catches both negative and too-large values. 3492 // Unsigned comparison catches both negative and too-large values.
3493 __ b(hs, &miss_force_generic); 3493 __ b(hs, &miss_force_generic);
3494 3494
3495 __ ldr(r3, FieldMemOperand(r3, ExternalArray::kExternalPointerOffset)); 3495 __ ldr(r3, FieldMemOperand(r3, ExternalArray::kExternalPointerOffset));
3496 // r3: base pointer of external storage 3496 // r3: base pointer of external storage
3497 3497
3498 // We are not untagging smi key and instead work with it 3498 // We are not untagging smi key and instead work with it
3499 // as if it was premultiplied by 2. 3499 // as if it was premultiplied by 2.
3500 ASSERT((kSmiTag == 0) && (kSmiTagSize == 1)); 3500 STATIC_ASSERT((kSmiTag == 0) && (kSmiTagSize == 1));
3501 3501
3502 Register value = r2; 3502 Register value = r2;
3503 switch (elements_kind) { 3503 switch (elements_kind) {
3504 case JSObject::EXTERNAL_BYTE_ELEMENTS: 3504 case JSObject::EXTERNAL_BYTE_ELEMENTS:
3505 __ ldrsb(value, MemOperand(r3, key, LSR, 1)); 3505 __ ldrsb(value, MemOperand(r3, key, LSR, 1));
3506 break; 3506 break;
3507 case JSObject::EXTERNAL_PIXEL_ELEMENTS: 3507 case JSObject::EXTERNAL_PIXEL_ELEMENTS:
3508 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: 3508 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
3509 __ ldrb(value, MemOperand(r3, key, LSR, 1)); 3509 __ ldrb(value, MemOperand(r3, key, LSR, 1));
3510 break; 3510 break;
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
4140 __ ldr(r2, FieldMemOperand(r1, JSObject::kElementsOffset)); 4140 __ ldr(r2, FieldMemOperand(r1, JSObject::kElementsOffset));
4141 __ AssertFastElements(r2); 4141 __ AssertFastElements(r2);
4142 4142
4143 // Check that the key is within bounds. 4143 // Check that the key is within bounds.
4144 __ ldr(r3, FieldMemOperand(r2, FixedArray::kLengthOffset)); 4144 __ ldr(r3, FieldMemOperand(r2, FixedArray::kLengthOffset));
4145 __ cmp(r0, Operand(r3)); 4145 __ cmp(r0, Operand(r3));
4146 __ b(hs, &miss_force_generic); 4146 __ b(hs, &miss_force_generic);
4147 4147
4148 // Load the result and make sure it's not the hole. 4148 // Load the result and make sure it's not the hole.
4149 __ add(r3, r2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 4149 __ add(r3, r2, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
4150 ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); 4150 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2);
4151 __ ldr(r4, 4151 __ ldr(r4,
4152 MemOperand(r3, r0, LSL, kPointerSizeLog2 - kSmiTagSize)); 4152 MemOperand(r3, r0, LSL, kPointerSizeLog2 - kSmiTagSize));
4153 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); 4153 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
4154 __ cmp(r4, ip); 4154 __ cmp(r4, ip);
4155 __ b(eq, &miss_force_generic); 4155 __ b(eq, &miss_force_generic);
4156 __ mov(r0, r4); 4156 __ mov(r0, r4);
4157 __ Ret(); 4157 __ Ret();
4158 4158
4159 __ bind(&miss_force_generic); 4159 __ bind(&miss_force_generic);
4160 Code* stub = masm->isolate()->builtins()->builtin( 4160 Code* stub = masm->isolate()->builtins()->builtin(
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
4272 __ ldr(scratch, FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); 4272 __ ldr(scratch, FieldMemOperand(receiver_reg, JSArray::kLengthOffset));
4273 } else { 4273 } else {
4274 __ ldr(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset)); 4274 __ ldr(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset));
4275 } 4275 }
4276 // Compare smis. 4276 // Compare smis.
4277 __ cmp(key_reg, scratch); 4277 __ cmp(key_reg, scratch);
4278 __ b(hs, &miss_force_generic); 4278 __ b(hs, &miss_force_generic);
4279 4279
4280 __ add(scratch, 4280 __ add(scratch,
4281 elements_reg, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 4281 elements_reg, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
4282 ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); 4282 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2);
4283 __ str(value_reg, 4283 __ str(value_reg,
4284 MemOperand(scratch, key_reg, LSL, kPointerSizeLog2 - kSmiTagSize)); 4284 MemOperand(scratch, key_reg, LSL, kPointerSizeLog2 - kSmiTagSize));
4285 __ RecordWrite(scratch, 4285 __ RecordWrite(scratch,
4286 Operand(key_reg, LSL, kPointerSizeLog2 - kSmiTagSize), 4286 Operand(key_reg, LSL, kPointerSizeLog2 - kSmiTagSize),
4287 receiver_reg , elements_reg); 4287 receiver_reg , elements_reg);
4288 4288
4289 // value_reg (r0) is preserved. 4289 // value_reg (r0) is preserved.
4290 // Done. 4290 // Done.
4291 __ Ret(); 4291 __ Ret();
4292 4292
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
4421 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); 4421 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4422 __ Jump(ic, RelocInfo::CODE_TARGET); 4422 __ Jump(ic, RelocInfo::CODE_TARGET);
4423 } 4423 }
4424 4424
4425 4425
4426 #undef __ 4426 #undef __
4427 4427
4428 } } // namespace v8::internal 4428 } } // namespace v8::internal
4429 4429
4430 #endif // V8_TARGET_ARCH_ARM 4430 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698