OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/arm64/codegen-arm64.h" | 5 #include "src/arm64/codegen-arm64.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/arm64/simulator-arm64.h" | 9 #include "src/arm64/simulator-arm64.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 OMIT_SMI_CHECK); | 366 OMIT_SMI_CHECK); |
367 } | 367 } |
368 | 368 |
369 | 369 |
370 CodeAgingHelper::CodeAgingHelper(Isolate* isolate) { | 370 CodeAgingHelper::CodeAgingHelper(Isolate* isolate) { |
371 USE(isolate); | 371 USE(isolate); |
372 DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength); | 372 DCHECK(young_sequence_.length() == kNoCodeAgeSequenceLength); |
373 // The sequence of instructions that is patched out for aging code is the | 373 // The sequence of instructions that is patched out for aging code is the |
374 // following boilerplate stack-building prologue that is found both in | 374 // following boilerplate stack-building prologue that is found both in |
375 // FUNCTION and OPTIMIZED_FUNCTION code: | 375 // FUNCTION and OPTIMIZED_FUNCTION code: |
376 PatchingAssembler patcher(young_sequence_.start(), | 376 PatchingAssembler patcher(isolate, young_sequence_.start(), |
377 young_sequence_.length() / kInstructionSize); | 377 young_sequence_.length() / kInstructionSize); |
378 // The young sequence is the frame setup code for FUNCTION code types. It is | 378 // The young sequence is the frame setup code for FUNCTION code types. It is |
379 // generated by FullCodeGenerator::Generate. | 379 // generated by FullCodeGenerator::Generate. |
380 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); | 380 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); |
381 | 381 |
382 #ifdef DEBUG | 382 #ifdef DEBUG |
383 const int length = kCodeAgeStubEntryOffset / kInstructionSize; | 383 const int length = kCodeAgeStubEntryOffset / kInstructionSize; |
384 DCHECK(old_sequence_.length() >= kCodeAgeStubEntryOffset); | 384 DCHECK(old_sequence_.length() >= kCodeAgeStubEntryOffset); |
385 PatchingAssembler patcher_old(old_sequence_.start(), length); | 385 PatchingAssembler patcher_old(isolate, old_sequence_.start(), length); |
386 MacroAssembler::EmitCodeAgeSequence(&patcher_old, NULL); | 386 MacroAssembler::EmitCodeAgeSequence(&patcher_old, NULL); |
387 #endif | 387 #endif |
388 } | 388 } |
389 | 389 |
390 | 390 |
391 #ifdef DEBUG | 391 #ifdef DEBUG |
392 bool CodeAgingHelper::IsOld(byte* candidate) const { | 392 bool CodeAgingHelper::IsOld(byte* candidate) const { |
393 return memcmp(candidate, old_sequence_.start(), kCodeAgeStubEntryOffset) == 0; | 393 return memcmp(candidate, old_sequence_.start(), kCodeAgeStubEntryOffset) == 0; |
394 } | 394 } |
395 #endif | 395 #endif |
(...skipping 14 matching lines...) Expand all Loading... |
410 Code* stub = GetCodeFromTargetAddress(Memory::Address_at(target)); | 410 Code* stub = GetCodeFromTargetAddress(Memory::Address_at(target)); |
411 GetCodeAgeAndParity(stub, age, parity); | 411 GetCodeAgeAndParity(stub, age, parity); |
412 } | 412 } |
413 } | 413 } |
414 | 414 |
415 | 415 |
416 void Code::PatchPlatformCodeAge(Isolate* isolate, | 416 void Code::PatchPlatformCodeAge(Isolate* isolate, |
417 byte* sequence, | 417 byte* sequence, |
418 Code::Age age, | 418 Code::Age age, |
419 MarkingParity parity) { | 419 MarkingParity parity) { |
420 PatchingAssembler patcher(sequence, | 420 PatchingAssembler patcher(isolate, sequence, |
421 kNoCodeAgeSequenceLength / kInstructionSize); | 421 kNoCodeAgeSequenceLength / kInstructionSize); |
422 if (age == kNoAgeCodeAge) { | 422 if (age == kNoAgeCodeAge) { |
423 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); | 423 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); |
424 } else { | 424 } else { |
425 Code * stub = GetCodeAgeStub(isolate, age, parity); | 425 Code * stub = GetCodeAgeStub(isolate, age, parity); |
426 MacroAssembler::EmitCodeAgeSequence(&patcher, stub); | 426 MacroAssembler::EmitCodeAgeSequence(&patcher, stub); |
427 } | 427 } |
428 } | 428 } |
429 | 429 |
430 | 430 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 | 631 |
632 __ Bind(&done); | 632 __ Bind(&done); |
633 } | 633 } |
634 | 634 |
635 #undef __ | 635 #undef __ |
636 | 636 |
637 } // namespace internal | 637 } // namespace internal |
638 } // namespace v8 | 638 } // namespace v8 |
639 | 639 |
640 #endif // V8_TARGET_ARCH_ARM64 | 640 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |