| 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/arm/codegen-arm.h" | 5 #include "src/arm/codegen-arm.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
| 8 | 8 |
| 9 #include "src/arm/simulator-arm.h" | 9 #include "src/arm/simulator-arm.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 masm.GetCode(&desc); | 317 masm.GetCode(&desc); |
| 318 | 318 |
| 319 Assembler::FlushICacheWithoutIsolate(buffer, actual_size); | 319 Assembler::FlushICacheWithoutIsolate(buffer, actual_size); |
| 320 base::OS::ProtectCode(buffer, actual_size); | 320 base::OS::ProtectCode(buffer, actual_size); |
| 321 | 321 |
| 322 return FUNCTION_CAST<MemCopyUint16Uint8Function>(buffer); | 322 return FUNCTION_CAST<MemCopyUint16Uint8Function>(buffer); |
| 323 #endif | 323 #endif |
| 324 } | 324 } |
| 325 #endif | 325 #endif |
| 326 | 326 |
| 327 UnaryMathFunction CreateSqrtFunction() { | 327 UnaryMathFunctionWithIsolate CreateSqrtFunction(Isolate* isolate) { |
| 328 #if defined(USE_SIMULATOR) | 328 #if defined(USE_SIMULATOR) |
| 329 return &std::sqrt; | 329 return nullptr; |
| 330 #else | 330 #else |
| 331 size_t actual_size; | 331 size_t actual_size; |
| 332 byte* buffer = | 332 byte* buffer = |
| 333 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); | 333 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); |
| 334 if (buffer == NULL) return &std::sqrt; | 334 if (buffer == nullptr) return nullptr; |
| 335 | 335 |
| 336 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size), | 336 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size), |
| 337 CodeObjectRequired::kNo); | 337 CodeObjectRequired::kNo); |
| 338 | 338 |
| 339 __ MovFromFloatParameter(d0); | 339 __ MovFromFloatParameter(d0); |
| 340 __ vsqrt(d0, d0); | 340 __ vsqrt(d0, d0); |
| 341 __ MovToFloatResult(d0); | 341 __ MovToFloatResult(d0); |
| 342 __ Ret(); | 342 __ Ret(); |
| 343 | 343 |
| 344 CodeDesc desc; | 344 CodeDesc desc; |
| 345 masm.GetCode(&desc); | 345 masm.GetCode(&desc); |
| 346 DCHECK(!RelocInfo::RequiresRelocation(desc)); | 346 DCHECK(!RelocInfo::RequiresRelocation(desc)); |
| 347 | 347 |
| 348 Assembler::FlushICacheWithoutIsolate(buffer, actual_size); | 348 Assembler::FlushICache(isolate, buffer, actual_size); |
| 349 base::OS::ProtectCode(buffer, actual_size); | 349 base::OS::ProtectCode(buffer, actual_size); |
| 350 return FUNCTION_CAST<UnaryMathFunction>(buffer); | 350 return FUNCTION_CAST<UnaryMathFunctionWithIsolate>(buffer); |
| 351 #endif | 351 #endif |
| 352 } | 352 } |
| 353 | 353 |
| 354 #undef __ | 354 #undef __ |
| 355 | 355 |
| 356 | 356 |
| 357 // ------------------------------------------------------------------------- | 357 // ------------------------------------------------------------------------- |
| 358 // Platform-specific RuntimeCallHelper functions. | 358 // Platform-specific RuntimeCallHelper functions. |
| 359 | 359 |
| 360 void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const { | 360 void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const { |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 945 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
| 946 patcher.masm()->emit_code_stub_address(stub); | 946 patcher.masm()->emit_code_stub_address(stub); |
| 947 } | 947 } |
| 948 } | 948 } |
| 949 | 949 |
| 950 | 950 |
| 951 } // namespace internal | 951 } // namespace internal |
| 952 } // namespace v8 | 952 } // namespace v8 |
| 953 | 953 |
| 954 #endif // V8_TARGET_ARCH_ARM | 954 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |