Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: src/arm/codegen-arm.cc

Issue 1473683004: Lazily initialize fast_sqrt() and pass an Isolate parameter to it (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/arm/simulator-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/arm/simulator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698