Chromium Code Reviews| 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 497 __ bind(&slow_case); | 497 __ bind(&slow_case); |
| 498 __ TailCallRuntime(Runtime::kCreateObjectLiteralShallow, 4, 1); | 498 __ TailCallRuntime(Runtime::kCreateObjectLiteralShallow, 4, 1); |
| 499 } | 499 } |
| 500 | 500 |
| 501 | 501 |
| 502 // Takes a Smi and converts to an IEEE 64 bit floating point value in two | 502 // Takes a Smi and converts to an IEEE 64 bit floating point value in two |
| 503 // registers. The format is 1 sign bit, 11 exponent bits (biased 1023) and | 503 // registers. The format is 1 sign bit, 11 exponent bits (biased 1023) and |
| 504 // 52 fraction bits (20 in the first word, 32 in the second). Zeros is a | 504 // 52 fraction bits (20 in the first word, 32 in the second). Zeros is a |
| 505 // scratch register. Destroys the source register. No GC occurs during this | 505 // scratch register. Destroys the source register. No GC occurs during this |
| 506 // stub so you don't have to set up the frame. | 506 // stub so you don't have to set up the frame. |
| 507 class ConvertToDoubleStub : public CodeStub { | 507 class ConvertToDoubleStub : public PlatformCodeStub { |
| 508 public: | 508 public: |
| 509 ConvertToDoubleStub(Register result_reg_1, | 509 ConvertToDoubleStub(Register result_reg_1, |
| 510 Register result_reg_2, | 510 Register result_reg_2, |
| 511 Register source_reg, | 511 Register source_reg, |
| 512 Register scratch_reg) | 512 Register scratch_reg) |
| 513 : result1_(result_reg_1), | 513 : result1_(result_reg_1), |
| 514 result2_(result_reg_2), | 514 result2_(result_reg_2), |
| 515 source_(source_reg), | 515 source_(source_reg), |
| 516 zeros_(scratch_reg) { } | 516 zeros_(scratch_reg) { } |
| 517 | 517 |
| (...skipping 3040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3558 __ TailCallRuntime(Runtime::kInterrupt, 0, 1); | 3558 __ TailCallRuntime(Runtime::kInterrupt, 0, 1); |
| 3559 } | 3559 } |
| 3560 | 3560 |
| 3561 | 3561 |
| 3562 void MathPowStub::Generate(MacroAssembler* masm) { | 3562 void MathPowStub::Generate(MacroAssembler* masm) { |
| 3563 CpuFeatures::Scope vfp2_scope(VFP2); | 3563 CpuFeatures::Scope vfp2_scope(VFP2); |
| 3564 const Register base = r1; | 3564 const Register base = r1; |
| 3565 const Register exponent = r2; | 3565 const Register exponent = r2; |
| 3566 const Register heapnumbermap = r5; | 3566 const Register heapnumbermap = r5; |
| 3567 const Register heapnumber = r0; | 3567 const Register heapnumber = r0; |
| 3568 const DoubleRegister double_base = d1; | 3568 const DwVfpRegister double_base = d1; |
| 3569 const DoubleRegister double_exponent = d2; | 3569 const DwVfpRegister double_exponent = d2; |
| 3570 const DoubleRegister double_result = d3; | 3570 const DwVfpRegister double_result = d3; |
| 3571 const DoubleRegister double_scratch = d0; | 3571 const DwVfpRegister double_scratch = d0; |
| 3572 const SwVfpRegister single_scratch = s0; | 3572 const SwVfpRegister single_scratch = s0; |
| 3573 const Register scratch = r9; | 3573 const Register scratch = r9; |
| 3574 const Register scratch2 = r7; | 3574 const Register scratch2 = r7; |
| 3575 | 3575 |
| 3576 Label call_runtime, done, int_exponent; | 3576 Label call_runtime, done, int_exponent; |
| 3577 if (exponent_type_ == ON_STACK) { | 3577 if (exponent_type_ == ON_STACK) { |
| 3578 Label base_is_smi, unpack_exponent; | 3578 Label base_is_smi, unpack_exponent; |
| 3579 // The exponent and base are supplied as arguments on the stack. | 3579 // The exponent and base are supplied as arguments on the stack. |
| 3580 // This can only happen if the stub is called from non-optimized code. | 3580 // This can only happen if the stub is called from non-optimized code. |
| 3581 // Load input parameters from stack to double registers. | 3581 // Load input parameters from stack to double registers. |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3771 | 3771 |
| 3772 void CodeStub::GenerateStubsAheadOfTime() { | 3772 void CodeStub::GenerateStubsAheadOfTime() { |
| 3773 CEntryStub::GenerateAheadOfTime(); | 3773 CEntryStub::GenerateAheadOfTime(); |
| 3774 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(); | 3774 WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(); |
| 3775 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(); | 3775 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(); |
| 3776 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(); | 3776 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(); |
| 3777 } | 3777 } |
| 3778 | 3778 |
| 3779 | 3779 |
| 3780 void CodeStub::GenerateFPStubs() { | 3780 void CodeStub::GenerateFPStubs() { |
| 3781 CEntryStub save_doubles(1, kSaveFPRegs); | 3781 SaveFPRegsMode mode = CpuFeatures::IsSupported(VFP2) |
| 3782 Handle<Code> code = save_doubles.GetCode(); | 3782 ? kSaveFPRegs |
| 3783 code->set_is_pregenerated(true); | 3783 : kDontSaveFPRegs; |
| 3784 StoreBufferOverflowStub stub(kSaveFPRegs); | 3784 CEntryStub save_doubles(1, mode); |
| 3785 stub.GetCode()->set_is_pregenerated(true); | 3785 StoreBufferOverflowStub stub(mode); |
| 3786 code->GetIsolate()->set_fp_stubs_generated(true); | 3786 // These stubs might already be in the snapshot, detect that and don't |
| 3787 // regenerate, which leads to code stubs initialization state being messed up. | |
| 3788 Code* code_object; | |
| 3789 if (!save_doubles.FindCodeInCache(&code_object)) { | |
| 3790 if (CpuFeatures::IsSupported(VFP2)) { | |
| 3791 CpuFeatures::Scope scope2(VFP2); | |
| 3792 save_doubles.GetCode()->set_is_pregenerated(true); | |
|
Jakob Kummerow
2012/11/19 12:36:00
Suggestion: save the result of save_doubles.GetCod
danno
2012/11/26 17:16:18
Done.
| |
| 3793 stub.GetCode()->set_is_pregenerated(true); | |
| 3794 } else { | |
| 3795 save_doubles.GetCode()->set_is_pregenerated(true); | |
| 3796 stub.GetCode()->set_is_pregenerated(true); | |
| 3797 } | |
| 3798 } | |
| 3799 ISOLATE->set_fp_stubs_generated(true); | |
| 3787 } | 3800 } |
| 3788 | 3801 |
| 3789 | 3802 |
| 3790 void CEntryStub::GenerateAheadOfTime() { | 3803 void CEntryStub::GenerateAheadOfTime() { |
| 3791 CEntryStub stub(1, kDontSaveFPRegs); | 3804 CEntryStub stub(1, kDontSaveFPRegs); |
| 3792 Handle<Code> code = stub.GetCode(); | 3805 Handle<Code> code = stub.GetCode(); |
| 3793 code->set_is_pregenerated(true); | 3806 code->set_is_pregenerated(true); |
| 3794 } | 3807 } |
| 3795 | 3808 |
| 3796 | 3809 |
| (...skipping 3832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7629 | 7642 |
| 7630 __ Pop(lr, r5, r1); | 7643 __ Pop(lr, r5, r1); |
| 7631 __ Ret(); | 7644 __ Ret(); |
| 7632 } | 7645 } |
| 7633 | 7646 |
| 7634 #undef __ | 7647 #undef __ |
| 7635 | 7648 |
| 7636 } } // namespace v8::internal | 7649 } } // namespace v8::internal |
| 7637 | 7650 |
| 7638 #endif // V8_TARGET_ARCH_ARM | 7651 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |