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