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

Side by Side Diff: src/mips/full-codegen-mips.cc

Issue 7740073: MIPS: Convert a bunch of ASSERTs to STATIC_ASSERTs (Closed)
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
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/ic-mips.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 3188 matching lines...) Expand 10 before | Expand all | Expand 10 after
3199 __ lw(cache, ContextOperand(cp, Context::GLOBAL_INDEX)); 3199 __ lw(cache, ContextOperand(cp, Context::GLOBAL_INDEX));
3200 __ lw(cache, FieldMemOperand(cache, GlobalObject::kGlobalContextOffset)); 3200 __ lw(cache, FieldMemOperand(cache, GlobalObject::kGlobalContextOffset));
3201 __ lw(cache, 3201 __ lw(cache,
3202 ContextOperand( 3202 ContextOperand(
3203 cache, Context::JSFUNCTION_RESULT_CACHES_INDEX)); 3203 cache, Context::JSFUNCTION_RESULT_CACHES_INDEX));
3204 __ lw(cache, 3204 __ lw(cache,
3205 FieldMemOperand(cache, FixedArray::OffsetOfElementAt(cache_id))); 3205 FieldMemOperand(cache, FixedArray::OffsetOfElementAt(cache_id)));
3206 3206
3207 3207
3208 Label done, not_found; 3208 Label done, not_found;
3209 ASSERT(kSmiTag == 0 && kSmiTagSize == 1); 3209 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1);
3210 __ lw(a2, FieldMemOperand(cache, JSFunctionResultCache::kFingerOffset)); 3210 __ lw(a2, FieldMemOperand(cache, JSFunctionResultCache::kFingerOffset));
3211 // a2 now holds finger offset as a smi. 3211 // a2 now holds finger offset as a smi.
3212 __ Addu(a3, cache, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 3212 __ Addu(a3, cache, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
3213 // a3 now points to the start of fixed array elements. 3213 // a3 now points to the start of fixed array elements.
3214 __ sll(at, a2, kPointerSizeLog2 - kSmiTagSize); 3214 __ sll(at, a2, kPointerSizeLog2 - kSmiTagSize);
3215 __ addu(a3, a3, at); 3215 __ addu(a3, a3, at);
3216 // a3 now points to key of indexed element of cache. 3216 // a3 now points to key of indexed element of cache.
3217 __ lw(a2, MemOperand(a3)); 3217 __ lw(a2, MemOperand(a3));
3218 __ Branch(&not_found, ne, key, Operand(a2)); 3218 __ Branch(&not_found, ne, key, Operand(a2));
3219 3219
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
4194 // ---------------------------------------------------------------------------- 4194 // ----------------------------------------------------------------------------
4195 // Non-local control flow support. 4195 // Non-local control flow support.
4196 4196
4197 void FullCodeGenerator::EnterFinallyBlock() { 4197 void FullCodeGenerator::EnterFinallyBlock() {
4198 ASSERT(!result_register().is(a1)); 4198 ASSERT(!result_register().is(a1));
4199 // Store result register while executing finally block. 4199 // Store result register while executing finally block.
4200 __ push(result_register()); 4200 __ push(result_register());
4201 // Cook return address in link register to stack (smi encoded Code* delta). 4201 // Cook return address in link register to stack (smi encoded Code* delta).
4202 __ Subu(a1, ra, Operand(masm_->CodeObject())); 4202 __ Subu(a1, ra, Operand(masm_->CodeObject()));
4203 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); 4203 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
4204 ASSERT_EQ(0, kSmiTag); 4204 STATIC_ASSERT(0 == kSmiTag);
4205 __ Addu(a1, a1, Operand(a1)); // Convert to smi. 4205 __ Addu(a1, a1, Operand(a1)); // Convert to smi.
4206 __ push(a1); 4206 __ push(a1);
4207 } 4207 }
4208 4208
4209 4209
4210 void FullCodeGenerator::ExitFinallyBlock() { 4210 void FullCodeGenerator::ExitFinallyBlock() {
4211 ASSERT(!result_register().is(a1)); 4211 ASSERT(!result_register().is(a1));
4212 // Restore result register from stack. 4212 // Restore result register from stack.
4213 __ pop(a1); 4213 __ pop(a1);
4214 // Uncook return address and return. 4214 // Uncook return address and return.
4215 __ pop(result_register()); 4215 __ pop(result_register());
4216 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); 4216 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
4217 __ sra(a1, a1, 1); // Un-smi-tag value. 4217 __ sra(a1, a1, 1); // Un-smi-tag value.
4218 __ Addu(at, a1, Operand(masm_->CodeObject())); 4218 __ Addu(at, a1, Operand(masm_->CodeObject()));
4219 __ Jump(at); 4219 __ Jump(at);
4220 } 4220 }
4221 4221
4222 4222
4223 #undef __ 4223 #undef __
4224 4224
4225 } } // namespace v8::internal 4225 } } // namespace v8::internal
4226 4226
4227 #endif // V8_TARGET_ARCH_MIPS 4227 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/ic-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698