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 3471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3482 // have been verified by the caller to not be a smi. | 3482 // have been verified by the caller to not be a smi. |
3483 | 3483 |
3484 // Check that the key is a smi. | 3484 // Check that the key is a smi. |
3485 __ JumpIfNotSmi(key, &miss_force_generic); | 3485 __ JumpIfNotSmi(key, &miss_force_generic); |
3486 | 3486 |
3487 __ ldr(r3, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 3487 __ ldr(r3, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
3488 // r3: elements array | 3488 // r3: elements array |
3489 | 3489 |
3490 // Check that the index is in range. | 3490 // Check that the index is in range. |
3491 __ ldr(ip, FieldMemOperand(r3, ExternalArray::kLengthOffset)); | 3491 __ ldr(ip, FieldMemOperand(r3, ExternalArray::kLengthOffset)); |
3492 __ cmp(ip, Operand(key, ASR, kSmiTagSize)); | 3492 __ cmp(key, ip); |
3493 // Unsigned comparison catches both negative and too-large values. | 3493 // Unsigned comparison catches both negative and too-large values. |
3494 __ b(lo, &miss_force_generic); | 3494 __ b(hs, &miss_force_generic); |
3495 | 3495 |
3496 __ ldr(r3, FieldMemOperand(r3, ExternalArray::kExternalPointerOffset)); | 3496 __ ldr(r3, FieldMemOperand(r3, ExternalArray::kExternalPointerOffset)); |
3497 // r3: base pointer of external storage | 3497 // r3: base pointer of external storage |
3498 | 3498 |
3499 // We are not untagging smi key and instead work with it | 3499 // We are not untagging smi key and instead work with it |
3500 // as if it was premultiplied by 2. | 3500 // as if it was premultiplied by 2. |
3501 ASSERT((kSmiTag == 0) && (kSmiTagSize == 1)); | 3501 ASSERT((kSmiTag == 0) && (kSmiTagSize == 1)); |
3502 | 3502 |
3503 Register value = r2; | 3503 Register value = r2; |
3504 switch (elements_kind) { | 3504 switch (elements_kind) { |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3807 Register key = r1; | 3807 Register key = r1; |
3808 Register receiver = r2; | 3808 Register receiver = r2; |
3809 // r3 mostly holds the elements array or the destination external array. | 3809 // r3 mostly holds the elements array or the destination external array. |
3810 | 3810 |
3811 // This stub is meant to be tail-jumped to, the receiver must already | 3811 // This stub is meant to be tail-jumped to, the receiver must already |
3812 // have been verified by the caller to not be a smi. | 3812 // have been verified by the caller to not be a smi. |
3813 | 3813 |
3814 __ ldr(r3, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 3814 __ ldr(r3, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
3815 | 3815 |
3816 // Check that the key is a smi. | 3816 // Check that the key is a smi. |
3817 __ JumpIfNotSmi(key, &miss_force_generic); | 3817 __ JumpIfNotSmi(key, &miss_force_generic); |
Kevin Millikin (Chromium)
2011/08/11 08:13:06
Moving this check first slightly speeds up the mis
danno
2011/08/11 13:59:42
Done.
| |
3818 | 3818 |
3819 // Check that the index is in range | 3819 // Check that the index is in range |
3820 __ SmiUntag(r4, key); | 3820 __ SmiUntag(r4, key); |
Kevin Millikin (Chromium)
2011/08/11 08:13:06
If you push the untagging down to all the current
danno
2011/08/11 13:59:42
Done.
| |
3821 __ ldr(ip, FieldMemOperand(r3, ExternalArray::kLengthOffset)); | 3821 __ ldr(ip, FieldMemOperand(r3, ExternalArray::kLengthOffset)); |
3822 __ cmp(r4, ip); | 3822 __ cmp(key, ip); |
3823 // Unsigned comparison catches both negative and too-large values. | 3823 // Unsigned comparison catches both negative and too-large values. |
3824 __ b(hs, &miss_force_generic); | 3824 __ b(hs, &miss_force_generic); |
3825 | 3825 |
3826 // Handle both smis and HeapNumbers in the fast path. Go to the | 3826 // Handle both smis and HeapNumbers in the fast path. Go to the |
3827 // runtime for all other kinds of values. | 3827 // runtime for all other kinds of values. |
3828 // r3: external array. | 3828 // r3: external array. |
3829 // r4: key (integer). | 3829 // r4: key (integer). |
3830 if (elements_kind == JSObject::EXTERNAL_PIXEL_ELEMENTS) { | 3830 if (elements_kind == JSObject::EXTERNAL_PIXEL_ELEMENTS) { |
3831 // Double to pixel conversion is only implemented in the runtime for now. | 3831 // Double to pixel conversion is only implemented in the runtime for now. |
3832 __ JumpIfNotSmi(value, &slow); | 3832 __ JumpIfNotSmi(value, &slow); |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4426 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 4426 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
4427 __ Jump(ic, RelocInfo::CODE_TARGET); | 4427 __ Jump(ic, RelocInfo::CODE_TARGET); |
4428 } | 4428 } |
4429 | 4429 |
4430 | 4430 |
4431 #undef __ | 4431 #undef __ |
4432 | 4432 |
4433 } } // namespace v8::internal | 4433 } } // namespace v8::internal |
4434 | 4434 |
4435 #endif // V8_TARGET_ARCH_ARM | 4435 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |