| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/ppc/codegen-ppc.h" | 5 #include "src/ppc/codegen-ppc.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 __ fmr(d1, result); | 55 __ fmr(d1, result); |
| 56 __ Ret(); | 56 __ Ret(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 CodeDesc desc; | 59 CodeDesc desc; |
| 60 masm.GetCode(&desc); | 60 masm.GetCode(&desc); |
| 61 #if !ABI_USES_FUNCTION_DESCRIPTORS | 61 #if !ABI_USES_FUNCTION_DESCRIPTORS |
| 62 DCHECK(!RelocInfo::RequiresRelocation(desc)); | 62 DCHECK(!RelocInfo::RequiresRelocation(desc)); |
| 63 #endif | 63 #endif |
| 64 | 64 |
| 65 CpuFeatures::FlushICache(buffer, actual_size); | 65 Assembler::FlushICacheWithoutIsolate(buffer, actual_size); |
| 66 base::OS::ProtectCode(buffer, actual_size); | 66 base::OS::ProtectCode(buffer, actual_size); |
| 67 | 67 |
| 68 #if !defined(USE_SIMULATOR) | 68 #if !defined(USE_SIMULATOR) |
| 69 return FUNCTION_CAST<UnaryMathFunction>(buffer); | 69 return FUNCTION_CAST<UnaryMathFunction>(buffer); |
| 70 #else | 70 #else |
| 71 fast_exp_ppc_machine_code = buffer; | 71 fast_exp_ppc_machine_code = buffer; |
| 72 return &fast_exp_simulator; | 72 return &fast_exp_simulator; |
| 73 #endif | 73 #endif |
| 74 } | 74 } |
| 75 | 75 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 92 __ fsqrt(d1, d1); | 92 __ fsqrt(d1, d1); |
| 93 __ MovToFloatResult(d1); | 93 __ MovToFloatResult(d1); |
| 94 __ Ret(); | 94 __ Ret(); |
| 95 | 95 |
| 96 CodeDesc desc; | 96 CodeDesc desc; |
| 97 masm.GetCode(&desc); | 97 masm.GetCode(&desc); |
| 98 #if !ABI_USES_FUNCTION_DESCRIPTORS | 98 #if !ABI_USES_FUNCTION_DESCRIPTORS |
| 99 DCHECK(!RelocInfo::RequiresRelocation(desc)); | 99 DCHECK(!RelocInfo::RequiresRelocation(desc)); |
| 100 #endif | 100 #endif |
| 101 | 101 |
| 102 CpuFeatures::FlushICache(buffer, actual_size); | 102 Assembler::FlushICacheWithoutIsolate(buffer, actual_size); |
| 103 base::OS::ProtectCode(buffer, actual_size); | 103 base::OS::ProtectCode(buffer, actual_size); |
| 104 return FUNCTION_CAST<UnaryMathFunction>(buffer); | 104 return FUNCTION_CAST<UnaryMathFunction>(buffer); |
| 105 #endif | 105 #endif |
| 106 } | 106 } |
| 107 | 107 |
| 108 #undef __ | 108 #undef __ |
| 109 | 109 |
| 110 | 110 |
| 111 // ------------------------------------------------------------------------- | 111 // ------------------------------------------------------------------------- |
| 112 // Platform-specific RuntimeCallHelper functions. | 112 // Platform-specific RuntimeCallHelper functions. |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 GetCodeAgeAndParity(stub, age, parity); | 653 GetCodeAgeAndParity(stub, age, parity); |
| 654 } | 654 } |
| 655 } | 655 } |
| 656 | 656 |
| 657 | 657 |
| 658 void Code::PatchPlatformCodeAge(Isolate* isolate, byte* sequence, Code::Age age, | 658 void Code::PatchPlatformCodeAge(Isolate* isolate, byte* sequence, Code::Age age, |
| 659 MarkingParity parity) { | 659 MarkingParity parity) { |
| 660 uint32_t young_length = isolate->code_aging_helper()->young_sequence_length(); | 660 uint32_t young_length = isolate->code_aging_helper()->young_sequence_length(); |
| 661 if (age == kNoAgeCodeAge) { | 661 if (age == kNoAgeCodeAge) { |
| 662 isolate->code_aging_helper()->CopyYoungSequenceTo(sequence); | 662 isolate->code_aging_helper()->CopyYoungSequenceTo(sequence); |
| 663 CpuFeatures::FlushICache(sequence, young_length); | 663 Assembler::FlushICache(isolate, sequence, young_length); |
| 664 } else { | 664 } else { |
| 665 // FIXED_SEQUENCE | 665 // FIXED_SEQUENCE |
| 666 Code* stub = GetCodeAgeStub(isolate, age, parity); | 666 Code* stub = GetCodeAgeStub(isolate, age, parity); |
| 667 CodePatcher patcher(sequence, young_length / Assembler::kInstrSize); | 667 CodePatcher patcher(sequence, young_length / Assembler::kInstrSize); |
| 668 Assembler::BlockTrampolinePoolScope block_trampoline_pool(patcher.masm()); | 668 Assembler::BlockTrampolinePoolScope block_trampoline_pool(patcher.masm()); |
| 669 intptr_t target = reinterpret_cast<intptr_t>(stub->instruction_start()); | 669 intptr_t target = reinterpret_cast<intptr_t>(stub->instruction_start()); |
| 670 // Don't use Call -- we need to preserve ip and lr. | 670 // Don't use Call -- we need to preserve ip and lr. |
| 671 // GenerateMakeCodeYoungAgainCommon for the stub code. | 671 // GenerateMakeCodeYoungAgainCommon for the stub code. |
| 672 patcher.masm()->nop(); // marker to detect sequence (see IsOld) | 672 patcher.masm()->nop(); // marker to detect sequence (see IsOld) |
| 673 patcher.masm()->mov(r3, Operand(target)); | 673 patcher.masm()->mov(r3, Operand(target)); |
| 674 patcher.masm()->Jump(r3); | 674 patcher.masm()->Jump(r3); |
| 675 for (int i = 0; i < kCodeAgingSequenceNops; i++) { | 675 for (int i = 0; i < kCodeAgingSequenceNops; i++) { |
| 676 patcher.masm()->nop(); | 676 patcher.masm()->nop(); |
| 677 } | 677 } |
| 678 } | 678 } |
| 679 } | 679 } |
| 680 } // namespace internal | 680 } // namespace internal |
| 681 } // namespace v8 | 681 } // namespace v8 |
| 682 | 682 |
| 683 #endif // V8_TARGET_ARCH_PPC | 683 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |