| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
| 8 #include "src/arm64/macro-assembler-arm64.h" | 8 #include "src/arm64/macro-assembler-arm64.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 imm % (width)); \ | 457 imm % (width)); \ |
| 458 } \ | 458 } \ |
| 459 } while (0) | 459 } while (0) |
| 460 | 460 |
| 461 | 461 |
| 462 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { | 462 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
| 463 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 463 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
| 464 if (sp_slot_delta > 0) { | 464 if (sp_slot_delta > 0) { |
| 465 __ Add(jssp, jssp, Operand(sp_slot_delta * kPointerSize)); | 465 __ Add(jssp, jssp, Operand(sp_slot_delta * kPointerSize)); |
| 466 } | 466 } |
| 467 if (frame()->needs_frame()) { | |
| 468 __ Pop(fp, lr); | |
| 469 } | |
| 470 frame_access_state()->SetFrameAccessToDefault(); | 467 frame_access_state()->SetFrameAccessToDefault(); |
| 471 } | 468 } |
| 472 | 469 |
| 473 | 470 |
| 474 void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { | 471 void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { |
| 475 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 472 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
| 476 if (sp_slot_delta < 0) { | 473 if (sp_slot_delta < 0) { |
| 477 __ Sub(jssp, jssp, Operand(-sp_slot_delta * kPointerSize)); | 474 __ Sub(jssp, jssp, Operand(-sp_slot_delta * kPointerSize)); |
| 478 frame_access_state()->IncreaseSPDelta(-sp_slot_delta); | 475 frame_access_state()->IncreaseSPDelta(-sp_slot_delta); |
| 479 } | 476 } |
| 477 if (frame()->needs_frame()) { |
| 478 __ Ldr(lr, MemOperand(fp, StandardFrameConstants::kCallerPCOffset)); |
| 479 __ Ldr(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 480 } |
| 480 frame_access_state()->SetFrameAccessToSP(); | 481 frame_access_state()->SetFrameAccessToSP(); |
| 481 } | 482 } |
| 482 | 483 |
| 483 | 484 |
| 484 // Assembles an instruction after register allocation, producing machine code. | 485 // Assembles an instruction after register allocation, producing machine code. |
| 485 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { | 486 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
| 486 Arm64OperandConverter i(this, instr); | 487 Arm64OperandConverter i(this, instr); |
| 487 InstructionCode opcode = instr->opcode(); | 488 InstructionCode opcode = instr->opcode(); |
| 488 switch (ArchOpcodeField::decode(opcode)) { | 489 switch (ArchOpcodeField::decode(opcode)) { |
| 489 case kArchCallCodeObject: { | 490 case kArchCallCodeObject: { |
| (...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 padding_size -= kInstructionSize; | 1565 padding_size -= kInstructionSize; |
| 1565 } | 1566 } |
| 1566 } | 1567 } |
| 1567 } | 1568 } |
| 1568 | 1569 |
| 1569 #undef __ | 1570 #undef __ |
| 1570 | 1571 |
| 1571 } // namespace compiler | 1572 } // namespace compiler |
| 1572 } // namespace internal | 1573 } // namespace internal |
| 1573 } // namespace v8 | 1574 } // namespace v8 |
| OLD | NEW |