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