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

Side by Side Diff: src/ia32/full-codegen-ia32.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/ia32/builtins-ia32.cc ('k') | src/ia32/ic-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 3181 matching lines...) Expand 10 before | Expand all | Expand 10 after
3192 Register tmp = ecx; 3192 Register tmp = ecx;
3193 __ mov(cache, ContextOperand(esi, Context::GLOBAL_INDEX)); 3193 __ mov(cache, ContextOperand(esi, Context::GLOBAL_INDEX));
3194 __ mov(cache, 3194 __ mov(cache,
3195 FieldOperand(cache, GlobalObject::kGlobalContextOffset)); 3195 FieldOperand(cache, GlobalObject::kGlobalContextOffset));
3196 __ mov(cache, ContextOperand(cache, Context::JSFUNCTION_RESULT_CACHES_INDEX)); 3196 __ mov(cache, ContextOperand(cache, Context::JSFUNCTION_RESULT_CACHES_INDEX));
3197 __ mov(cache, 3197 __ mov(cache,
3198 FieldOperand(cache, FixedArray::OffsetOfElementAt(cache_id))); 3198 FieldOperand(cache, FixedArray::OffsetOfElementAt(cache_id)));
3199 3199
3200 Label done, not_found; 3200 Label done, not_found;
3201 // tmp now holds finger offset as a smi. 3201 // tmp now holds finger offset as a smi.
3202 ASSERT(kSmiTag == 0 && kSmiTagSize == 1); 3202 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1);
3203 __ mov(tmp, FieldOperand(cache, JSFunctionResultCache::kFingerOffset)); 3203 __ mov(tmp, FieldOperand(cache, JSFunctionResultCache::kFingerOffset));
3204 __ cmp(key, CodeGenerator::FixedArrayElementOperand(cache, tmp)); 3204 __ cmp(key, CodeGenerator::FixedArrayElementOperand(cache, tmp));
3205 __ j(not_equal, &not_found); 3205 __ j(not_equal, &not_found);
3206 3206
3207 __ mov(eax, CodeGenerator::FixedArrayElementOperand(cache, tmp, 1)); 3207 __ mov(eax, CodeGenerator::FixedArrayElementOperand(cache, tmp, 1));
3208 __ jmp(&done); 3208 __ jmp(&done);
3209 3209
3210 __ bind(&not_found); 3210 __ bind(&not_found);
3211 // Call runtime to perform the lookup. 3211 // Call runtime to perform the lookup.
3212 __ push(cache); 3212 __ push(cache);
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
4235 4235
4236 4236
4237 // ---------------------------------------------------------------------------- 4237 // ----------------------------------------------------------------------------
4238 // Non-local control flow support. 4238 // Non-local control flow support.
4239 4239
4240 void FullCodeGenerator::EnterFinallyBlock() { 4240 void FullCodeGenerator::EnterFinallyBlock() {
4241 // Cook return address on top of stack (smi encoded Code* delta) 4241 // Cook return address on top of stack (smi encoded Code* delta)
4242 ASSERT(!result_register().is(edx)); 4242 ASSERT(!result_register().is(edx));
4243 __ pop(edx); 4243 __ pop(edx);
4244 __ sub(Operand(edx), Immediate(masm_->CodeObject())); 4244 __ sub(Operand(edx), Immediate(masm_->CodeObject()));
4245 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); 4245 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 1);
4246 ASSERT_EQ(0, kSmiTag); 4246 STATIC_ASSERT(kSmiTag == 0);
4247 __ SmiTag(edx); 4247 __ SmiTag(edx);
4248 __ push(edx); 4248 __ push(edx);
4249 // Store result register while executing finally block. 4249 // Store result register while executing finally block.
4250 __ push(result_register()); 4250 __ push(result_register());
4251 } 4251 }
4252 4252
4253 4253
4254 void FullCodeGenerator::ExitFinallyBlock() { 4254 void FullCodeGenerator::ExitFinallyBlock() {
4255 ASSERT(!result_register().is(edx)); 4255 ASSERT(!result_register().is(edx));
4256 __ pop(result_register()); 4256 __ pop(result_register());
4257 // Uncook return address. 4257 // Uncook return address.
4258 __ pop(edx); 4258 __ pop(edx);
4259 __ SmiUntag(edx); 4259 __ SmiUntag(edx);
4260 __ add(Operand(edx), Immediate(masm_->CodeObject())); 4260 __ add(Operand(edx), Immediate(masm_->CodeObject()));
4261 __ jmp(Operand(edx)); 4261 __ jmp(Operand(edx));
4262 } 4262 }
4263 4263
4264 4264
4265 #undef __ 4265 #undef __
4266 4266
4267 } } // namespace v8::internal 4267 } } // namespace v8::internal
4268 4268
4269 #endif // V8_TARGET_ARCH_IA32 4269 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698