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 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( | |
41 Isolate* isolate, | |
42 CodeStubInterfaceDescriptor* descriptor) { | |
43 static Register registers[] = { r1, r0 }; | |
44 descriptor->register_param_count_ = 2; | |
45 descriptor->register_params_ = registers; | |
46 descriptor->deoptimization_handler_ = | |
47 isolate->builtins()->KeyedLoadIC_Miss(); | |
48 } | |
49 | |
50 | |
51 #define __ ACCESS_MASM(masm) | 40 #define __ ACCESS_MASM(masm) |
52 | 41 |
53 static void EmitIdenticalObjectComparison(MacroAssembler* masm, | 42 static void EmitIdenticalObjectComparison(MacroAssembler* masm, |
54 Label* slow, | 43 Label* slow, |
55 Condition cond); | 44 Condition cond); |
56 static void EmitSmiNonsmiComparison(MacroAssembler* masm, | 45 static void EmitSmiNonsmiComparison(MacroAssembler* masm, |
57 Register lhs, | 46 Register lhs, |
58 Register rhs, | 47 Register rhs, |
59 Label* lhs_not_nan, | 48 Label* lhs_not_nan, |
60 Label* slow, | 49 Label* slow, |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 __ bind(&slow_case); | 496 __ bind(&slow_case); |
508 __ TailCallRuntime(Runtime::kCreateObjectLiteralShallow, 4, 1); | 497 __ TailCallRuntime(Runtime::kCreateObjectLiteralShallow, 4, 1); |
509 } | 498 } |
510 | 499 |
511 | 500 |
512 // 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 |
513 // 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 |
514 // 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 |
515 // scratch register. Destroys the source register. No GC occurs during this | 504 // scratch register. Destroys the source register. No GC occurs during this |
516 // stub so you don't have to set up the frame. | 505 // stub so you don't have to set up the frame. |
517 class ConvertToDoubleStub : public PlatformCodeStub { | 506 class ConvertToDoubleStub : public CodeStub { |
518 public: | 507 public: |
519 ConvertToDoubleStub(Register result_reg_1, | 508 ConvertToDoubleStub(Register result_reg_1, |
520 Register result_reg_2, | 509 Register result_reg_2, |
521 Register source_reg, | 510 Register source_reg, |
522 Register scratch_reg) | 511 Register scratch_reg) |
523 : result1_(result_reg_1), | 512 : result1_(result_reg_1), |
524 result2_(result_reg_2), | 513 result2_(result_reg_2), |
525 source_(source_reg), | 514 source_(source_reg), |
526 zeros_(scratch_reg) { } | 515 zeros_(scratch_reg) { } |
527 | 516 |
(...skipping 3044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3572 __ TailCallRuntime(Runtime::kInterrupt, 0, 1); | 3561 __ TailCallRuntime(Runtime::kInterrupt, 0, 1); |
3573 } | 3562 } |
3574 | 3563 |
3575 | 3564 |
3576 void MathPowStub::Generate(MacroAssembler* masm) { | 3565 void MathPowStub::Generate(MacroAssembler* masm) { |
3577 CpuFeatures::Scope vfp2_scope(VFP2); | 3566 CpuFeatures::Scope vfp2_scope(VFP2); |
3578 const Register base = r1; | 3567 const Register base = r1; |
3579 const Register exponent = r2; | 3568 const Register exponent = r2; |
3580 const Register heapnumbermap = r5; | 3569 const Register heapnumbermap = r5; |
3581 const Register heapnumber = r0; | 3570 const Register heapnumber = r0; |
3582 const DwVfpRegister double_base = d1; | 3571 const DoubleRegister double_base = d1; |
3583 const DwVfpRegister double_exponent = d2; | 3572 const DoubleRegister double_exponent = d2; |
3584 const DwVfpRegister double_result = d3; | 3573 const DoubleRegister double_result = d3; |
3585 const DwVfpRegister double_scratch = d0; | 3574 const DoubleRegister double_scratch = d0; |
3586 const SwVfpRegister single_scratch = s0; | 3575 const SwVfpRegister single_scratch = s0; |
3587 const Register scratch = r9; | 3576 const Register scratch = r9; |
3588 const Register scratch2 = r7; | 3577 const Register scratch2 = r7; |
3589 | 3578 |
3590 Label call_runtime, done, int_exponent; | 3579 Label call_runtime, done, int_exponent; |
3591 if (exponent_type_ == ON_STACK) { | 3580 if (exponent_type_ == ON_STACK) { |
3592 Label base_is_smi, unpack_exponent; | 3581 Label base_is_smi, unpack_exponent; |
3593 // The exponent and base are supplied as arguments on the stack. | 3582 // The exponent and base are supplied as arguments on the stack. |
3594 // 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. |
3595 // 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... |
3785 | 3774 |
3786 void CodeStub::GenerateStubsAheadOfTime() { | 3775 void CodeStub::GenerateStubsAheadOfTime() { |
3787 CEntryStub::GenerateAheadOfTime(); | 3776 CEntryStub::GenerateAheadOfTime(); |
3788 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(); | 3777 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(); |
3789 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(); | 3778 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(); |
3790 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(); | 3779 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(); |
3791 } | 3780 } |
3792 | 3781 |
3793 | 3782 |
3794 void CodeStub::GenerateFPStubs() { | 3783 void CodeStub::GenerateFPStubs() { |
3795 SaveFPRegsMode mode = CpuFeatures::IsSupported(VFP2) | 3784 CEntryStub save_doubles(1, kSaveFPRegs); |
3796 ? kSaveFPRegs | 3785 Handle<Code> code = save_doubles.GetCode(); |
3797 : kDontSaveFPRegs; | 3786 code->set_is_pregenerated(true); |
3798 CEntryStub save_doubles(1, mode); | 3787 StoreBufferOverflowStub stub(kSaveFPRegs); |
3799 StoreBufferOverflowStub stub(mode); | 3788 stub.GetCode()->set_is_pregenerated(true); |
3800 // These stubs might already be in the snapshot, detect that and don't | 3789 code->GetIsolate()->set_fp_stubs_generated(true); |
3801 // regenerate, which would lead to code stub initialization state being messed | |
3802 // up. | |
3803 Code* save_doubles_code = NULL; | |
3804 Code* store_buffer_overflow_code = NULL; | |
3805 if (!save_doubles.FindCodeInCache(&save_doubles_code, ISOLATE)) { | |
3806 if (CpuFeatures::IsSupported(VFP2)) { | |
3807 CpuFeatures::Scope scope2(VFP2); | |
3808 save_doubles_code = *save_doubles.GetCode(); | |
3809 store_buffer_overflow_code = *stub.GetCode(); | |
3810 } else { | |
3811 save_doubles_code = *save_doubles.GetCode(); | |
3812 store_buffer_overflow_code = *stub.GetCode(); | |
3813 } | |
3814 save_doubles_code->set_is_pregenerated(true); | |
3815 store_buffer_overflow_code->set_is_pregenerated(true); | |
3816 } | |
3817 ISOLATE->set_fp_stubs_generated(true); | |
3818 } | 3790 } |
3819 | 3791 |
3820 | 3792 |
3821 void CEntryStub::GenerateAheadOfTime() { | 3793 void CEntryStub::GenerateAheadOfTime() { |
3822 CEntryStub stub(1, kDontSaveFPRegs); | 3794 CEntryStub stub(1, kDontSaveFPRegs); |
3823 Handle<Code> code = stub.GetCode(); | 3795 Handle<Code> code = stub.GetCode(); |
3824 code->set_is_pregenerated(true); | 3796 code->set_is_pregenerated(true); |
3825 } | 3797 } |
3826 | 3798 |
3827 | 3799 |
(...skipping 3804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7632 | 7604 |
7633 __ Pop(lr, r5, r1); | 7605 __ Pop(lr, r5, r1); |
7634 __ Ret(); | 7606 __ Ret(); |
7635 } | 7607 } |
7636 | 7608 |
7637 #undef __ | 7609 #undef __ |
7638 | 7610 |
7639 } } // namespace v8::internal | 7611 } } // namespace v8::internal |
7640 | 7612 |
7641 #endif // V8_TARGET_ARCH_ARM | 7613 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |