| OLD | NEW |
| 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 Loading... |
| 331 } else { | 331 } else { |
| 332 __ AssertFastElements(elements); | 332 __ AssertFastElements(elements); |
| 333 } | 333 } |
| 334 // Check that the key (index) is within bounds. | 334 // Check that the key (index) is within bounds. |
| 335 __ ldr(scratch1, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 335 __ ldr(scratch1, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
| 336 __ cmp(key, Operand(scratch1)); | 336 __ cmp(key, Operand(scratch1)); |
| 337 __ b(hs, out_of_range); | 337 __ b(hs, out_of_range); |
| 338 // Fast case: Do the load. | 338 // Fast case: Do the load. |
| 339 __ add(scratch1, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 339 __ add(scratch1, elements, 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 __ ldr(scratch2, | 342 __ ldr(scratch2, |
| 343 MemOperand(scratch1, key, LSL, kPointerSizeLog2 - kSmiTagSize)); | 343 MemOperand(scratch1, key, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 344 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 344 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 345 __ cmp(scratch2, ip); | 345 __ cmp(scratch2, ip); |
| 346 // In case the loaded value is the_hole we have to consult GetProperty | 346 // In case the loaded value is the_hole we have to consult GetProperty |
| 347 // to ensure the prototype chain is searched. | 347 // to ensure the prototype chain is searched. |
| 348 __ b(eq, out_of_range); | 348 __ b(eq, out_of_range); |
| 349 __ mov(result, scratch2); | 349 __ mov(result, scratch2); |
| 350 } | 350 } |
| 351 | 351 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 364 __ b(ge, not_symbol); | 364 __ b(ge, not_symbol); |
| 365 | 365 |
| 366 // Is the string an array index, with cached numeric value? | 366 // Is the string an array index, with cached numeric value? |
| 367 __ ldr(hash, FieldMemOperand(key, String::kHashFieldOffset)); | 367 __ ldr(hash, FieldMemOperand(key, String::kHashFieldOffset)); |
| 368 __ tst(hash, Operand(String::kContainsCachedArrayIndexMask)); | 368 __ tst(hash, Operand(String::kContainsCachedArrayIndexMask)); |
| 369 __ b(eq, index_string); | 369 __ b(eq, index_string); |
| 370 | 370 |
| 371 // Is the string a symbol? | 371 // Is the string a symbol? |
| 372 // map: key map | 372 // map: key map |
| 373 __ ldrb(hash, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 373 __ ldrb(hash, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 374 ASSERT(kSymbolTag != 0); | 374 STATIC_ASSERT(kSymbolTag != 0); |
| 375 __ tst(hash, Operand(kIsSymbolMask)); | 375 __ tst(hash, Operand(kIsSymbolMask)); |
| 376 __ b(eq, not_symbol); | 376 __ b(eq, not_symbol); |
| 377 } | 377 } |
| 378 | 378 |
| 379 | 379 |
| 380 // Defined in ic.cc. | 380 // Defined in ic.cc. |
| 381 Object* CallIC_Miss(Arguments args); | 381 Object* CallIC_Miss(Arguments args); |
| 382 | 382 |
| 383 // The generated code does not accept smi keys. | 383 // The generated code does not accept smi keys. |
| 384 // The generated code falls through if both probes miss. | 384 // The generated code falls through if both probes miss. |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 // element to the array by writing to array[array.length]. | 1329 // element to the array by writing to array[array.length]. |
| 1330 __ bind(&extra); | 1330 __ bind(&extra); |
| 1331 // Condition code from comparing key and array length is still available. | 1331 // Condition code from comparing key and array length is still available. |
| 1332 __ b(ne, &slow); // Only support writing to writing to array[array.length]. | 1332 __ b(ne, &slow); // Only support writing to writing to array[array.length]. |
| 1333 // Check for room in the elements backing store. | 1333 // Check for room in the elements backing store. |
| 1334 // Both the key and the length of FixedArray are smis. | 1334 // Both the key and the length of FixedArray are smis. |
| 1335 __ ldr(ip, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 1335 __ ldr(ip, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
| 1336 __ cmp(key, Operand(ip)); | 1336 __ cmp(key, Operand(ip)); |
| 1337 __ b(hs, &slow); | 1337 __ b(hs, &slow); |
| 1338 // Calculate key + 1 as smi. | 1338 // Calculate key + 1 as smi. |
| 1339 ASSERT_EQ(0, kSmiTag); | 1339 STATIC_ASSERT(kSmiTag == 0); |
| 1340 __ add(r4, key, Operand(Smi::FromInt(1))); | 1340 __ add(r4, key, Operand(Smi::FromInt(1))); |
| 1341 __ str(r4, FieldMemOperand(receiver, JSArray::kLengthOffset)); | 1341 __ str(r4, FieldMemOperand(receiver, JSArray::kLengthOffset)); |
| 1342 __ b(&fast); | 1342 __ b(&fast); |
| 1343 | 1343 |
| 1344 // Array case: Get the length and the elements array from the JS | 1344 // Array case: Get the length and the elements array from the JS |
| 1345 // array. Check that the array is in fast mode (and writable); if it | 1345 // array. Check that the array is in fast mode (and writable); if it |
| 1346 // is the length is always a smi. | 1346 // is the length is always a smi. |
| 1347 __ bind(&array); | 1347 __ bind(&array); |
| 1348 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1348 __ ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
| 1349 __ ldr(r4, FieldMemOperand(elements, HeapObject::kMapOffset)); | 1349 __ ldr(r4, FieldMemOperand(elements, HeapObject::kMapOffset)); |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1633 Register reg = Assembler::GetRn(instr_at_patch); | 1633 Register reg = Assembler::GetRn(instr_at_patch); |
| 1634 patcher.masm()->tst(reg, Operand(kSmiTagMask)); | 1634 patcher.masm()->tst(reg, Operand(kSmiTagMask)); |
| 1635 patcher.EmitCondition(eq); | 1635 patcher.EmitCondition(eq); |
| 1636 } | 1636 } |
| 1637 } | 1637 } |
| 1638 | 1638 |
| 1639 | 1639 |
| 1640 } } // namespace v8::internal | 1640 } } // namespace v8::internal |
| 1641 | 1641 |
| 1642 #endif // V8_TARGET_ARCH_ARM | 1642 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |