| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/x87/codegen-x87.h" | 5 #include "src/x87/codegen-x87.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/heap/heap.h" | 10 #include "src/heap/heap.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 CodeObjectRequired::kNo); | 45 CodeObjectRequired::kNo); |
| 46 // Load double input into registers. | 46 // Load double input into registers. |
| 47 __ fld_d(MemOperand(esp, 4)); | 47 __ fld_d(MemOperand(esp, 4)); |
| 48 __ X87SetFPUCW(0x027F); | 48 __ X87SetFPUCW(0x027F); |
| 49 __ fsqrt(); | 49 __ fsqrt(); |
| 50 __ X87SetFPUCW(0x037F); | 50 __ X87SetFPUCW(0x037F); |
| 51 __ Ret(); | 51 __ Ret(); |
| 52 | 52 |
| 53 CodeDesc desc; | 53 CodeDesc desc; |
| 54 masm.GetCode(&desc); | 54 masm.GetCode(&desc); |
| 55 DCHECK(!RelocInfo::RequiresRelocation(desc)); | 55 DCHECK(!RelocInfo::RequiresRelocation(isolate, desc)); |
| 56 | 56 |
| 57 Assembler::FlushICache(isolate, buffer, actual_size); | 57 Assembler::FlushICache(isolate, buffer, actual_size); |
| 58 base::OS::ProtectCode(buffer, actual_size); | 58 base::OS::ProtectCode(buffer, actual_size); |
| 59 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer); | 59 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer); |
| 60 } | 60 } |
| 61 | 61 |
| 62 | 62 |
| 63 // Helper functions for CreateMemMoveFunction. | 63 // Helper functions for CreateMemMoveFunction. |
| 64 #undef __ | 64 #undef __ |
| 65 #define __ ACCESS_MASM(masm) | 65 #define __ ACCESS_MASM(masm) |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 __ dec(dst); | 189 __ dec(dst); |
| 190 __ mov_b(Operand(dst, 0), eax); | 190 __ mov_b(Operand(dst, 0), eax); |
| 191 __ jmp(&backward_loop_1byte); | 191 __ jmp(&backward_loop_1byte); |
| 192 } | 192 } |
| 193 | 193 |
| 194 __ bind(&pop_and_return); | 194 __ bind(&pop_and_return); |
| 195 MemMoveEmitPopAndReturn(&masm); | 195 MemMoveEmitPopAndReturn(&masm); |
| 196 | 196 |
| 197 CodeDesc desc; | 197 CodeDesc desc; |
| 198 masm.GetCode(&desc); | 198 masm.GetCode(&desc); |
| 199 DCHECK(!RelocInfo::RequiresRelocation(desc)); | 199 DCHECK(!RelocInfo::RequiresRelocation(isolate, desc)); |
| 200 Assembler::FlushICache(isolate, buffer, actual_size); | 200 Assembler::FlushICache(isolate, buffer, actual_size); |
| 201 base::OS::ProtectCode(buffer, actual_size); | 201 base::OS::ProtectCode(buffer, actual_size); |
| 202 // TODO(jkummerow): It would be nice to register this code creation event | 202 // TODO(jkummerow): It would be nice to register this code creation event |
| 203 // with the PROFILE / GDBJIT system. | 203 // with the PROFILE / GDBJIT system. |
| 204 return FUNCTION_CAST<MemMoveFunction>(buffer); | 204 return FUNCTION_CAST<MemMoveFunction>(buffer); |
| 205 } | 205 } |
| 206 | 206 |
| 207 | 207 |
| 208 #undef __ | 208 #undef __ |
| 209 | 209 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 CodePatcher patcher(isolate, sequence, young_length); | 372 CodePatcher patcher(isolate, sequence, young_length); |
| 373 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); | 373 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 | 376 |
| 377 | 377 |
| 378 } // namespace internal | 378 } // namespace internal |
| 379 } // namespace v8 | 379 } // namespace v8 |
| 380 | 380 |
| 381 #endif // V8_TARGET_ARCH_X87 | 381 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |