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

Side by Side Diff: src/arm/full-codegen-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/builtins-arm.cc ('k') | src/arm/ic-arm.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 3176 matching lines...) Expand 10 before | Expand all | Expand 10 after
3187 Register cache = r1; 3187 Register cache = r1;
3188 __ ldr(cache, ContextOperand(cp, Context::GLOBAL_INDEX)); 3188 __ ldr(cache, ContextOperand(cp, Context::GLOBAL_INDEX));
3189 __ ldr(cache, FieldMemOperand(cache, GlobalObject::kGlobalContextOffset)); 3189 __ ldr(cache, FieldMemOperand(cache, GlobalObject::kGlobalContextOffset));
3190 __ ldr(cache, ContextOperand(cache, Context::JSFUNCTION_RESULT_CACHES_INDEX)); 3190 __ ldr(cache, ContextOperand(cache, Context::JSFUNCTION_RESULT_CACHES_INDEX));
3191 __ ldr(cache, 3191 __ ldr(cache,
3192 FieldMemOperand(cache, FixedArray::OffsetOfElementAt(cache_id))); 3192 FieldMemOperand(cache, FixedArray::OffsetOfElementAt(cache_id)));
3193 3193
3194 3194
3195 Label done, not_found; 3195 Label done, not_found;
3196 // tmp now holds finger offset as a smi. 3196 // tmp now holds finger offset as a smi.
3197 ASSERT(kSmiTag == 0 && kSmiTagSize == 1); 3197 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1);
3198 __ ldr(r2, FieldMemOperand(cache, JSFunctionResultCache::kFingerOffset)); 3198 __ ldr(r2, FieldMemOperand(cache, JSFunctionResultCache::kFingerOffset));
3199 // r2 now holds finger offset as a smi. 3199 // r2 now holds finger offset as a smi.
3200 __ add(r3, cache, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 3200 __ add(r3, cache, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
3201 // r3 now points to the start of fixed array elements. 3201 // r3 now points to the start of fixed array elements.
3202 __ ldr(r2, MemOperand(r3, r2, LSL, kPointerSizeLog2 - kSmiTagSize, PreIndex)); 3202 __ ldr(r2, MemOperand(r3, r2, LSL, kPointerSizeLog2 - kSmiTagSize, PreIndex));
3203 // Note side effect of PreIndex: r3 now points to the key of the pair. 3203 // Note side effect of PreIndex: r3 now points to the key of the pair.
3204 __ cmp(key, r2); 3204 __ cmp(key, r2);
3205 __ b(ne, &not_found); 3205 __ b(ne, &not_found);
3206 3206
3207 __ ldr(r0, MemOperand(r3, kPointerSize)); 3207 __ ldr(r0, MemOperand(r3, kPointerSize));
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
4175 // ---------------------------------------------------------------------------- 4175 // ----------------------------------------------------------------------------
4176 // Non-local control flow support. 4176 // Non-local control flow support.
4177 4177
4178 void FullCodeGenerator::EnterFinallyBlock() { 4178 void FullCodeGenerator::EnterFinallyBlock() {
4179 ASSERT(!result_register().is(r1)); 4179 ASSERT(!result_register().is(r1));
4180 // Store result register while executing finally block. 4180 // Store result register while executing finally block.
4181 __ push(result_register()); 4181 __ push(result_register());
4182 // Cook return address in link register to stack (smi encoded Code* delta) 4182 // Cook return address in link register to stack (smi encoded Code* delta)
4183 __ sub(r1, lr, Operand(masm_->CodeObject())); 4183 __ sub(r1, lr, Operand(masm_->CodeObject()));
4184 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); 4184 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
4185 ASSERT_EQ(0, kSmiTag); 4185 STATIC_ASSERT(kSmiTag == 0);
4186 __ add(r1, r1, Operand(r1)); // Convert to smi. 4186 __ add(r1, r1, Operand(r1)); // Convert to smi.
4187 __ push(r1); 4187 __ push(r1);
4188 } 4188 }
4189 4189
4190 4190
4191 void FullCodeGenerator::ExitFinallyBlock() { 4191 void FullCodeGenerator::ExitFinallyBlock() {
4192 ASSERT(!result_register().is(r1)); 4192 ASSERT(!result_register().is(r1));
4193 // Restore result register from stack. 4193 // Restore result register from stack.
4194 __ pop(r1); 4194 __ pop(r1);
4195 // Uncook return address and return. 4195 // Uncook return address and return.
4196 __ pop(result_register()); 4196 __ pop(result_register());
4197 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); 4197 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
4198 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 4198 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
4199 __ add(pc, r1, Operand(masm_->CodeObject())); 4199 __ add(pc, r1, Operand(masm_->CodeObject()));
4200 } 4200 }
4201 4201
4202 4202
4203 #undef __ 4203 #undef __
4204 4204
4205 } } // namespace v8::internal 4205 } } // namespace v8::internal
4206 4206
4207 #endif // V8_TARGET_ARCH_ARM 4207 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/arm/ic-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698