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 15 matching lines...) Expand all Loading... |
26 #endif | 26 #endif |
27 | 27 |
28 | 28 |
29 UnaryMathFunctionWithIsolate CreateExpFunction(Isolate* isolate) { | 29 UnaryMathFunctionWithIsolate CreateExpFunction(Isolate* isolate) { |
30 size_t actual_size; | 30 size_t actual_size; |
31 byte* buffer = | 31 byte* buffer = |
32 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); | 32 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); |
33 if (buffer == nullptr) return nullptr; | 33 if (buffer == nullptr) return nullptr; |
34 ExternalReference::InitializeMathExpData(); | 34 ExternalReference::InitializeMathExpData(); |
35 | 35 |
36 MacroAssembler masm(nullptr, buffer, static_cast<int>(actual_size)); | 36 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size), false); |
37 | 37 |
38 { | 38 { |
39 DoubleRegister input = d1; | 39 DoubleRegister input = d1; |
40 DoubleRegister result = d2; | 40 DoubleRegister result = d2; |
41 DoubleRegister double_scratch1 = d3; | 41 DoubleRegister double_scratch1 = d3; |
42 DoubleRegister double_scratch2 = d4; | 42 DoubleRegister double_scratch2 = d4; |
43 Register temp1 = r7; | 43 Register temp1 = r7; |
44 Register temp2 = r8; | 44 Register temp2 = r8; |
45 Register temp3 = r9; | 45 Register temp3 = r9; |
46 | 46 |
(...skipping 28 matching lines...) Expand all Loading... |
75 | 75 |
76 UnaryMathFunction CreateSqrtFunction() { | 76 UnaryMathFunction CreateSqrtFunction() { |
77 #if defined(USE_SIMULATOR) | 77 #if defined(USE_SIMULATOR) |
78 return &std::sqrt; | 78 return &std::sqrt; |
79 #else | 79 #else |
80 size_t actual_size; | 80 size_t actual_size; |
81 byte* buffer = | 81 byte* buffer = |
82 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); | 82 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); |
83 if (buffer == NULL) return &std::sqrt; | 83 if (buffer == NULL) return &std::sqrt; |
84 | 84 |
85 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); | 85 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size), false); |
86 | 86 |
87 // Called from C | 87 // Called from C |
88 __ function_descriptor(); | 88 __ function_descriptor(); |
89 | 89 |
90 __ MovFromFloatParameter(d1); | 90 __ MovFromFloatParameter(d1); |
91 __ fsqrt(d1, d1); | 91 __ fsqrt(d1, d1); |
92 __ MovToFloatResult(d1); | 92 __ MovToFloatResult(d1); |
93 __ Ret(); | 93 __ Ret(); |
94 | 94 |
95 CodeDesc desc; | 95 CodeDesc desc; |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 patcher.masm()->Jump(r3); | 673 patcher.masm()->Jump(r3); |
674 for (int i = 0; i < kCodeAgingSequenceNops; i++) { | 674 for (int i = 0; i < kCodeAgingSequenceNops; i++) { |
675 patcher.masm()->nop(); | 675 patcher.masm()->nop(); |
676 } | 676 } |
677 } | 677 } |
678 } | 678 } |
679 } // namespace internal | 679 } // namespace internal |
680 } // namespace v8 | 680 } // namespace v8 |
681 | 681 |
682 #endif // V8_TARGET_ARCH_PPC | 682 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |