| 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 "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "codegen.h" | 9 #include "codegen.h" |
| 10 #include "macro-assembler.h" | 10 #include "macro-assembler.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 __ Pop(lr); | 343 __ Pop(lr); |
| 344 | 344 |
| 345 __ Bind(&only_change_map); | 345 __ Bind(&only_change_map); |
| 346 __ Str(target_map, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 346 __ Str(target_map, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
| 347 __ RecordWriteField(receiver, HeapObject::kMapOffset, target_map, x13, | 347 __ RecordWriteField(receiver, HeapObject::kMapOffset, target_map, x13, |
| 348 kLRHasNotBeenSaved, kDontSaveFPRegs, OMIT_REMEMBERED_SET, | 348 kLRHasNotBeenSaved, kDontSaveFPRegs, OMIT_REMEMBERED_SET, |
| 349 OMIT_SMI_CHECK); | 349 OMIT_SMI_CHECK); |
| 350 } | 350 } |
| 351 | 351 |
| 352 | 352 |
| 353 bool Code::IsYoungSequence(byte* sequence) { | 353 NoCodeAgeSequence::NoCodeAgeSequence() { |
| 354 return MacroAssembler::IsYoungSequence(sequence); | 354 ASSERT(sequence_.length() == kNoCodeAgeSequenceLength); |
| 355 // The sequence of instructions that is patched out for aging code is the |
| 356 // following boilerplate stack-building prologue that is found both in |
| 357 // FUNCTION and OPTIMIZED_FUNCTION code: |
| 358 PatchingAssembler patcher(sequence_.start(), |
| 359 sequence_.length() / kInstructionSize); |
| 360 // The young sequence is the frame setup code for FUNCTION code types. It is |
| 361 // generated by FullCodeGenerator::Generate. |
| 362 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); |
| 355 } | 363 } |
| 356 | 364 |
| 357 | 365 |
| 358 void Code::GetCodeAgeAndParity(byte* sequence, Age* age, | 366 bool Code::IsYoungSequence(Isolate* isolate, byte* sequence) { |
| 367 return MacroAssembler::IsYoungSequence(isolate, sequence); |
| 368 } |
| 369 |
| 370 |
| 371 void Code::GetCodeAgeAndParity(Isolate* isolate, byte* sequence, Age* age, |
| 359 MarkingParity* parity) { | 372 MarkingParity* parity) { |
| 360 if (IsYoungSequence(sequence)) { | 373 if (IsYoungSequence(isolate, sequence)) { |
| 361 *age = kNoAgeCodeAge; | 374 *age = kNoAgeCodeAge; |
| 362 *parity = NO_MARKING_PARITY; | 375 *parity = NO_MARKING_PARITY; |
| 363 } else { | 376 } else { |
| 364 byte* target = sequence + kCodeAgeStubEntryOffset; | 377 byte* target = sequence + kCodeAgeStubEntryOffset; |
| 365 Code* stub = GetCodeFromTargetAddress(Memory::Address_at(target)); | 378 Code* stub = GetCodeFromTargetAddress(Memory::Address_at(target)); |
| 366 GetCodeAgeAndParity(stub, age, parity); | 379 GetCodeAgeAndParity(stub, age, parity); |
| 367 } | 380 } |
| 368 } | 381 } |
| 369 | 382 |
| 370 | 383 |
| 371 void Code::PatchPlatformCodeAge(Isolate* isolate, | 384 void Code::PatchPlatformCodeAge(Isolate* isolate, |
| 372 byte* sequence, | 385 byte* sequence, |
| 373 Code::Age age, | 386 Code::Age age, |
| 374 MarkingParity parity) { | 387 MarkingParity parity) { |
| 375 PatchingAssembler patcher(sequence, kCodeAgeSequenceSize / kInstructionSize); | 388 PatchingAssembler patcher(sequence, |
| 389 kNoCodeAgeSequenceLength / kInstructionSize); |
| 376 if (age == kNoAgeCodeAge) { | 390 if (age == kNoAgeCodeAge) { |
| 377 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); | 391 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); |
| 378 } else { | 392 } else { |
| 379 Code * stub = GetCodeAgeStub(isolate, age, parity); | 393 Code * stub = GetCodeAgeStub(isolate, age, parity); |
| 380 MacroAssembler::EmitCodeAgeSequence(&patcher, stub); | 394 MacroAssembler::EmitCodeAgeSequence(&patcher, stub); |
| 381 } | 395 } |
| 382 } | 396 } |
| 383 | 397 |
| 384 | 398 |
| 385 void StringCharLoadGenerator::Generate(MacroAssembler* masm, | 399 void StringCharLoadGenerator::Generate(MacroAssembler* masm, |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 __ Fmul(result, double_temp3, double_temp1); | 597 __ Fmul(result, double_temp3, double_temp1); |
| 584 | 598 |
| 585 __ Bind(&done); | 599 __ Bind(&done); |
| 586 } | 600 } |
| 587 | 601 |
| 588 #undef __ | 602 #undef __ |
| 589 | 603 |
| 590 } } // namespace v8::internal | 604 } } // namespace v8::internal |
| 591 | 605 |
| 592 #endif // V8_TARGET_ARCH_ARM64 | 606 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |