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

Side by Side Diff: src/mips/ic-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/full-codegen-mips.cc ('k') | src/mips/stub-cache-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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 } 331 }
332 332
333 // Check that the key (index) is within bounds. 333 // Check that the key (index) is within bounds.
334 __ lw(scratch1, FieldMemOperand(elements, FixedArray::kLengthOffset)); 334 __ lw(scratch1, FieldMemOperand(elements, FixedArray::kLengthOffset));
335 __ Branch(out_of_range, hs, key, Operand(scratch1)); 335 __ Branch(out_of_range, hs, key, Operand(scratch1));
336 336
337 // Fast case: Do the load. 337 // Fast case: Do the load.
338 __ Addu(scratch1, elements, 338 __ Addu(scratch1, elements,
339 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 339 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
340 // The key is a smi. 340 // The key is a smi.
341 ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); 341 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2);
342 __ sll(at, key, kPointerSizeLog2 - kSmiTagSize); 342 __ sll(at, key, kPointerSizeLog2 - kSmiTagSize);
343 __ addu(at, at, scratch1); 343 __ addu(at, at, scratch1);
344 __ lw(scratch2, MemOperand(at)); 344 __ lw(scratch2, MemOperand(at));
345 345
346 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 346 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
347 // In case the loaded value is the_hole we have to consult GetProperty 347 // In case the loaded value is the_hole we have to consult GetProperty
348 // to ensure the prototype chain is searched. 348 // to ensure the prototype chain is searched.
349 __ Branch(out_of_range, eq, scratch2, Operand(at)); 349 __ Branch(out_of_range, eq, scratch2, Operand(at));
350 __ mov(result, scratch2); 350 __ mov(result, scratch2);
351 } 351 }
(...skipping 13 matching lines...) Expand all
365 __ Branch(not_symbol, ge, hash, Operand(FIRST_NONSTRING_TYPE)); 365 __ Branch(not_symbol, ge, hash, Operand(FIRST_NONSTRING_TYPE));
366 366
367 // Is the string an array index, with cached numeric value? 367 // Is the string an array index, with cached numeric value?
368 __ lw(hash, FieldMemOperand(key, String::kHashFieldOffset)); 368 __ lw(hash, FieldMemOperand(key, String::kHashFieldOffset));
369 __ And(at, hash, Operand(String::kContainsCachedArrayIndexMask)); 369 __ And(at, hash, Operand(String::kContainsCachedArrayIndexMask));
370 __ Branch(index_string, eq, at, Operand(zero_reg)); 370 __ Branch(index_string, eq, at, Operand(zero_reg));
371 371
372 // Is the string a symbol? 372 // Is the string a symbol?
373 // map: key map 373 // map: key map
374 __ lbu(hash, FieldMemOperand(map, Map::kInstanceTypeOffset)); 374 __ lbu(hash, FieldMemOperand(map, Map::kInstanceTypeOffset));
375 ASSERT(kSymbolTag != 0); 375 STATIC_ASSERT(kSymbolTag != 0);
376 __ And(at, hash, Operand(kIsSymbolMask)); 376 __ And(at, hash, Operand(kIsSymbolMask));
377 __ Branch(not_symbol, eq, at, Operand(zero_reg)); 377 __ Branch(not_symbol, eq, at, Operand(zero_reg));
378 } 378 }
379 379
380 380
381 // Defined in ic.cc. 381 // Defined in ic.cc.
382 Object* CallIC_Miss(Arguments args); 382 Object* CallIC_Miss(Arguments args);
383 383
384 // The generated code does not accept smi keys. 384 // The generated code does not accept smi keys.
385 // The generated code falls through if both probes miss. 385 // The generated code falls through if both probes miss.
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 // element to the array by writing to array[array.length]. 1262 // element to the array by writing to array[array.length].
1263 1263
1264 __ bind(&extra); 1264 __ bind(&extra);
1265 // Only support writing to array[array.length]. 1265 // Only support writing to array[array.length].
1266 __ Branch(&slow, ne, key, Operand(t0)); 1266 __ Branch(&slow, ne, key, Operand(t0));
1267 // Check for room in the elements backing store. 1267 // Check for room in the elements backing store.
1268 // Both the key and the length of FixedArray are smis. 1268 // Both the key and the length of FixedArray are smis.
1269 __ lw(t0, FieldMemOperand(elements, FixedArray::kLengthOffset)); 1269 __ lw(t0, FieldMemOperand(elements, FixedArray::kLengthOffset));
1270 __ Branch(&slow, hs, key, Operand(t0)); 1270 __ Branch(&slow, hs, key, Operand(t0));
1271 // Calculate key + 1 as smi. 1271 // Calculate key + 1 as smi.
1272 ASSERT_EQ(0, kSmiTag); 1272 STATIC_ASSERT(0 == kSmiTag);
1273 __ Addu(t3, key, Operand(Smi::FromInt(1))); 1273 __ Addu(t3, key, Operand(Smi::FromInt(1)));
1274 __ sw(t3, FieldMemOperand(receiver, JSArray::kLengthOffset)); 1274 __ sw(t3, FieldMemOperand(receiver, JSArray::kLengthOffset));
1275 __ Branch(&fast); 1275 __ Branch(&fast);
1276 1276
1277 1277
1278 // Array case: Get the length and the elements array from the JS 1278 // Array case: Get the length and the elements array from the JS
1279 // array. Check that the array is in fast mode (and writable); if it 1279 // array. Check that the array is in fast mode (and writable); if it
1280 // is the length is always a smi. 1280 // is the length is always a smi.
1281 1281
1282 __ bind(&array); 1282 __ bind(&array);
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); 1631 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch));
1632 patcher.masm()->andi(at, reg, kSmiTagMask); 1632 patcher.masm()->andi(at, reg, kSmiTagMask);
1633 patcher.ChangeBranchCondition(eq); 1633 patcher.ChangeBranchCondition(eq);
1634 } 1634 }
1635 } 1635 }
1636 1636
1637 1637
1638 } } // namespace v8::internal 1638 } } // namespace v8::internal
1639 1639
1640 #endif // V8_TARGET_ARCH_MIPS 1640 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips/stub-cache-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698