OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 19 matching lines...) Expand all Loading... |
30 #if defined(V8_TARGET_ARCH_ARM) | 30 #if defined(V8_TARGET_ARCH_ARM) |
31 | 31 |
32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
33 #include "code-stubs.h" | 33 #include "code-stubs.h" |
34 #include "regexp-macro-assembler.h" | 34 #include "regexp-macro-assembler.h" |
35 | 35 |
36 namespace v8 { | 36 namespace v8 { |
37 namespace internal { | 37 namespace internal { |
38 | 38 |
39 | 39 |
40 CodeStubInterfaceDescriptor* | |
41 KeyedLoadFastElementStub::GetInterfaceDescriptor(Isolate* isolate) { | |
42 static CodeStubInterfaceDescriptor* result = NULL; | |
43 if (result == NULL) { | |
44 Handle<Code> miss = isolate->builtins()->KeyedLoadIC_Miss(); | |
45 static Register registers[] = { r1, r0 }; | |
46 static CodeStubInterfaceDescriptor info = { | |
47 2, | |
48 registers, | |
49 miss | |
50 }; | |
51 result = &info; | |
52 } | |
53 return result; | |
54 } | |
55 | |
56 | |
57 #define __ ACCESS_MASM(masm) | 40 #define __ ACCESS_MASM(masm) |
58 | 41 |
59 static void EmitIdenticalObjectComparison(MacroAssembler* masm, | 42 static void EmitIdenticalObjectComparison(MacroAssembler* masm, |
60 Label* slow, | 43 Label* slow, |
61 Condition cond); | 44 Condition cond); |
62 static void EmitSmiNonsmiComparison(MacroAssembler* masm, | 45 static void EmitSmiNonsmiComparison(MacroAssembler* masm, |
63 Register lhs, | 46 Register lhs, |
64 Register rhs, | 47 Register rhs, |
65 Label* lhs_not_nan, | 48 Label* lhs_not_nan, |
66 Label* slow, | 49 Label* slow, |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 __ bind(&slow_case); | 496 __ bind(&slow_case); |
514 __ TailCallRuntime(Runtime::kCreateObjectLiteralShallow, 4, 1); | 497 __ TailCallRuntime(Runtime::kCreateObjectLiteralShallow, 4, 1); |
515 } | 498 } |
516 | 499 |
517 | 500 |
518 // Takes a Smi and converts to an IEEE 64 bit floating point value in two | 501 // Takes a Smi and converts to an IEEE 64 bit floating point value in two |
519 // registers. The format is 1 sign bit, 11 exponent bits (biased 1023) and | 502 // registers. The format is 1 sign bit, 11 exponent bits (biased 1023) and |
520 // 52 fraction bits (20 in the first word, 32 in the second). Zeros is a | 503 // 52 fraction bits (20 in the first word, 32 in the second). Zeros is a |
521 // scratch register. Destroys the source register. No GC occurs during this | 504 // scratch register. Destroys the source register. No GC occurs during this |
522 // stub so you don't have to set up the frame. | 505 // stub so you don't have to set up the frame. |
523 class ConvertToDoubleStub : public PlatformCodeStub { | 506 class ConvertToDoubleStub : public CodeStub { |
524 public: | 507 public: |
525 ConvertToDoubleStub(Register result_reg_1, | 508 ConvertToDoubleStub(Register result_reg_1, |
526 Register result_reg_2, | 509 Register result_reg_2, |
527 Register source_reg, | 510 Register source_reg, |
528 Register scratch_reg) | 511 Register scratch_reg) |
529 : result1_(result_reg_1), | 512 : result1_(result_reg_1), |
530 result2_(result_reg_2), | 513 result2_(result_reg_2), |
531 source_(source_reg), | 514 source_(source_reg), |
532 zeros_(scratch_reg) { } | 515 zeros_(scratch_reg) { } |
533 | 516 |
(...skipping 3044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3578 __ TailCallRuntime(Runtime::kInterrupt, 0, 1); | 3561 __ TailCallRuntime(Runtime::kInterrupt, 0, 1); |
3579 } | 3562 } |
3580 | 3563 |
3581 | 3564 |
3582 void MathPowStub::Generate(MacroAssembler* masm) { | 3565 void MathPowStub::Generate(MacroAssembler* masm) { |
3583 CpuFeatures::Scope vfp2_scope(VFP2); | 3566 CpuFeatures::Scope vfp2_scope(VFP2); |
3584 const Register base = r1; | 3567 const Register base = r1; |
3585 const Register exponent = r2; | 3568 const Register exponent = r2; |
3586 const Register heapnumbermap = r5; | 3569 const Register heapnumbermap = r5; |
3587 const Register heapnumber = r0; | 3570 const Register heapnumber = r0; |
3588 const DwVfpRegister double_base = d1; | 3571 const DoubleRegister double_base = d1; |
3589 const DwVfpRegister double_exponent = d2; | 3572 const DoubleRegister double_exponent = d2; |
3590 const DwVfpRegister double_result = d3; | 3573 const DoubleRegister double_result = d3; |
3591 const DwVfpRegister double_scratch = d0; | 3574 const DoubleRegister double_scratch = d0; |
3592 const SwVfpRegister single_scratch = s0; | 3575 const SwVfpRegister single_scratch = s0; |
3593 const Register scratch = r9; | 3576 const Register scratch = r9; |
3594 const Register scratch2 = r7; | 3577 const Register scratch2 = r7; |
3595 | 3578 |
3596 Label call_runtime, done, int_exponent; | 3579 Label call_runtime, done, int_exponent; |
3597 if (exponent_type_ == ON_STACK) { | 3580 if (exponent_type_ == ON_STACK) { |
3598 Label base_is_smi, unpack_exponent; | 3581 Label base_is_smi, unpack_exponent; |
3599 // The exponent and base are supplied as arguments on the stack. | 3582 // The exponent and base are supplied as arguments on the stack. |
3600 // This can only happen if the stub is called from non-optimized code. | 3583 // This can only happen if the stub is called from non-optimized code. |
3601 // Load input parameters from stack to double registers. | 3584 // Load input parameters from stack to double registers. |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3791 | 3774 |
3792 void CodeStub::GenerateStubsAheadOfTime() { | 3775 void CodeStub::GenerateStubsAheadOfTime() { |
3793 CEntryStub::GenerateAheadOfTime(); | 3776 CEntryStub::GenerateAheadOfTime(); |
3794 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(); | 3777 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(); |
3795 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(); | 3778 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(); |
3796 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(); | 3779 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(); |
3797 } | 3780 } |
3798 | 3781 |
3799 | 3782 |
3800 void CodeStub::GenerateFPStubs() { | 3783 void CodeStub::GenerateFPStubs() { |
3801 SaveFPRegsMode mode = CpuFeatures::IsSupported(VFP2) | 3784 CEntryStub save_doubles(1, kSaveFPRegs); |
3802 ? kSaveFPRegs | 3785 Handle<Code> code = save_doubles.GetCode(); |
3803 : kDontSaveFPRegs; | 3786 code->set_is_pregenerated(true); |
3804 CEntryStub save_doubles(1, mode); | 3787 StoreBufferOverflowStub stub(kSaveFPRegs); |
3805 StoreBufferOverflowStub stub(mode); | 3788 stub.GetCode()->set_is_pregenerated(true); |
3806 // These stubs might already be in the snapshot, detect that and don't | 3789 code->GetIsolate()->set_fp_stubs_generated(true); |
3807 // regenerate, which would lead to code stub initialization state being messed | |
3808 // up. | |
3809 Code* save_doubles_code = NULL; | |
3810 Code* store_buffer_overflow_code = NULL; | |
3811 if (!save_doubles.FindCodeInCache(&save_doubles_code, ISOLATE)) { | |
3812 if (CpuFeatures::IsSupported(VFP2)) { | |
3813 CpuFeatures::Scope scope2(VFP2); | |
3814 save_doubles_code = *save_doubles.GetCode(); | |
3815 store_buffer_overflow_code = *stub.GetCode(); | |
3816 } else { | |
3817 save_doubles_code = *save_doubles.GetCode(); | |
3818 store_buffer_overflow_code = *stub.GetCode(); | |
3819 } | |
3820 save_doubles_code->set_is_pregenerated(true); | |
3821 store_buffer_overflow_code->set_is_pregenerated(true); | |
3822 } | |
3823 ISOLATE->set_fp_stubs_generated(true); | |
3824 } | 3790 } |
3825 | 3791 |
3826 | 3792 |
3827 void CEntryStub::GenerateAheadOfTime() { | 3793 void CEntryStub::GenerateAheadOfTime() { |
3828 CEntryStub stub(1, kDontSaveFPRegs); | 3794 CEntryStub stub(1, kDontSaveFPRegs); |
3829 Handle<Code> code = stub.GetCode(); | 3795 Handle<Code> code = stub.GetCode(); |
3830 code->set_is_pregenerated(true); | 3796 code->set_is_pregenerated(true); |
3831 } | 3797 } |
3832 | 3798 |
3833 | 3799 |
(...skipping 3804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7638 | 7604 |
7639 __ Pop(lr, r5, r1); | 7605 __ Pop(lr, r5, r1); |
7640 __ Ret(); | 7606 __ Ret(); |
7641 } | 7607 } |
7642 | 7608 |
7643 #undef __ | 7609 #undef __ |
7644 | 7610 |
7645 } } // namespace v8::internal | 7611 } } // namespace v8::internal |
7646 | 7612 |
7647 #endif // V8_TARGET_ARCH_ARM | 7613 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |