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

Side by Side Diff: src/x64/stub-cache-x64.cc

Issue 7901016: Basic support for tracking smi-only arrays on ia32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ready to land 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 | Annotate | Revision Log
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 3446 matching lines...) Expand 10 before | Expand all | Expand 10 after
3457 // Need to perform int-to-float conversion. 3457 // Need to perform int-to-float conversion.
3458 __ cvtlsi2ss(xmm0, rdx); 3458 __ cvtlsi2ss(xmm0, rdx);
3459 __ movss(Operand(rbx, rdi, times_4, 0), xmm0); 3459 __ movss(Operand(rbx, rdi, times_4, 0), xmm0);
3460 break; 3460 break;
3461 case EXTERNAL_DOUBLE_ELEMENTS: 3461 case EXTERNAL_DOUBLE_ELEMENTS:
3462 // Need to perform int-to-float conversion. 3462 // Need to perform int-to-float conversion.
3463 __ cvtlsi2sd(xmm0, rdx); 3463 __ cvtlsi2sd(xmm0, rdx);
3464 __ movsd(Operand(rbx, rdi, times_8, 0), xmm0); 3464 __ movsd(Operand(rbx, rdi, times_8, 0), xmm0);
3465 break; 3465 break;
3466 case FAST_ELEMENTS: 3466 case FAST_ELEMENTS:
3467 case FAST_SMI_ONLY_ELEMENTS:
3467 case FAST_DOUBLE_ELEMENTS: 3468 case FAST_DOUBLE_ELEMENTS:
3468 case DICTIONARY_ELEMENTS: 3469 case DICTIONARY_ELEMENTS:
3469 case NON_STRICT_ARGUMENTS_ELEMENTS: 3470 case NON_STRICT_ARGUMENTS_ELEMENTS:
3470 UNREACHABLE(); 3471 UNREACHABLE();
3471 break; 3472 break;
3472 } 3473 }
3473 __ ret(0); 3474 __ ret(0);
3474 3475
3475 // TODO(danno): handle heap number -> pixel array conversion 3476 // TODO(danno): handle heap number -> pixel array conversion
3476 if (elements_kind != EXTERNAL_PIXEL_ELEMENTS) { 3477 if (elements_kind != EXTERNAL_PIXEL_ELEMENTS) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
3524 case EXTERNAL_UNSIGNED_INT_ELEMENTS: 3525 case EXTERNAL_UNSIGNED_INT_ELEMENTS:
3525 // Convert to int64, so that NaN and infinities become 3526 // Convert to int64, so that NaN and infinities become
3526 // 0x8000000000000000, which is zero mod 2^32. 3527 // 0x8000000000000000, which is zero mod 2^32.
3527 __ cvttsd2siq(rdx, xmm0); 3528 __ cvttsd2siq(rdx, xmm0);
3528 __ movl(Operand(rbx, rdi, times_4, 0), rdx); 3529 __ movl(Operand(rbx, rdi, times_4, 0), rdx);
3529 break; 3530 break;
3530 case EXTERNAL_PIXEL_ELEMENTS: 3531 case EXTERNAL_PIXEL_ELEMENTS:
3531 case EXTERNAL_FLOAT_ELEMENTS: 3532 case EXTERNAL_FLOAT_ELEMENTS:
3532 case EXTERNAL_DOUBLE_ELEMENTS: 3533 case EXTERNAL_DOUBLE_ELEMENTS:
3533 case FAST_ELEMENTS: 3534 case FAST_ELEMENTS:
3535 case FAST_SMI_ONLY_ELEMENTS:
3534 case FAST_DOUBLE_ELEMENTS: 3536 case FAST_DOUBLE_ELEMENTS:
3535 case DICTIONARY_ELEMENTS: 3537 case DICTIONARY_ELEMENTS:
3536 case NON_STRICT_ARGUMENTS_ELEMENTS: 3538 case NON_STRICT_ARGUMENTS_ELEMENTS:
3537 UNREACHABLE(); 3539 UNREACHABLE();
3538 break; 3540 break;
3539 } 3541 }
3540 __ ret(0); 3542 __ ret(0);
3541 } 3543 }
3542 } 3544 }
3543 3545
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
3655 masm->isolate()->builtins()->KeyedLoadIC_Slow(); 3657 masm->isolate()->builtins()->KeyedLoadIC_Slow();
3656 __ jmp(slow_ic, RelocInfo::CODE_TARGET); 3658 __ jmp(slow_ic, RelocInfo::CODE_TARGET);
3657 3659
3658 __ bind(&miss_force_generic); 3660 __ bind(&miss_force_generic);
3659 Handle<Code> miss_ic = 3661 Handle<Code> miss_ic =
3660 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric(); 3662 masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric();
3661 __ jmp(miss_ic, RelocInfo::CODE_TARGET); 3663 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3662 } 3664 }
3663 3665
3664 3666
3665 void KeyedStoreStubCompiler::GenerateStoreFastElement(MacroAssembler* masm, 3667 void KeyedStoreStubCompiler::GenerateStoreFastElement(
3666 bool is_js_array) { 3668 MacroAssembler* masm,
3669 bool is_js_array,
3670 ElementsKind elements_kind) {
3667 // ----------- S t a t e ------------- 3671 // ----------- S t a t e -------------
3668 // -- rax : value 3672 // -- rax : value
3669 // -- rcx : key 3673 // -- rcx : key
3670 // -- rdx : receiver 3674 // -- rdx : receiver
3671 // -- rsp[0] : return address 3675 // -- rsp[0] : return address
3672 // ----------------------------------- 3676 // -----------------------------------
3673 Label miss_force_generic; 3677 Label miss_force_generic;
3674 3678
3675 // This stub is meant to be tail-jumped to, the receiver must already 3679 // This stub is meant to be tail-jumped to, the receiver must already
3676 // have been verified by the caller to not be a smi. 3680 // have been verified by the caller to not be a smi.
(...skipping 16 matching lines...) Expand all
3693 __ j(above_equal, &miss_force_generic); 3697 __ j(above_equal, &miss_force_generic);
3694 } 3698 }
3695 3699
3696 // Do the store and update the write barrier. 3700 // Do the store and update the write barrier.
3697 __ SmiToInteger32(rcx, rcx); 3701 __ SmiToInteger32(rcx, rcx);
3698 __ lea(rcx, 3702 __ lea(rcx,
3699 FieldOperand(rdi, rcx, times_pointer_size, FixedArray::kHeaderSize)); 3703 FieldOperand(rdi, rcx, times_pointer_size, FixedArray::kHeaderSize));
3700 __ movq(Operand(rcx, 0), rax); 3704 __ movq(Operand(rcx, 0), rax);
3701 // Make sure to preserve the value in register rax. 3705 // Make sure to preserve the value in register rax.
3702 __ movq(rdx, rax); 3706 __ movq(rdx, rax);
3707 ASSERT(elements_kind == FAST_ELEMENTS);
3703 __ RecordWrite(rdi, rcx, rdx, kDontSaveFPRegs); 3708 __ RecordWrite(rdi, rcx, rdx, kDontSaveFPRegs);
3704 3709
3705 // Done. 3710 // Done.
3706 __ ret(0); 3711 __ ret(0);
3707 3712
3708 // Handle store cache miss. 3713 // Handle store cache miss.
3709 __ bind(&miss_force_generic); 3714 __ bind(&miss_force_generic);
3710 Handle<Code> ic_force_generic = 3715 Handle<Code> ic_force_generic =
3711 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); 3716 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
3712 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); 3717 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
3796 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); 3801 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
3797 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); 3802 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
3798 } 3803 }
3799 3804
3800 3805
3801 #undef __ 3806 #undef __
3802 3807
3803 } } // namespace v8::internal 3808 } } // namespace v8::internal
3804 3809
3805 #endif // V8_TARGET_ARCH_X64 3810 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698