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

Side by Side Diff: src/ia32/ic-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/full-codegen-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 FACTORY->fixed_array_map(), 317 FACTORY->fixed_array_map(),
318 not_fast_array, 318 not_fast_array,
319 DONT_DO_SMI_CHECK); 319 DONT_DO_SMI_CHECK);
320 } else { 320 } else {
321 __ AssertFastElements(scratch); 321 __ AssertFastElements(scratch);
322 } 322 }
323 // Check that the key (index) is within bounds. 323 // Check that the key (index) is within bounds.
324 __ cmp(key, FieldOperand(scratch, FixedArray::kLengthOffset)); 324 __ cmp(key, FieldOperand(scratch, FixedArray::kLengthOffset));
325 __ j(above_equal, out_of_range); 325 __ j(above_equal, out_of_range);
326 // Fast case: Do the load. 326 // Fast case: Do the load.
327 ASSERT((kPointerSize == 4) && (kSmiTagSize == 1) && (kSmiTag == 0)); 327 STATIC_ASSERT((kPointerSize == 4) && (kSmiTagSize == 1) && (kSmiTag == 0));
328 __ mov(scratch, FieldOperand(scratch, key, times_2, FixedArray::kHeaderSize)); 328 __ mov(scratch, FieldOperand(scratch, key, times_2, FixedArray::kHeaderSize));
329 __ cmp(Operand(scratch), Immediate(FACTORY->the_hole_value())); 329 __ cmp(Operand(scratch), Immediate(FACTORY->the_hole_value()));
330 // In case the loaded value is the_hole we have to consult GetProperty 330 // In case the loaded value is the_hole we have to consult GetProperty
331 // to ensure the prototype chain is searched. 331 // to ensure the prototype chain is searched.
332 __ j(equal, out_of_range); 332 __ j(equal, out_of_range);
333 if (!result.is(scratch)) { 333 if (!result.is(scratch)) {
334 __ mov(result, scratch); 334 __ mov(result, scratch);
335 } 335 }
336 } 336 }
337 337
(...skipping 13 matching lines...) Expand all
351 // hash - used to hold the hash of the key. 351 // hash - used to hold the hash of the key.
352 __ CmpObjectType(key, FIRST_NONSTRING_TYPE, map); 352 __ CmpObjectType(key, FIRST_NONSTRING_TYPE, map);
353 __ j(above_equal, not_symbol); 353 __ j(above_equal, not_symbol);
354 354
355 // Is the string an array index, with cached numeric value? 355 // Is the string an array index, with cached numeric value?
356 __ mov(hash, FieldOperand(key, String::kHashFieldOffset)); 356 __ mov(hash, FieldOperand(key, String::kHashFieldOffset));
357 __ test(hash, Immediate(String::kContainsCachedArrayIndexMask)); 357 __ test(hash, Immediate(String::kContainsCachedArrayIndexMask));
358 __ j(zero, index_string); 358 __ j(zero, index_string);
359 359
360 // Is the string a symbol? 360 // Is the string a symbol?
361 ASSERT(kSymbolTag != 0); 361 STATIC_ASSERT(kSymbolTag != 0);
362 __ test_b(FieldOperand(map, Map::kInstanceTypeOffset), kIsSymbolMask); 362 __ test_b(FieldOperand(map, Map::kInstanceTypeOffset), kIsSymbolMask);
363 __ j(zero, not_symbol); 363 __ j(zero, not_symbol);
364 } 364 }
365 365
366 366
367 static Operand GenerateMappedArgumentsLookup(MacroAssembler* masm, 367 static Operand GenerateMappedArgumentsLookup(MacroAssembler* masm,
368 Register object, 368 Register object,
369 Register key, 369 Register key,
370 Register scratch1, 370 Register scratch1,
371 Register scratch2, 371 Register scratch2,
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 Condition cc = *jmp_address == Assembler::kJncShortOpcode 1637 Condition cc = *jmp_address == Assembler::kJncShortOpcode
1638 ? not_zero 1638 ? not_zero
1639 : zero; 1639 : zero;
1640 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1640 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1641 } 1641 }
1642 1642
1643 1643
1644 } } // namespace v8::internal 1644 } } // namespace v8::internal
1645 1645
1646 #endif // V8_TARGET_ARCH_IA32 1646 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698