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 3097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3108 | 3108 |
3109 GenerateLoadFunctionPrototype(masm(), r1, r2, r3, &miss); | 3109 GenerateLoadFunctionPrototype(masm(), r1, r2, r3, &miss); |
3110 __ bind(&miss); | 3110 __ bind(&miss); |
3111 __ DecrementCounter(counters->keyed_load_function_prototype(), 1, r2, r3); | 3111 __ DecrementCounter(counters->keyed_load_function_prototype(), 1, r2, r3); |
3112 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 3112 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
3113 | 3113 |
3114 return GetCode(CALLBACKS, name); | 3114 return GetCode(CALLBACKS, name); |
3115 } | 3115 } |
3116 | 3116 |
3117 | 3117 |
3118 MaybeObject* KeyedLoadStubCompiler::CompileLoadFastElement(Map* receiver_map) { | 3118 MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) { |
3119 // ----------- S t a t e ------------- | 3119 // ----------- S t a t e ------------- |
3120 // -- lr : return address | 3120 // -- lr : return address |
3121 // -- r0 : key | 3121 // -- r0 : key |
3122 // -- r1 : receiver | 3122 // -- r1 : receiver |
3123 // ----------------------------------- | 3123 // ----------------------------------- |
3124 MaybeObject* maybe_stub = KeyedLoadFastElementStub().TryGetCode(); | 3124 MaybeObject* maybe_stub; |
| 3125 if (receiver_map->has_fast_elements()) { |
| 3126 maybe_stub = KeyedLoadFastElementStub().TryGetCode(); |
| 3127 } else { |
| 3128 ASSERT(receiver_map->has_external_array_elements()); |
| 3129 JSObject::ElementsKind elements_kind = receiver_map->elements_kind(); |
| 3130 maybe_stub = KeyedLoadExternalArrayStub(elements_kind).TryGetCode(); |
| 3131 } |
3125 Code* stub; | 3132 Code* stub; |
3126 if (!maybe_stub->To(&stub)) return maybe_stub; | 3133 if (!maybe_stub->To(&stub)) return maybe_stub; |
3127 __ DispatchMap(r1, | 3134 __ DispatchMap(r1, |
3128 r2, | 3135 r2, |
3129 Handle<Map>(receiver_map), | 3136 Handle<Map>(receiver_map), |
3130 Handle<Code>(stub), | 3137 Handle<Code>(stub), |
3131 DO_SMI_CHECK); | 3138 DO_SMI_CHECK); |
3132 | 3139 |
3133 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); | 3140 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); |
3134 __ Jump(ic, RelocInfo::CODE_TARGET); | 3141 __ Jump(ic, RelocInfo::CODE_TARGET); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3199 | 3206 |
3200 __ DecrementCounter(counters->keyed_store_field(), 1, r3, r4); | 3207 __ DecrementCounter(counters->keyed_store_field(), 1, r3, r4); |
3201 Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss(); | 3208 Handle<Code> ic = masm()->isolate()->builtins()->KeyedStoreIC_Miss(); |
3202 __ Jump(ic, RelocInfo::CODE_TARGET); | 3209 __ Jump(ic, RelocInfo::CODE_TARGET); |
3203 | 3210 |
3204 // Return the generated code. | 3211 // Return the generated code. |
3205 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); | 3212 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
3206 } | 3213 } |
3207 | 3214 |
3208 | 3215 |
3209 MaybeObject* KeyedStoreStubCompiler::CompileStoreFastElement( | 3216 MaybeObject* KeyedStoreStubCompiler::CompileStoreElement( |
3210 Map* receiver_map) { | 3217 Map* receiver_map) { |
3211 // ----------- S t a t e ------------- | 3218 // ----------- S t a t e ------------- |
3212 // -- r0 : value | 3219 // -- r0 : value |
3213 // -- r1 : key | 3220 // -- r1 : key |
3214 // -- r2 : receiver | 3221 // -- r2 : receiver |
3215 // -- lr : return address | 3222 // -- lr : return address |
3216 // -- r3 : scratch | 3223 // -- r3 : scratch |
3217 // ----------------------------------- | 3224 // ----------------------------------- |
3218 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 3225 MaybeObject* maybe_stub; |
3219 MaybeObject* maybe_stub = | 3226 if (receiver_map->has_fast_elements()) { |
3220 KeyedStoreFastElementStub(is_js_array).TryGetCode(); | 3227 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 3228 maybe_stub = KeyedStoreFastElementStub(is_js_array).TryGetCode(); |
| 3229 } else { |
| 3230 ASSERT(receiver_map->has_external_array_elements()); |
| 3231 JSObject::ElementsKind elements_kind = receiver_map->elements_kind(); |
| 3232 maybe_stub = KeyedStoreExternalArrayStub(elements_kind).TryGetCode(); |
| 3233 } |
3221 Code* stub; | 3234 Code* stub; |
3222 if (!maybe_stub->To(&stub)) return maybe_stub; | 3235 if (!maybe_stub->To(&stub)) return maybe_stub; |
3223 __ DispatchMap(r2, | 3236 __ DispatchMap(r2, |
3224 r3, | 3237 r3, |
3225 Handle<Map>(receiver_map), | 3238 Handle<Map>(receiver_map), |
3226 Handle<Code>(stub), | 3239 Handle<Code>(stub), |
3227 DO_SMI_CHECK); | 3240 DO_SMI_CHECK); |
3228 | 3241 |
3229 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); | 3242 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); |
3230 __ Jump(ic, RelocInfo::CODE_TARGET); | 3243 __ Jump(ic, RelocInfo::CODE_TARGET); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3403 // construction. | 3416 // construction. |
3404 __ bind(&generic_stub_call); | 3417 __ bind(&generic_stub_call); |
3405 Handle<Code> code = masm()->isolate()->builtins()->JSConstructStubGeneric(); | 3418 Handle<Code> code = masm()->isolate()->builtins()->JSConstructStubGeneric(); |
3406 __ Jump(code, RelocInfo::CODE_TARGET); | 3419 __ Jump(code, RelocInfo::CODE_TARGET); |
3407 | 3420 |
3408 // Return the generated code. | 3421 // Return the generated code. |
3409 return GetCode(); | 3422 return GetCode(); |
3410 } | 3423 } |
3411 | 3424 |
3412 | 3425 |
3413 MaybeObject* ExternalArrayLoadStubCompiler::CompileLoad( | |
3414 JSObject*receiver, ExternalArrayType array_type) { | |
3415 // ----------- S t a t e ------------- | |
3416 // -- lr : return address | |
3417 // -- r0 : key | |
3418 // -- r1 : receiver | |
3419 // ----------------------------------- | |
3420 MaybeObject* maybe_stub = | |
3421 KeyedLoadExternalArrayStub(array_type).TryGetCode(); | |
3422 Code* stub; | |
3423 if (!maybe_stub->To(&stub)) return maybe_stub; | |
3424 __ DispatchMap(r1, | |
3425 r2, | |
3426 Handle<Map>(receiver->map()), | |
3427 Handle<Code>(stub), | |
3428 DO_SMI_CHECK); | |
3429 | |
3430 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Miss(); | |
3431 __ Jump(ic, RelocInfo::CODE_TARGET); | |
3432 | |
3433 // Return the generated code. | |
3434 return GetCode(); | |
3435 } | |
3436 | |
3437 | |
3438 MaybeObject* ExternalArrayStoreStubCompiler::CompileStore( | |
3439 JSObject* receiver, ExternalArrayType array_type) { | |
3440 // ----------- S t a t e ------------- | |
3441 // -- r0 : value | |
3442 // -- r1 : name | |
3443 // -- r2 : receiver | |
3444 // -- lr : return address | |
3445 // ----------------------------------- | |
3446 MaybeObject* maybe_stub = | |
3447 KeyedStoreExternalArrayStub(array_type).TryGetCode(); | |
3448 Code* stub; | |
3449 if (!maybe_stub->To(&stub)) return maybe_stub; | |
3450 __ DispatchMap(r2, | |
3451 r3, | |
3452 Handle<Map>(receiver->map()), | |
3453 Handle<Code>(stub), | |
3454 DO_SMI_CHECK); | |
3455 | |
3456 Handle<Code> ic = isolate()->builtins()->KeyedStoreIC_Miss(); | |
3457 __ Jump(ic, RelocInfo::CODE_TARGET); | |
3458 | |
3459 return GetCode(); | |
3460 } | |
3461 | |
3462 | |
3463 #undef __ | 3426 #undef __ |
3464 #define __ ACCESS_MASM(masm) | 3427 #define __ ACCESS_MASM(masm) |
3465 | 3428 |
3466 | 3429 |
3467 static bool IsElementTypeSigned(ExternalArrayType array_type) { | 3430 static bool IsElementTypeSigned(JSObject::ElementsKind elements_kind) { |
3468 switch (array_type) { | 3431 switch (elements_kind) { |
3469 case kExternalByteArray: | 3432 case JSObject::EXTERNAL_BYTE_ELEMENTS: |
3470 case kExternalShortArray: | 3433 case JSObject::EXTERNAL_SHORT_ELEMENTS: |
3471 case kExternalIntArray: | 3434 case JSObject::EXTERNAL_INT_ELEMENTS: |
3472 return true; | 3435 return true; |
3473 | 3436 |
3474 case kExternalUnsignedByteArray: | 3437 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
3475 case kExternalUnsignedShortArray: | 3438 case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
3476 case kExternalUnsignedIntArray: | 3439 case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS: |
| 3440 case JSObject::EXTERNAL_PIXEL_ELEMENTS: |
3477 return false; | 3441 return false; |
3478 | 3442 |
3479 default: | 3443 case JSObject::EXTERNAL_FLOAT_ELEMENTS: |
| 3444 case JSObject::EXTERNAL_DOUBLE_ELEMENTS: |
| 3445 case JSObject::FAST_ELEMENTS: |
| 3446 case JSObject::FAST_DOUBLE_ELEMENTS: |
| 3447 case JSObject::DICTIONARY_ELEMENTS: |
3480 UNREACHABLE(); | 3448 UNREACHABLE(); |
3481 return false; | 3449 return false; |
3482 } | 3450 } |
| 3451 return false; |
3483 } | 3452 } |
3484 | 3453 |
3485 | 3454 |
3486 void KeyedLoadStubCompiler::GenerateLoadExternalArray( | 3455 void KeyedLoadStubCompiler::GenerateLoadExternalArray( |
3487 MacroAssembler* masm, | 3456 MacroAssembler* masm, |
3488 ExternalArrayType array_type) { | 3457 JSObject::ElementsKind elements_kind) { |
3489 // ---------- S t a t e -------------- | 3458 // ---------- S t a t e -------------- |
3490 // -- lr : return address | 3459 // -- lr : return address |
3491 // -- r0 : key | 3460 // -- r0 : key |
3492 // -- r1 : receiver | 3461 // -- r1 : receiver |
3493 // ----------------------------------- | 3462 // ----------------------------------- |
3494 Label miss_force_generic, slow, failed_allocation; | 3463 Label miss_force_generic, slow, failed_allocation; |
3495 | 3464 |
3496 Register key = r0; | 3465 Register key = r0; |
3497 Register receiver = r1; | 3466 Register receiver = r1; |
3498 | 3467 |
(...skipping 13 matching lines...) Expand all Loading... |
3512 __ b(lo, &miss_force_generic); | 3481 __ b(lo, &miss_force_generic); |
3513 | 3482 |
3514 __ ldr(r3, FieldMemOperand(r3, ExternalArray::kExternalPointerOffset)); | 3483 __ ldr(r3, FieldMemOperand(r3, ExternalArray::kExternalPointerOffset)); |
3515 // r3: base pointer of external storage | 3484 // r3: base pointer of external storage |
3516 | 3485 |
3517 // We are not untagging smi key and instead work with it | 3486 // We are not untagging smi key and instead work with it |
3518 // as if it was premultiplied by 2. | 3487 // as if it was premultiplied by 2. |
3519 ASSERT((kSmiTag == 0) && (kSmiTagSize == 1)); | 3488 ASSERT((kSmiTag == 0) && (kSmiTagSize == 1)); |
3520 | 3489 |
3521 Register value = r2; | 3490 Register value = r2; |
3522 switch (array_type) { | 3491 switch (elements_kind) { |
3523 case kExternalByteArray: | 3492 case JSObject::EXTERNAL_BYTE_ELEMENTS: |
3524 __ ldrsb(value, MemOperand(r3, key, LSR, 1)); | 3493 __ ldrsb(value, MemOperand(r3, key, LSR, 1)); |
3525 break; | 3494 break; |
3526 case kExternalPixelArray: | 3495 case JSObject::EXTERNAL_PIXEL_ELEMENTS: |
3527 case kExternalUnsignedByteArray: | 3496 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
3528 __ ldrb(value, MemOperand(r3, key, LSR, 1)); | 3497 __ ldrb(value, MemOperand(r3, key, LSR, 1)); |
3529 break; | 3498 break; |
3530 case kExternalShortArray: | 3499 case JSObject::EXTERNAL_SHORT_ELEMENTS: |
3531 __ ldrsh(value, MemOperand(r3, key, LSL, 0)); | 3500 __ ldrsh(value, MemOperand(r3, key, LSL, 0)); |
3532 break; | 3501 break; |
3533 case kExternalUnsignedShortArray: | 3502 case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
3534 __ ldrh(value, MemOperand(r3, key, LSL, 0)); | 3503 __ ldrh(value, MemOperand(r3, key, LSL, 0)); |
3535 break; | 3504 break; |
3536 case kExternalIntArray: | 3505 case JSObject::EXTERNAL_INT_ELEMENTS: |
3537 case kExternalUnsignedIntArray: | 3506 case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS: |
3538 __ ldr(value, MemOperand(r3, key, LSL, 1)); | 3507 __ ldr(value, MemOperand(r3, key, LSL, 1)); |
3539 break; | 3508 break; |
3540 case kExternalFloatArray: | 3509 case JSObject::EXTERNAL_FLOAT_ELEMENTS: |
3541 if (CpuFeatures::IsSupported(VFP3)) { | 3510 if (CpuFeatures::IsSupported(VFP3)) { |
3542 CpuFeatures::Scope scope(VFP3); | 3511 CpuFeatures::Scope scope(VFP3); |
3543 __ add(r2, r3, Operand(key, LSL, 1)); | 3512 __ add(r2, r3, Operand(key, LSL, 1)); |
3544 __ vldr(s0, r2, 0); | 3513 __ vldr(s0, r2, 0); |
3545 } else { | 3514 } else { |
3546 __ ldr(value, MemOperand(r3, key, LSL, 1)); | 3515 __ ldr(value, MemOperand(r3, key, LSL, 1)); |
3547 } | 3516 } |
3548 break; | 3517 break; |
3549 case kExternalDoubleArray: | 3518 case JSObject::EXTERNAL_DOUBLE_ELEMENTS: |
3550 if (CpuFeatures::IsSupported(VFP3)) { | 3519 if (CpuFeatures::IsSupported(VFP3)) { |
3551 CpuFeatures::Scope scope(VFP3); | 3520 CpuFeatures::Scope scope(VFP3); |
3552 __ add(r2, r3, Operand(key, LSL, 2)); | 3521 __ add(r2, r3, Operand(key, LSL, 2)); |
3553 __ vldr(d0, r2, 0); | 3522 __ vldr(d0, r2, 0); |
3554 } else { | 3523 } else { |
3555 __ add(r4, r3, Operand(key, LSL, 2)); | 3524 __ add(r4, r3, Operand(key, LSL, 2)); |
3556 // r4: pointer to the beginning of the double we want to load. | 3525 // r4: pointer to the beginning of the double we want to load. |
3557 __ ldr(r2, MemOperand(r4, 0)); | 3526 __ ldr(r2, MemOperand(r4, 0)); |
3558 __ ldr(r3, MemOperand(r4, Register::kSizeInBytes)); | 3527 __ ldr(r3, MemOperand(r4, Register::kSizeInBytes)); |
3559 } | 3528 } |
3560 break; | 3529 break; |
3561 default: | 3530 case JSObject::FAST_ELEMENTS: |
| 3531 case JSObject::FAST_DOUBLE_ELEMENTS: |
| 3532 case JSObject::DICTIONARY_ELEMENTS: |
3562 UNREACHABLE(); | 3533 UNREACHABLE(); |
3563 break; | 3534 break; |
3564 } | 3535 } |
3565 | 3536 |
3566 // For integer array types: | 3537 // For integer array types: |
3567 // r2: value | 3538 // r2: value |
3568 // For float array type: | 3539 // For float array type: |
3569 // s0: value (if VFP3 is supported) | 3540 // s0: value (if VFP3 is supported) |
3570 // r2: value (if VFP3 is not supported) | 3541 // r2: value (if VFP3 is not supported) |
3571 // For double array type: | 3542 // For double array type: |
3572 // d0: value (if VFP3 is supported) | 3543 // d0: value (if VFP3 is supported) |
3573 // r2/r3: value (if VFP3 is not supported) | 3544 // r2/r3: value (if VFP3 is not supported) |
3574 | 3545 |
3575 if (array_type == kExternalIntArray) { | 3546 if (elements_kind == JSObject::EXTERNAL_INT_ELEMENTS) { |
3576 // For the Int and UnsignedInt array types, we need to see whether | 3547 // For the Int and UnsignedInt array types, we need to see whether |
3577 // the value can be represented in a Smi. If not, we need to convert | 3548 // the value can be represented in a Smi. If not, we need to convert |
3578 // it to a HeapNumber. | 3549 // it to a HeapNumber. |
3579 Label box_int; | 3550 Label box_int; |
3580 __ cmp(value, Operand(0xC0000000)); | 3551 __ cmp(value, Operand(0xC0000000)); |
3581 __ b(mi, &box_int); | 3552 __ b(mi, &box_int); |
3582 // Tag integer as smi and return it. | 3553 // Tag integer as smi and return it. |
3583 __ mov(r0, Operand(value, LSL, kSmiTagSize)); | 3554 __ mov(r0, Operand(value, LSL, kSmiTagSize)); |
3584 __ Ret(); | 3555 __ Ret(); |
3585 | 3556 |
(...skipping 23 matching lines...) Expand all Loading... |
3609 dest, | 3580 dest, |
3610 d0, | 3581 d0, |
3611 dst1, | 3582 dst1, |
3612 dst2, | 3583 dst2, |
3613 r9, | 3584 r9, |
3614 s0); | 3585 s0); |
3615 __ str(dst1, FieldMemOperand(r0, HeapNumber::kMantissaOffset)); | 3586 __ str(dst1, FieldMemOperand(r0, HeapNumber::kMantissaOffset)); |
3616 __ str(dst2, FieldMemOperand(r0, HeapNumber::kExponentOffset)); | 3587 __ str(dst2, FieldMemOperand(r0, HeapNumber::kExponentOffset)); |
3617 __ Ret(); | 3588 __ Ret(); |
3618 } | 3589 } |
3619 } else if (array_type == kExternalUnsignedIntArray) { | 3590 } else if (elements_kind == JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS) { |
3620 // The test is different for unsigned int values. Since we need | 3591 // The test is different for unsigned int values. Since we need |
3621 // the value to be in the range of a positive smi, we can't | 3592 // the value to be in the range of a positive smi, we can't |
3622 // handle either of the top two bits being set in the value. | 3593 // handle either of the top two bits being set in the value. |
3623 if (CpuFeatures::IsSupported(VFP3)) { | 3594 if (CpuFeatures::IsSupported(VFP3)) { |
3624 CpuFeatures::Scope scope(VFP3); | 3595 CpuFeatures::Scope scope(VFP3); |
3625 Label box_int, done; | 3596 Label box_int, done; |
3626 __ tst(value, Operand(0xC0000000)); | 3597 __ tst(value, Operand(0xC0000000)); |
3627 __ b(ne, &box_int); | 3598 __ b(ne, &box_int); |
3628 // Tag integer as smi and return it. | 3599 // Tag integer as smi and return it. |
3629 __ mov(r0, Operand(value, LSL, kSmiTagSize)); | 3600 __ mov(r0, Operand(value, LSL, kSmiTagSize)); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3674 // space. | 3645 // space. |
3675 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); | 3646 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); |
3676 __ AllocateHeapNumber(r4, r5, r7, r6, &slow); | 3647 __ AllocateHeapNumber(r4, r5, r7, r6, &slow); |
3677 | 3648 |
3678 __ str(hiword, FieldMemOperand(r4, HeapNumber::kExponentOffset)); | 3649 __ str(hiword, FieldMemOperand(r4, HeapNumber::kExponentOffset)); |
3679 __ str(loword, FieldMemOperand(r4, HeapNumber::kMantissaOffset)); | 3650 __ str(loword, FieldMemOperand(r4, HeapNumber::kMantissaOffset)); |
3680 | 3651 |
3681 __ mov(r0, r4); | 3652 __ mov(r0, r4); |
3682 __ Ret(); | 3653 __ Ret(); |
3683 } | 3654 } |
3684 } else if (array_type == kExternalFloatArray) { | 3655 } else if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) { |
3685 // For the floating-point array type, we need to always allocate a | 3656 // For the floating-point array type, we need to always allocate a |
3686 // HeapNumber. | 3657 // HeapNumber. |
3687 if (CpuFeatures::IsSupported(VFP3)) { | 3658 if (CpuFeatures::IsSupported(VFP3)) { |
3688 CpuFeatures::Scope scope(VFP3); | 3659 CpuFeatures::Scope scope(VFP3); |
3689 // Allocate a HeapNumber for the result. Don't use r0 and r1 as | 3660 // Allocate a HeapNumber for the result. Don't use r0 and r1 as |
3690 // AllocateHeapNumber clobbers all registers - also when jumping due to | 3661 // AllocateHeapNumber clobbers all registers - also when jumping due to |
3691 // exhausted young space. | 3662 // exhausted young space. |
3692 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); | 3663 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); |
3693 __ AllocateHeapNumber(r2, r3, r4, r6, &slow); | 3664 __ AllocateHeapNumber(r2, r3, r4, r6, &slow); |
3694 __ vcvt_f64_f32(d0, s0); | 3665 __ vcvt_f64_f32(d0, s0); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3744 | 3715 |
3745 __ orr(r2, r2, Operand(r0, LSR, kMantissaShiftForHiWord)); | 3716 __ orr(r2, r2, Operand(r0, LSR, kMantissaShiftForHiWord)); |
3746 __ mov(r0, Operand(r0, LSL, kMantissaShiftForLoWord)); | 3717 __ mov(r0, Operand(r0, LSL, kMantissaShiftForLoWord)); |
3747 | 3718 |
3748 __ str(r2, FieldMemOperand(r3, HeapNumber::kExponentOffset)); | 3719 __ str(r2, FieldMemOperand(r3, HeapNumber::kExponentOffset)); |
3749 __ str(r0, FieldMemOperand(r3, HeapNumber::kMantissaOffset)); | 3720 __ str(r0, FieldMemOperand(r3, HeapNumber::kMantissaOffset)); |
3750 | 3721 |
3751 __ mov(r0, r3); | 3722 __ mov(r0, r3); |
3752 __ Ret(); | 3723 __ Ret(); |
3753 } | 3724 } |
3754 } else if (array_type == kExternalDoubleArray) { | 3725 } else if (elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS) { |
3755 if (CpuFeatures::IsSupported(VFP3)) { | 3726 if (CpuFeatures::IsSupported(VFP3)) { |
3756 CpuFeatures::Scope scope(VFP3); | 3727 CpuFeatures::Scope scope(VFP3); |
3757 // Allocate a HeapNumber for the result. Don't use r0 and r1 as | 3728 // Allocate a HeapNumber for the result. Don't use r0 and r1 as |
3758 // AllocateHeapNumber clobbers all registers - also when jumping due to | 3729 // AllocateHeapNumber clobbers all registers - also when jumping due to |
3759 // exhausted young space. | 3730 // exhausted young space. |
3760 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); | 3731 __ LoadRoot(r6, Heap::kHeapNumberMapRootIndex); |
3761 __ AllocateHeapNumber(r2, r3, r4, r6, &slow); | 3732 __ AllocateHeapNumber(r2, r3, r4, r6, &slow); |
3762 __ sub(r1, r2, Operand(kHeapObjectTag)); | 3733 __ sub(r1, r2, Operand(kHeapObjectTag)); |
3763 __ vstr(d0, r1, HeapNumber::kValueOffset); | 3734 __ vstr(d0, r1, HeapNumber::kValueOffset); |
3764 | 3735 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3801 | 3772 |
3802 __ bind(&miss_force_generic); | 3773 __ bind(&miss_force_generic); |
3803 Code* stub = masm->isolate()->builtins()->builtin( | 3774 Code* stub = masm->isolate()->builtins()->builtin( |
3804 Builtins::kKeyedLoadIC_MissForceGeneric); | 3775 Builtins::kKeyedLoadIC_MissForceGeneric); |
3805 __ Jump(Handle<Code>(stub), RelocInfo::CODE_TARGET); | 3776 __ Jump(Handle<Code>(stub), RelocInfo::CODE_TARGET); |
3806 } | 3777 } |
3807 | 3778 |
3808 | 3779 |
3809 void KeyedStoreStubCompiler::GenerateStoreExternalArray( | 3780 void KeyedStoreStubCompiler::GenerateStoreExternalArray( |
3810 MacroAssembler* masm, | 3781 MacroAssembler* masm, |
3811 ExternalArrayType array_type) { | 3782 JSObject::ElementsKind elements_kind) { |
3812 // ---------- S t a t e -------------- | 3783 // ---------- S t a t e -------------- |
3813 // -- r0 : value | 3784 // -- r0 : value |
3814 // -- r1 : key | 3785 // -- r1 : key |
3815 // -- r2 : receiver | 3786 // -- r2 : receiver |
3816 // -- lr : return address | 3787 // -- lr : return address |
3817 // ----------------------------------- | 3788 // ----------------------------------- |
3818 Label slow, check_heap_number, miss_force_generic; | 3789 Label slow, check_heap_number, miss_force_generic; |
3819 | 3790 |
3820 // Register usage. | 3791 // Register usage. |
3821 Register value = r0; | 3792 Register value = r0; |
(...skipping 13 matching lines...) Expand all Loading... |
3835 __ SmiUntag(r4, key); | 3806 __ SmiUntag(r4, key); |
3836 __ ldr(ip, FieldMemOperand(r3, ExternalArray::kLengthOffset)); | 3807 __ ldr(ip, FieldMemOperand(r3, ExternalArray::kLengthOffset)); |
3837 __ cmp(r4, ip); | 3808 __ cmp(r4, ip); |
3838 // Unsigned comparison catches both negative and too-large values. | 3809 // Unsigned comparison catches both negative and too-large values. |
3839 __ b(hs, &miss_force_generic); | 3810 __ b(hs, &miss_force_generic); |
3840 | 3811 |
3841 // Handle both smis and HeapNumbers in the fast path. Go to the | 3812 // Handle both smis and HeapNumbers in the fast path. Go to the |
3842 // runtime for all other kinds of values. | 3813 // runtime for all other kinds of values. |
3843 // r3: external array. | 3814 // r3: external array. |
3844 // r4: key (integer). | 3815 // r4: key (integer). |
3845 if (array_type == kExternalPixelArray) { | 3816 if (elements_kind == JSObject::EXTERNAL_PIXEL_ELEMENTS) { |
3846 // Double to pixel conversion is only implemented in the runtime for now. | 3817 // Double to pixel conversion is only implemented in the runtime for now. |
3847 __ JumpIfNotSmi(value, &slow); | 3818 __ JumpIfNotSmi(value, &slow); |
3848 } else { | 3819 } else { |
3849 __ JumpIfNotSmi(value, &check_heap_number); | 3820 __ JumpIfNotSmi(value, &check_heap_number); |
3850 } | 3821 } |
3851 __ SmiUntag(r5, value); | 3822 __ SmiUntag(r5, value); |
3852 __ ldr(r3, FieldMemOperand(r3, ExternalArray::kExternalPointerOffset)); | 3823 __ ldr(r3, FieldMemOperand(r3, ExternalArray::kExternalPointerOffset)); |
3853 | 3824 |
3854 // r3: base pointer of external storage. | 3825 // r3: base pointer of external storage. |
3855 // r4: key (integer). | 3826 // r4: key (integer). |
3856 // r5: value (integer). | 3827 // r5: value (integer). |
3857 switch (array_type) { | 3828 switch (elements_kind) { |
3858 case kExternalPixelArray: | 3829 case JSObject::EXTERNAL_PIXEL_ELEMENTS: |
3859 // Clamp the value to [0..255]. | 3830 // Clamp the value to [0..255]. |
3860 __ Usat(r5, 8, Operand(r5)); | 3831 __ Usat(r5, 8, Operand(r5)); |
3861 __ strb(r5, MemOperand(r3, r4, LSL, 0)); | 3832 __ strb(r5, MemOperand(r3, r4, LSL, 0)); |
3862 break; | 3833 break; |
3863 case kExternalByteArray: | 3834 case JSObject::EXTERNAL_BYTE_ELEMENTS: |
3864 case kExternalUnsignedByteArray: | 3835 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
3865 __ strb(r5, MemOperand(r3, r4, LSL, 0)); | 3836 __ strb(r5, MemOperand(r3, r4, LSL, 0)); |
3866 break; | 3837 break; |
3867 case kExternalShortArray: | 3838 case JSObject::EXTERNAL_SHORT_ELEMENTS: |
3868 case kExternalUnsignedShortArray: | 3839 case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
3869 __ strh(r5, MemOperand(r3, r4, LSL, 1)); | 3840 __ strh(r5, MemOperand(r3, r4, LSL, 1)); |
3870 break; | 3841 break; |
3871 case kExternalIntArray: | 3842 case JSObject::EXTERNAL_INT_ELEMENTS: |
3872 case kExternalUnsignedIntArray: | 3843 case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS: |
3873 __ str(r5, MemOperand(r3, r4, LSL, 2)); | 3844 __ str(r5, MemOperand(r3, r4, LSL, 2)); |
3874 break; | 3845 break; |
3875 case kExternalFloatArray: | 3846 case JSObject::EXTERNAL_FLOAT_ELEMENTS: |
3876 // Perform int-to-float conversion and store to memory. | 3847 // Perform int-to-float conversion and store to memory. |
3877 StoreIntAsFloat(masm, r3, r4, r5, r6, r7, r9); | 3848 StoreIntAsFloat(masm, r3, r4, r5, r6, r7, r9); |
3878 break; | 3849 break; |
3879 case kExternalDoubleArray: | 3850 case JSObject::EXTERNAL_DOUBLE_ELEMENTS: |
3880 __ add(r3, r3, Operand(r4, LSL, 3)); | 3851 __ add(r3, r3, Operand(r4, LSL, 3)); |
3881 // r3: effective address of the double element | 3852 // r3: effective address of the double element |
3882 FloatingPointHelper::Destination destination; | 3853 FloatingPointHelper::Destination destination; |
3883 if (CpuFeatures::IsSupported(VFP3)) { | 3854 if (CpuFeatures::IsSupported(VFP3)) { |
3884 destination = FloatingPointHelper::kVFPRegisters; | 3855 destination = FloatingPointHelper::kVFPRegisters; |
3885 } else { | 3856 } else { |
3886 destination = FloatingPointHelper::kCoreRegisters; | 3857 destination = FloatingPointHelper::kCoreRegisters; |
3887 } | 3858 } |
3888 FloatingPointHelper::ConvertIntToDouble( | 3859 FloatingPointHelper::ConvertIntToDouble( |
3889 masm, r5, destination, | 3860 masm, r5, destination, |
3890 d0, r6, r7, // These are: double_dst, dst1, dst2. | 3861 d0, r6, r7, // These are: double_dst, dst1, dst2. |
3891 r4, s2); // These are: scratch2, single_scratch. | 3862 r4, s2); // These are: scratch2, single_scratch. |
3892 if (destination == FloatingPointHelper::kVFPRegisters) { | 3863 if (destination == FloatingPointHelper::kVFPRegisters) { |
3893 CpuFeatures::Scope scope(VFP3); | 3864 CpuFeatures::Scope scope(VFP3); |
3894 __ vstr(d0, r3, 0); | 3865 __ vstr(d0, r3, 0); |
3895 } else { | 3866 } else { |
3896 __ str(r6, MemOperand(r3, 0)); | 3867 __ str(r6, MemOperand(r3, 0)); |
3897 __ str(r7, MemOperand(r3, Register::kSizeInBytes)); | 3868 __ str(r7, MemOperand(r3, Register::kSizeInBytes)); |
3898 } | 3869 } |
3899 break; | 3870 break; |
3900 default: | 3871 case JSObject::FAST_ELEMENTS: |
| 3872 case JSObject::FAST_DOUBLE_ELEMENTS: |
| 3873 case JSObject::DICTIONARY_ELEMENTS: |
3901 UNREACHABLE(); | 3874 UNREACHABLE(); |
3902 break; | 3875 break; |
3903 } | 3876 } |
3904 | 3877 |
3905 // Entry registers are intact, r0 holds the value which is the return value. | 3878 // Entry registers are intact, r0 holds the value which is the return value. |
3906 __ Ret(); | 3879 __ Ret(); |
3907 | 3880 |
3908 if (array_type != kExternalPixelArray) { | 3881 if (elements_kind != JSObject::EXTERNAL_PIXEL_ELEMENTS) { |
3909 // r3: external array. | 3882 // r3: external array. |
3910 // r4: index (integer). | 3883 // r4: index (integer). |
3911 __ bind(&check_heap_number); | 3884 __ bind(&check_heap_number); |
3912 __ CompareObjectType(value, r5, r6, HEAP_NUMBER_TYPE); | 3885 __ CompareObjectType(value, r5, r6, HEAP_NUMBER_TYPE); |
3913 __ b(ne, &slow); | 3886 __ b(ne, &slow); |
3914 | 3887 |
3915 __ ldr(r3, FieldMemOperand(r3, ExternalArray::kExternalPointerOffset)); | 3888 __ ldr(r3, FieldMemOperand(r3, ExternalArray::kExternalPointerOffset)); |
3916 | 3889 |
3917 // r3: base pointer of external storage. | 3890 // r3: base pointer of external storage. |
3918 // r4: key (integer). | 3891 // r4: key (integer). |
3919 | 3892 |
3920 // The WebGL specification leaves the behavior of storing NaN and | 3893 // The WebGL specification leaves the behavior of storing NaN and |
3921 // +/-Infinity into integer arrays basically undefined. For more | 3894 // +/-Infinity into integer arrays basically undefined. For more |
3922 // reproducible behavior, convert these to zero. | 3895 // reproducible behavior, convert these to zero. |
3923 if (CpuFeatures::IsSupported(VFP3)) { | 3896 if (CpuFeatures::IsSupported(VFP3)) { |
3924 CpuFeatures::Scope scope(VFP3); | 3897 CpuFeatures::Scope scope(VFP3); |
3925 | 3898 |
3926 if (array_type == kExternalFloatArray) { | 3899 if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) { |
3927 // vldr requires offset to be a multiple of 4 so we can not | 3900 // vldr requires offset to be a multiple of 4 so we can not |
3928 // include -kHeapObjectTag into it. | 3901 // include -kHeapObjectTag into it. |
3929 __ sub(r5, r0, Operand(kHeapObjectTag)); | 3902 __ sub(r5, r0, Operand(kHeapObjectTag)); |
3930 __ vldr(d0, r5, HeapNumber::kValueOffset); | 3903 __ vldr(d0, r5, HeapNumber::kValueOffset); |
3931 __ add(r5, r3, Operand(r4, LSL, 2)); | 3904 __ add(r5, r3, Operand(r4, LSL, 2)); |
3932 __ vcvt_f32_f64(s0, d0); | 3905 __ vcvt_f32_f64(s0, d0); |
3933 __ vstr(s0, r5, 0); | 3906 __ vstr(s0, r5, 0); |
3934 } else if (array_type == kExternalDoubleArray) { | 3907 } else if (elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS) { |
3935 __ sub(r5, r0, Operand(kHeapObjectTag)); | 3908 __ sub(r5, r0, Operand(kHeapObjectTag)); |
3936 __ vldr(d0, r5, HeapNumber::kValueOffset); | 3909 __ vldr(d0, r5, HeapNumber::kValueOffset); |
3937 __ add(r5, r3, Operand(r4, LSL, 3)); | 3910 __ add(r5, r3, Operand(r4, LSL, 3)); |
3938 __ vstr(d0, r5, 0); | 3911 __ vstr(d0, r5, 0); |
3939 } else { | 3912 } else { |
3940 // Hoisted load. vldr requires offset to be a multiple of 4 so we can | 3913 // Hoisted load. vldr requires offset to be a multiple of 4 so we can |
3941 // not include -kHeapObjectTag into it. | 3914 // not include -kHeapObjectTag into it. |
3942 __ sub(r5, value, Operand(kHeapObjectTag)); | 3915 __ sub(r5, value, Operand(kHeapObjectTag)); |
3943 __ vldr(d0, r5, HeapNumber::kValueOffset); | 3916 __ vldr(d0, r5, HeapNumber::kValueOffset); |
3944 __ EmitECMATruncate(r5, d0, s2, r6, r7, r9); | 3917 __ EmitECMATruncate(r5, d0, s2, r6, r7, r9); |
3945 | 3918 |
3946 switch (array_type) { | 3919 switch (elements_kind) { |
3947 case kExternalByteArray: | 3920 case JSObject::EXTERNAL_BYTE_ELEMENTS: |
3948 case kExternalUnsignedByteArray: | 3921 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
3949 __ strb(r5, MemOperand(r3, r4, LSL, 0)); | 3922 __ strb(r5, MemOperand(r3, r4, LSL, 0)); |
3950 break; | 3923 break; |
3951 case kExternalShortArray: | 3924 case JSObject::EXTERNAL_SHORT_ELEMENTS: |
3952 case kExternalUnsignedShortArray: | 3925 case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
3953 __ strh(r5, MemOperand(r3, r4, LSL, 1)); | 3926 __ strh(r5, MemOperand(r3, r4, LSL, 1)); |
3954 break; | 3927 break; |
3955 case kExternalIntArray: | 3928 case JSObject::EXTERNAL_INT_ELEMENTS: |
3956 case kExternalUnsignedIntArray: | 3929 case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS: |
3957 __ str(r5, MemOperand(r3, r4, LSL, 2)); | 3930 __ str(r5, MemOperand(r3, r4, LSL, 2)); |
3958 break; | 3931 break; |
3959 default: | 3932 case JSObject::EXTERNAL_PIXEL_ELEMENTS: |
| 3933 case JSObject::EXTERNAL_FLOAT_ELEMENTS: |
| 3934 case JSObject::EXTERNAL_DOUBLE_ELEMENTS: |
| 3935 case JSObject::FAST_ELEMENTS: |
| 3936 case JSObject::FAST_DOUBLE_ELEMENTS: |
| 3937 case JSObject::DICTIONARY_ELEMENTS: |
3960 UNREACHABLE(); | 3938 UNREACHABLE(); |
3961 break; | 3939 break; |
3962 } | 3940 } |
3963 } | 3941 } |
3964 | 3942 |
3965 // Entry registers are intact, r0 holds the value which is the return | 3943 // Entry registers are intact, r0 holds the value which is the return |
3966 // value. | 3944 // value. |
3967 __ Ret(); | 3945 __ Ret(); |
3968 } else { | 3946 } else { |
3969 // VFP3 is not available do manual conversions. | 3947 // VFP3 is not available do manual conversions. |
3970 __ ldr(r5, FieldMemOperand(value, HeapNumber::kExponentOffset)); | 3948 __ ldr(r5, FieldMemOperand(value, HeapNumber::kExponentOffset)); |
3971 __ ldr(r6, FieldMemOperand(value, HeapNumber::kMantissaOffset)); | 3949 __ ldr(r6, FieldMemOperand(value, HeapNumber::kMantissaOffset)); |
3972 | 3950 |
3973 if (array_type == kExternalFloatArray) { | 3951 if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) { |
3974 Label done, nan_or_infinity_or_zero; | 3952 Label done, nan_or_infinity_or_zero; |
3975 static const int kMantissaInHiWordShift = | 3953 static const int kMantissaInHiWordShift = |
3976 kBinary32MantissaBits - HeapNumber::kMantissaBitsInTopWord; | 3954 kBinary32MantissaBits - HeapNumber::kMantissaBitsInTopWord; |
3977 | 3955 |
3978 static const int kMantissaInLoWordShift = | 3956 static const int kMantissaInLoWordShift = |
3979 kBitsPerInt - kMantissaInHiWordShift; | 3957 kBitsPerInt - kMantissaInHiWordShift; |
3980 | 3958 |
3981 // Test for all special exponent values: zeros, subnormal numbers, NaNs | 3959 // Test for all special exponent values: zeros, subnormal numbers, NaNs |
3982 // and infinities. All these should be converted to 0. | 3960 // and infinities. All these should be converted to 0. |
3983 __ mov(r7, Operand(HeapNumber::kExponentMask)); | 3961 __ mov(r7, Operand(HeapNumber::kExponentMask)); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4015 // value. | 3993 // value. |
4016 __ Ret(); | 3994 __ Ret(); |
4017 | 3995 |
4018 __ bind(&nan_or_infinity_or_zero); | 3996 __ bind(&nan_or_infinity_or_zero); |
4019 __ and_(r7, r5, Operand(HeapNumber::kSignMask)); | 3997 __ and_(r7, r5, Operand(HeapNumber::kSignMask)); |
4020 __ and_(r5, r5, Operand(HeapNumber::kMantissaMask)); | 3998 __ and_(r5, r5, Operand(HeapNumber::kMantissaMask)); |
4021 __ orr(r9, r9, r7); | 3999 __ orr(r9, r9, r7); |
4022 __ orr(r9, r9, Operand(r5, LSL, kMantissaInHiWordShift)); | 4000 __ orr(r9, r9, Operand(r5, LSL, kMantissaInHiWordShift)); |
4023 __ orr(r5, r9, Operand(r6, LSR, kMantissaInLoWordShift)); | 4001 __ orr(r5, r9, Operand(r6, LSR, kMantissaInLoWordShift)); |
4024 __ b(&done); | 4002 __ b(&done); |
4025 } else if (array_type == kExternalDoubleArray) { | 4003 } else if (elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS) { |
4026 __ add(r7, r3, Operand(r4, LSL, 3)); | 4004 __ add(r7, r3, Operand(r4, LSL, 3)); |
4027 // r7: effective address of destination element. | 4005 // r7: effective address of destination element. |
4028 __ str(r6, MemOperand(r7, 0)); | 4006 __ str(r6, MemOperand(r7, 0)); |
4029 __ str(r5, MemOperand(r7, Register::kSizeInBytes)); | 4007 __ str(r5, MemOperand(r7, Register::kSizeInBytes)); |
4030 __ Ret(); | 4008 __ Ret(); |
4031 } else { | 4009 } else { |
4032 bool is_signed_type = IsElementTypeSigned(array_type); | 4010 bool is_signed_type = IsElementTypeSigned(elements_kind); |
4033 int meaningfull_bits = is_signed_type ? (kBitsPerInt - 1) : kBitsPerInt; | 4011 int meaningfull_bits = is_signed_type ? (kBitsPerInt - 1) : kBitsPerInt; |
4034 int32_t min_value = is_signed_type ? 0x80000000 : 0x00000000; | 4012 int32_t min_value = is_signed_type ? 0x80000000 : 0x00000000; |
4035 | 4013 |
4036 Label done, sign; | 4014 Label done, sign; |
4037 | 4015 |
4038 // Test for all special exponent values: zeros, subnormal numbers, NaNs | 4016 // Test for all special exponent values: zeros, subnormal numbers, NaNs |
4039 // and infinities. All these should be converted to 0. | 4017 // and infinities. All these should be converted to 0. |
4040 __ mov(r7, Operand(HeapNumber::kExponentMask)); | 4018 __ mov(r7, Operand(HeapNumber::kExponentMask)); |
4041 __ and_(r9, r5, Operand(r7), SetCC); | 4019 __ and_(r9, r5, Operand(r7), SetCC); |
4042 __ mov(r5, Operand(0, RelocInfo::NONE), LeaveCC, eq); | 4020 __ mov(r5, Operand(0, RelocInfo::NONE), LeaveCC, eq); |
(...skipping 26 matching lines...) Expand all Loading... |
4069 __ rsb(r9, r9, Operand(0, RelocInfo::NONE)); | 4047 __ rsb(r9, r9, Operand(0, RelocInfo::NONE)); |
4070 __ mov(r5, Operand(r5, LSL, r9)); | 4048 __ mov(r5, Operand(r5, LSL, r9)); |
4071 __ rsb(r9, r9, Operand(meaningfull_bits)); | 4049 __ rsb(r9, r9, Operand(meaningfull_bits)); |
4072 __ orr(r5, r5, Operand(r6, LSR, r9)); | 4050 __ orr(r5, r5, Operand(r6, LSR, r9)); |
4073 | 4051 |
4074 __ bind(&sign); | 4052 __ bind(&sign); |
4075 __ teq(r7, Operand(0, RelocInfo::NONE)); | 4053 __ teq(r7, Operand(0, RelocInfo::NONE)); |
4076 __ rsb(r5, r5, Operand(0, RelocInfo::NONE), LeaveCC, ne); | 4054 __ rsb(r5, r5, Operand(0, RelocInfo::NONE), LeaveCC, ne); |
4077 | 4055 |
4078 __ bind(&done); | 4056 __ bind(&done); |
4079 switch (array_type) { | 4057 switch (elements_kind) { |
4080 case kExternalByteArray: | 4058 case JSObject::EXTERNAL_BYTE_ELEMENTS: |
4081 case kExternalUnsignedByteArray: | 4059 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
4082 __ strb(r5, MemOperand(r3, r4, LSL, 0)); | 4060 __ strb(r5, MemOperand(r3, r4, LSL, 0)); |
4083 break; | 4061 break; |
4084 case kExternalShortArray: | 4062 case JSObject::EXTERNAL_SHORT_ELEMENTS: |
4085 case kExternalUnsignedShortArray: | 4063 case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
4086 __ strh(r5, MemOperand(r3, r4, LSL, 1)); | 4064 __ strh(r5, MemOperand(r3, r4, LSL, 1)); |
4087 break; | 4065 break; |
4088 case kExternalIntArray: | 4066 case JSObject::EXTERNAL_INT_ELEMENTS: |
4089 case kExternalUnsignedIntArray: | 4067 case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS: |
4090 __ str(r5, MemOperand(r3, r4, LSL, 2)); | 4068 __ str(r5, MemOperand(r3, r4, LSL, 2)); |
4091 break; | 4069 break; |
4092 default: | 4070 case JSObject::EXTERNAL_PIXEL_ELEMENTS: |
| 4071 case JSObject::EXTERNAL_FLOAT_ELEMENTS: |
| 4072 case JSObject::EXTERNAL_DOUBLE_ELEMENTS: |
| 4073 case JSObject::FAST_ELEMENTS: |
| 4074 case JSObject::FAST_DOUBLE_ELEMENTS: |
| 4075 case JSObject::DICTIONARY_ELEMENTS: |
4093 UNREACHABLE(); | 4076 UNREACHABLE(); |
4094 break; | 4077 break; |
4095 } | 4078 } |
4096 } | 4079 } |
4097 } | 4080 } |
4098 } | 4081 } |
4099 | 4082 |
4100 // Slow case, key and receiver still in r0 and r1. | 4083 // Slow case, key and receiver still in r0 and r1. |
4101 __ bind(&slow); | 4084 __ bind(&slow); |
4102 __ IncrementCounter( | 4085 __ IncrementCounter( |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4229 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 4212 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
4230 __ Jump(ic, RelocInfo::CODE_TARGET); | 4213 __ Jump(ic, RelocInfo::CODE_TARGET); |
4231 } | 4214 } |
4232 | 4215 |
4233 | 4216 |
4234 #undef __ | 4217 #undef __ |
4235 | 4218 |
4236 } } // namespace v8::internal | 4219 } } // namespace v8::internal |
4237 | 4220 |
4238 #endif // V8_TARGET_ARCH_ARM | 4221 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |