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) { | |
Jakob Kummerow
2012/11/28 16:28:22
nit: indentation please
danno
2012/11/30 16:23:24
Done.
| |
42 static bool initialized = false; | |
43 static CodeStubInterfaceDescriptor* result; | |
44 if (!initialized) { | |
45 Handle<Code> miss = isolate->builtins()->KeyedLoadIC_Miss(); | |
46 static Register registers[] = { r1, r0 }; | |
47 static CodeStubInterfaceDescriptor info = { | |
48 2, | |
49 registers, | |
50 miss | |
51 }; | |
52 result = &info; | |
53 } | |
54 return result; | |
55 } | |
56 | |
57 | |
40 #define __ ACCESS_MASM(masm) | 58 #define __ ACCESS_MASM(masm) |
41 | 59 |
42 static void EmitIdenticalObjectComparison(MacroAssembler* masm, | 60 static void EmitIdenticalObjectComparison(MacroAssembler* masm, |
43 Label* slow, | 61 Label* slow, |
44 Condition cond); | 62 Condition cond); |
45 static void EmitSmiNonsmiComparison(MacroAssembler* masm, | 63 static void EmitSmiNonsmiComparison(MacroAssembler* masm, |
46 Register lhs, | 64 Register lhs, |
47 Register rhs, | 65 Register rhs, |
48 Label* lhs_not_nan, | 66 Label* lhs_not_nan, |
49 Label* slow, | 67 Label* slow, |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
496 __ bind(&slow_case); | 514 __ bind(&slow_case); |
497 __ TailCallRuntime(Runtime::kCreateObjectLiteralShallow, 4, 1); | 515 __ TailCallRuntime(Runtime::kCreateObjectLiteralShallow, 4, 1); |
498 } | 516 } |
499 | 517 |
500 | 518 |
501 // Takes a Smi and converts to an IEEE 64 bit floating point value in two | 519 // 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 | 520 // 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 | 521 // 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 | 522 // scratch register. Destroys the source register. No GC occurs during this |
505 // stub so you don't have to set up the frame. | 523 // stub so you don't have to set up the frame. |
506 class ConvertToDoubleStub : public CodeStub { | 524 class ConvertToDoubleStub : public PlatformCodeStub { |
507 public: | 525 public: |
508 ConvertToDoubleStub(Register result_reg_1, | 526 ConvertToDoubleStub(Register result_reg_1, |
509 Register result_reg_2, | 527 Register result_reg_2, |
510 Register source_reg, | 528 Register source_reg, |
511 Register scratch_reg) | 529 Register scratch_reg) |
512 : result1_(result_reg_1), | 530 : result1_(result_reg_1), |
513 result2_(result_reg_2), | 531 result2_(result_reg_2), |
514 source_(source_reg), | 532 source_(source_reg), |
515 zeros_(scratch_reg) { } | 533 zeros_(scratch_reg) { } |
516 | 534 |
(...skipping 3044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3561 __ TailCallRuntime(Runtime::kInterrupt, 0, 1); | 3579 __ TailCallRuntime(Runtime::kInterrupt, 0, 1); |
3562 } | 3580 } |
3563 | 3581 |
3564 | 3582 |
3565 void MathPowStub::Generate(MacroAssembler* masm) { | 3583 void MathPowStub::Generate(MacroAssembler* masm) { |
3566 CpuFeatures::Scope vfp2_scope(VFP2); | 3584 CpuFeatures::Scope vfp2_scope(VFP2); |
3567 const Register base = r1; | 3585 const Register base = r1; |
3568 const Register exponent = r2; | 3586 const Register exponent = r2; |
3569 const Register heapnumbermap = r5; | 3587 const Register heapnumbermap = r5; |
3570 const Register heapnumber = r0; | 3588 const Register heapnumber = r0; |
3571 const DoubleRegister double_base = d1; | 3589 const DwVfpRegister double_base = d1; |
3572 const DoubleRegister double_exponent = d2; | 3590 const DwVfpRegister double_exponent = d2; |
3573 const DoubleRegister double_result = d3; | 3591 const DwVfpRegister double_result = d3; |
3574 const DoubleRegister double_scratch = d0; | 3592 const DwVfpRegister double_scratch = d0; |
3575 const SwVfpRegister single_scratch = s0; | 3593 const SwVfpRegister single_scratch = s0; |
3576 const Register scratch = r9; | 3594 const Register scratch = r9; |
3577 const Register scratch2 = r7; | 3595 const Register scratch2 = r7; |
3578 | 3596 |
3579 Label call_runtime, done, int_exponent; | 3597 Label call_runtime, done, int_exponent; |
3580 if (exponent_type_ == ON_STACK) { | 3598 if (exponent_type_ == ON_STACK) { |
3581 Label base_is_smi, unpack_exponent; | 3599 Label base_is_smi, unpack_exponent; |
3582 // The exponent and base are supplied as arguments on the stack. | 3600 // 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. | 3601 // This can only happen if the stub is called from non-optimized code. |
3584 // Load input parameters from stack to double registers. | 3602 // Load input parameters from stack to double registers. |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3774 | 3792 |
3775 void CodeStub::GenerateStubsAheadOfTime() { | 3793 void CodeStub::GenerateStubsAheadOfTime() { |
3776 CEntryStub::GenerateAheadOfTime(); | 3794 CEntryStub::GenerateAheadOfTime(); |
3777 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(); | 3795 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(); |
3778 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(); | 3796 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(); |
3779 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(); | 3797 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(); |
3780 } | 3798 } |
3781 | 3799 |
3782 | 3800 |
3783 void CodeStub::GenerateFPStubs() { | 3801 void CodeStub::GenerateFPStubs() { |
3784 CEntryStub save_doubles(1, kSaveFPRegs); | 3802 SaveFPRegsMode mode = CpuFeatures::IsSupported(VFP2) |
3785 Handle<Code> code = save_doubles.GetCode(); | 3803 ? kSaveFPRegs |
3786 code->set_is_pregenerated(true); | 3804 : kDontSaveFPRegs; |
3787 StoreBufferOverflowStub stub(kSaveFPRegs); | 3805 CEntryStub save_doubles(1, mode); |
3788 stub.GetCode()->set_is_pregenerated(true); | 3806 StoreBufferOverflowStub stub(mode); |
3789 code->GetIsolate()->set_fp_stubs_generated(true); | 3807 // These stubs might already be in the snapshot, detect that and don't |
3808 // regenerate, which leads to code stub initialization state being messed up. | |
Jakob Kummerow
2012/11/28 16:28:22
s/leads/would lead/?
danno
2012/11/30 16:23:24
Done.
| |
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 |